Compatible flat metrics

We solve the problem of description for nonsingular pairs of compatible flat metrics in the general N-component case. The integrable nonlinear partial differential equations describing all nonsingular pairs of compatible flat metrics (or, in other words, nonsingular flat pencils of metrics) are found and integrated. The integrating of these equations is based on reducing to a special nonlinear differential reduction of the Lame equations and using the Zakharov method of differential reductions in the dressing method (a version of the inverse scattering method).


Introduction. Basic definitions
We shall use both contravariant metrics g ij (u) with upper indices, where u = (u 1 , ..., u N ) are local coordinates, 1 ≤ i, j ≤ N , and covariant metrics g ij (u) with lower indices, g is (u)g sj (u) = δ i j . The indices of the coefficients of the Levi-Civita connections Γ i jk (u) and the indices of the tensors of Riemannian curvature R i jkl (u) are raised and lowered by the metrics corresponding to them: Definition 1.1 Two contravariant flat metrics g ij 1 (u) and g ij 2 (u) are called compatible if any linear combination of these metrics g ij (u) = λ 1 g ij 1 (u) + λ 2 g ij 2 (u), (1.1) where λ 1 and λ 2 are arbitrary constants such that det(g ij (u)) ≡ 0, is also a flat metric and the coefficients of the corresponding Levi-Civita connections are related by the same linear formula: In this case, we shall also say that the flat metrics g ij 1 (u) and g ij 2 (u) form a flat pencil (this definition was proposed by Dubrovin in [7], [6]). Definition 1.2 Two contravariant metrics g ij 1 (u) and g ij 2 (u) of constant Riemannian curvature K 1 and K 2 , respectively, are called compatible if any linear combination of these metrics g ij (u) = λ 1 g ij 1 (u) + λ 2 g ij 2 (u), (1.3) where λ 1 and λ 2 are arbitrary constants such that det(g ij (u)) ≡ 0, is a metric of constant Riemannian curvature λ 1 K 1 + λ 2 K 2 and the coefficients of the corresponding Levi-Civita connections are related by the same linear formula: In this case, we shall also say that the metrics g ij 1 (u) and g ij 2 (u) form a pencil of metrics of constant Riemannian curvature. Definition 1.3 Two Riemannian or pseudo-Riemannian contravariant metrics g ij 1 (u) and g ij 2 (u) are called compatible if for any linear combination of these metrics g ij (u) = λ 1 g ij 1 (u) + λ 2 g ij 2 (u), (1.5) where λ 1 and λ 2 are arbitrary constants such that det(g ij (u)) ≡ 0, the coefficients of the corresponding Levi-Civita connections and the components of the corresponding tensors of Riemannian curvature are related by the same linear formula: In this case, we shall also say that the metrics g ij 1 (u) and g ij 2 (u) form a pencil of metrics.
Definition 1.4 Two Riemannian or pseudo-Riemannian contravariant metrics g ij 1 (u) and g ij 2 (u) are called almost compatible if for any linear combination of these metrics (1.5) relation (1.6) is fulfilled. Definition 1.5 Two Riemannian or pseudo-Riemannian metrics g ij 1 (u) and g ij 2 (u) are called a nonsingular pair of metrics if the eigenvalues of this pair of metrics, that is, the roots of the equation det(g ij 1 (u) − λg ij 2 (u)) = 0, (1.8) are distinct.
A pencil of metrics is called nonsingular if it is formed by a nonsingular pair of metrics.
These definitions are motivated by the theory of compatible Poisson brackets of hydrodynamic type. We give a brief survey of this theory in the next section. If the metrics g ij 1 (u) and g ij 2 (u) are flat, that is, R i 1,jkl (u) = R i 2,jkl (u) = 0, then relation (1.7) is equivalent to the condition that an arbitrary linear combination of the flat metrics g ij 1 (u) and g ij 2 (u) is also a flat metric. In this case, Definition 1.3 is equivalent to the well-known definition of a flat pencil of metrics (Definition 1.1) or, in other words, a compatible pair of local nondegenerate Poisson structures of hydrodynamic type [7] (see also [6], [8], [12], [26]- [30]). If the metrics g ij 1 (u) and g ij 2 (u) are metrics of constant Riemannian curvature K 1 and K 2 , respectively, that is, R ij 1,kl (u) = K 1 (δ i l δ j k − δ i k δ j l ), R ij 2,kl (u) = K 2 (δ i l δ j k − δ i k δ j l ), then relation (1.7) gives the condition that an arbitrary linear combination of the metrics g ij 1 (u) and g ij 2 (u) (1.5) is a metric of constant Riemannian curvature λ 1 K 1 + λ 2 K 2 . In this case, Definition 1.3 is equivalent to our Definition 1.2 of a pencil of metrics of constant Riemannian curvature or, in other words, a compatible pair of the corresponding nonlocal Poisson structures of hydrodynamic type, which were introduced and studied by the present author and Ferapontov in [31]. Compatible metrics of more general type correspond to a compatible pair of nonlocal Poisson structures of hydrodynamic type that were introduced and studied by Ferapontov in [13]. They arise, for example, if we use a recursion operator generated by a pair of compatible Poisson structures of hydrodynamic type. Such recursion operators determine, as is well-known, infinite sequences of corresponding (generally speaking, nonlocal) Poisson structures.
As was earlier noted by the present author in [27]- [30], condition (1.7) follows from condition (1.6) in the case of certain special reductions connected with the associativity equations (see also Theorem 3.2 below). Of course, it is not accidentally. Under certain very natural and quite general assumptions on metrics (it is sufficient but not necessary, in particular, that eigenvalues of the pair of metrics under consideration are distinct), compatibility of the metrics follows from their almost compatibility but, generally speaking, in the general case, it is not true even for flat metrics (we shall present the corresponding counterexamples below). Correspondingly, we would like to emphasize that condition (1.6), which is considerably more simple than condition (1.7), "almost" guarantees compatibility of metrics and deserves a separate study but, in the general case, it is necessary to require also the fulfillment of condition (1.7) for compatibility of the corresponding Poisson structures of hydrodynamic type. It is also interesting to find out, does condition (1.7) guarantee the fulfillment of condition (1.6) or not. This paper is devoted to the problem of description for all nonsingular pairs of compatible flat metrics and to integrability of the corresponding nonlinear partial differential equations by the inverse scattering method.

Compatible local Poisson structures of hydrodynamic type
Any local homogeneous first-order Poisson bracket, that is, a Poisson bracket of the form where u 1 , ..., u N are local coordinates on a certain smooth N -dimensional manifold M , is called a local Poisson structure of hydrodynamic type or Dubrovin-Novikov structure [9]. Here, u i (x), 1 ≤ i ≤ N, are functions (fields) of a single independent variable x, the coefficients g ij (u) and b ij k (u) of bracket (2.1) are smooth functions of local coordinates.
In other words, for arbitrary functionals I[u] and J[u] on the space of fields u i (x), 1 ≤ i ≤ N, a bracket of the form is defined and it is required that this bracket is a Poisson bracket, that is, it is skew-symmetric: is automatically fulfilled according to the following property of variational derivative of functionals: .
Recall that variational derivative of an arbitrary functional I[u] is defined by The definition of a local Poisson structure of hydrodynamic type does not depend on a choice of local coordinates u 1 , ..., u N on the manifold M . Actually, the form of brackets (2.2) is invariant under local changes of coordinates since variational derivatives of functionals transform like covector fields: Correspondingly, the coefficients g ij (u) and b ij k (u) of bracket (2.2) transform as follows: In particular, the coefficients g ij (u) define a contravariant tensor field of rank 2 (a contravariant "metric") on the manifold M . For the important case of a nondegenerate metric g ij (u), det g ij = 0, (that is, in the case of a pseudo-Riemannian manifold (M, g ij )), the coefficients b ij k (u) define the Christoffel symbols of an affine The local Poisson structures of hydrodynamic type (2.1) were introduced and studied by Dubrovin and Novikov in [9]. In this paper, they proposed a general local Hamiltonian approach (this approach corresponds to the local structures of form (2.1)) to the so-called homogeneous systems of hydrodynamic type, that is, evolutionary quasilinear systems of first-order partial differential equations This Hamiltonian approach was motivated by the study of the equations of Euler hydrodynamics and the Whitham averaging equations, which describe the evolution of slowly modulated multiphase solutions of partial differential equations [10].
Local bracket (2.2) is called nondegenerate if det(g ij (u)) ≡ 0. For the general nondegenerate brackets of form (2.2), Dubrovin and Novikov proved the following important theorem.
Theorem 2.1 (Dubrovin and Novikov [9]) If det(g ij (u)) ≡ 0, then bracket (2.2) is a Poisson bracket, that is, it is skew-symmetric and satisfies the Jacobi identity, if and only if (1) g ij (u) is an arbitrary flat pseudo-Riemannian contravariant metric (a metric of zero Riemannian curvature), is the Riemannian connection generated by the contravariant metric g ij (u) (the Levi-Civita connection).
Consequently, for any local nondegenerate Poisson structure of hydrodynamic type, there always exist local coordinates v 1 , ..., v N (flat coordinates of the metric g ij (u)) in which all the coefficients of the bracket are constant: that is, the bracket has the constant form where (η ij ) is a nondegenerate symmetric constant matrix: On the other hand, as early as 1978, Magri proposed a bi-Hamiltonian approach to the integration of nonlinear systems [22]. This approach demonstrated that integrability is closely related to the bi-Hamiltonian property, that is, to the property of a system to have two compatible Hamiltonian representations. As was shown by Magri in [22], compatible Poisson brackets generate integrable hierarchies of systems of differential equations. Therefore, the description of compatible Poisson structures is very urgent and important problem in the theory of integrable systems. In particular, for a system, the bi-Hamiltonian property generates recurrent relations for the conservation laws of this system.
Beginning from [22], quite extensive literature (see, for example, [5], [15], [16], [18], [36], and the necessary references therein) has been devoted to the bi-Hamiltonian approach and to the construction of compatible Poisson structures for many specific important equations of mathematical physics and field theory. As far as the problem of description of sufficiently wide classes of compatible Poisson structures of defined special types is concerned, apparently the first such statement was considered in [23], [24] (see also [2], [3]). In those papers, the present author posed and completely solved the problem of description of all compatible local scalar first-order and third-order Poisson brackets, that is, all Poisson brackets given by arbitrary scalar first-order and third-order ordinary differential operators. These brackets generalize the well-known compatible pair of the Gardner-Zakharov-Faddeev bracket [17], [39] (the first-order bracket) and the Magri bracket [22] (the third-order bracket) for the Korteweg-de Vries equation.
In the case of homogeneous systems of hydrodynamic type, many integrable systems possess compatible Poisson structures of hydrodynamic type. The problems of description of these structures for particular systems and numerous examples were considered in many papers (see, for example, [35], [37], [1], [34], [19], [14]). In particular, in [35] Nutku studied a special class of compatible two-component Poisson structures of hydrodynamic type and the related bi-Hamiltonian hydrodynamic systems. In [11] Ferapontov classified all two-component homogeneous systems of hydrodynamic type possessing three compatible nondegenerate local Poisson structures of hydrodynamic type.
In the general form, the problem of description of flat pencils of metrics (or, in other words, compatible nondegenerate local Poisson structures of hydrodynamic type) was considered by Dubrovin in [7], [6] in connection with the construction of important examples of such flat pencils of metrics, generated by natural pairs of flat metrics on the spaces of orbits of Coxeter groups and on other Frobenius manifolds and associated with the corresponding quasi-homogeneous solutions of the associativity equations. In the theory of Frobenius manifolds introduced and studied by Dubrovin [7], [6] (they correspond to two-dimensional topological field theories), a key role is played by flat pencils of metrics, possessing a number of special additional (and very restrictive) properties (they satisfy the so-called quasihomogeneity property). In addition, in [8] Dubrovin proved that the theory of Frobenius manifolds is equivalent to the theory of quasi-homogeneous compatible nondegenerate local Poisson structures of hydrodynamic type. The general problem on compatible nondegenerate local Poisson structures of hydrodynamic type was also considered by Ferapontov in [12].
The present author's papers [26]- [30] are devoted to the general problem of classification of all compatible local Poisson structures of hydrodynamic type, the study of the integrable nonlinear systems that describe such the compatible Poisson structures and, mainly, the special reductions connected with the associativity equations.
where λ 1 and λ 2 are arbitrary constants, is also a Poisson bracket. In this case, we also say that the brackets { , } 1 and { , } 2 form a pencil of Poisson brackets.
Correspondingly, the problem of description for compatible nondegenerate local Poisson structures of hydrodynamic type is pure differential-geometric problem of description for flat pencils of metrics (see [7], [6]).
In [7], [6] Dubrovin presented all the tensor relations for the general flat pencils of metrics. First, we introduce the necessary notation. Let ∇ 1 and ∇ 2 be the operators of covariant differentiation given by the Levi-Civita connections Γ ij 1,k (u) and Γ ij 2,k (u), generated by the metrics g ij 1 (u) and g ij 2 (u), respectively. The indices of the covariant differentials are raised and lowered by the corresponding metrics: introduced by Dubrovin in [7], [6].
Theorem 2.2 (Dubrovin [7], [6]) If metrics g ij 1 (u) and g ij 2 (u) form a flat pencil, then there exists a vector field f i (u) such that the tensor ∆ ijk (u) and the metric g ij where c is a certain constant, and the vector field f i (u) satisfies the equations Conversely, for the flat metric g ij 2 (u) and the vector field f i (u) that is a solution of the system of equations (2.21) and (2.23), the metrics g ij 2 (u) and (2.20) form a flat pencil.
The proof of this theorem immediately follows from the relations that are equivalent to the fact that the metrics g ij 1 (u) and g ij 2 (u) form a flat pencil and are considered in flat coordinates of the metric g ij 2 (u) [7], [6]. In my paper [26], an explicit and simple criterion of compatibility for two local Poisson structures of hydrodynamic type is formulated, that is, it is shown what explicit form is sufficient and necessary for the local Poisson structures of hydrodynamic type to be compatible.
For the moment, in the general case, we are able to formulate such an explicit criterion only namely in terms of Poisson structures but not in terms of metrics as in Theorem 2.2. But for nonsingular pairs of the Poisson structures of hydrodynamic type (that is, for nonsingular pairs of the corresponding metrics), in this paper, we shall get an explicit general criterion of compatibility namely in terms of the corresponding metrics.
are smooth functions defined on a certain neighbourhood.
We do not require in Lemma 2.1 that the Poisson structure of hydrodynamic type {I, J} 2 is nondegenerate. Besides, it is important to note that this statement is local.
In 1995, in the paper [12], Ferapontov proposed an approach to the problem on flat pencils of metrics, which is motivated by the theory of recursion operators, and formulated (without any proof) the following theorem as a criterion of compatibility for nondegenerate local Poisson structures of hydrodynamic type: Besides, in the remark in [12], it is noted that if the spectrum of v i j (u) is simple, then the vanishing of the Nijenhuis tensor implies the existence of coordinates R 1 , ..., R N for which all the objects v i j (u), g ij 1 (u), g ij 2 (u) become diagonal. Moreover, in these coordinates the ith eigenvalue of v i j (u) depends only on the coordinate R i . In the case when all the eigenvalues are nonconstant, they can be introduced as new coordinates. In these new coordinatesṽ i ). In this paper, we shall prove that, unfortunately, in the general case, Theorem 2.3 is not true and, correspondingly, it is not a criterion of compatibility of flat metrics. Generally speaking, compatibility of flat metrics does not follow from the vanishing of the corresponding Nijenhuis tensor. The corresponding counterexamples will be presented below in Section 7. We also prove that, in the general case, Theorem 2.3 is actually a criterion of almost compatibility of flat metrics that does not guarantee compatibility of the corresponding nondegenerate local Poisson structures of hydrodynamic type. But if the spectrum of v i j (u) is simple, that is, all the eigenvalues are distinct, then we prove that Theorem 2.3 is not only true but also can be essentially generalized to the case of arbitrary compatible Riemannian or pseudo-Riemannian metrics, in particular, the especially important cases in the theory of systems of hydrodynamic type, namely, the cases of metrics of constant Riemannian curvature or the metrics generating the general nonlocal Poisson structures of hydrodynamic type.
Namely, we shall prove the following theorems for any pseudo-Riemannian metrics (not only for flat metrics as in Theorem 2.3).

Theorem 2.4
1) If for any linear combination (1.5) of two metrics g ij 1 (u) and g ij 2 (u) condition (1.6) is fulfilled, then the Nijenhuis tensor of the affinor v i j (u) = g is 1 (u)g 2,sj (u) vanishes. Thus, for any two compatible or almost compatible metrics, the corresponding Nijenhuis tensor always vanishes.
2) If a pair of metrics g ij 1 (u) and g ij 2 (u) is nonsingular, that is, the roots of the equation are distinct, then it follows from the vanishing of the Nijenhuis tensor of the affinor v i j (u) = g is 1 (u)g 2,sj (u) that the metrics g ij 1 (u) and g ij 2 (u) are compatible. Thus, a nonsingular pair of metrics is compatible if and only if the metrics are almost compatible.
Theorem 2.5 Any nonsingular pair of metrics is compatible if and only if there exist local coordinates u = (u 1 , ..., u N ) such that g ij 2 (u) = g i (u)δ ij and g ij .., N, are arbitrary (generally speaking, complex) functions of single variables (of course, the functions f i (u i ) are not equal identically to zero and, for nonsingular pairs of metrics, all these functions must be distinct and they can not be equal to one another if they are constants but, nevertheless, in this special case, the metrics will be also compatible).

Almost compatible metrics and the Nijenhuis tensor
Let us consider two arbitrary contravariant Riemannian or pseudo-Riemannian metrics g ij 1 (u) and g ij 2 (u), and also the corresponding coefficients of the Levi-Civita connections Γ ij 1,k (u) and Γ ij 2,k (u). We introduce the tensor It follows from the following representation that M ijk (u) is actually a tensor: that is, the connection is compatible with the metric, and that is, the connection is symmetric.
Let us introduce the affinor v i j (u) = g is 1 (u)g 2,sj (u) (3.5) and consider the Nijenhuis tensor of this affinor following [12], where were similarly considered the affinor v i j (u) and its Nijenhuis tensor for two flat metrics. Theorem 3.1 Any two metrics g ij 1 (u) and g ij 2 (u) are almost compatible if and only if the corresponding Nijenhuis tensor N k ij (u) (3.6) vanishes.
In particular, in the present author's papers [27]- [30], it is proved that in the two-component case (N = 2), for η ij = ε i δ ij , ε i = ±1, condition (3.11) is equivalent to the following linear second-order partial differential equation with constant coefficients: where α and β are arbitrary constants which are not equal to zero simultaneously.

Compatible metrics and the Nijenhuis tensor
Let us prove the second part of Theorem 2.4. In the previous section, it is proved, in particular, that it always follows from compatibility (moreover, even from almost compatibility) of metrics that the corresponding Nijenhuis tensor vanishes (Theorem 3.1).
Assume that a pair of metrics g ij 1 (u) and g ij 2 (u) is nonsingular, that is, the eigenvalues of this pair of metrics are distinct. Furthermore, assume that the corresponding Nijenhuis tensor vanishes. Let us prove that, in this case, the metrics g ij 1 (u) and g ij 2 (u) are compatible (their almost compatibility follows from Theorem 3.1).
It is obvious that the eigenvalues of the pair of metrics g ij 1 (u) and g ij 2 (u) coincide with the eigenvalues of the affinor v i j (u). But it is well known that if all eigenvalues of an affinor are distinct, then it always follows from the vanishing of the Nijenhuis tensor of this affinor that there exist local coordinates such that, in these coordinates, the affinor reduces to a diagonal form in the corresponding neighbourhood [33] (see also [20]).
So, further, we can consider that the affinor v i j (u) is diagonal in the local coor- where is no summation over the index i. By assumption, the eigenvalues λ i (u), i = 1, ..., N, coinciding with the eigenvalues of the pair of metrics g ij 1 (u) and g ij 2 (u) are distinct: is diagonal in certain local coordinates and all its eigenvalues are distinct, then, in these coordinates, the metrics g ij 1 (u) and g ij 2 (u) are also necessarily diagonal.
Proof. Actually, we have It follows from symmetry of the metrics g ij 1 (u) and g ij 2 (u) that for any indices i and where is no summation over indices, that is, 2) If all the eigenvalues coincide, then the Nijenhuis tensor vanishes.
3) In the general case of an arbitrary diagonal affinor w i j (u) = µ i (u)δ i j , the Nijenhuis tensor vanishes if and only if for all indices i and j such that µ i (u) = µ j (u).
Proof. Actually, for any diagonal affinor w i j (u) = µ i (u)δ i j , the Nijenhuis tensor N k ij (u) has the form

(no summation over indices). Thus, the Nijenhuis tensor vanishes if and only if for any indices i and j
(µ i (u) − µ j (u)) ∂µ i ∂u j = 0, where is no summation over indices. q.e.d.
It follows from Lemmas 4.1 and 4.2 that for any nonsingular pair of almost compatible metrics there always exist local coordinates in which the metrics have the form Moreover, we immediately derive that any pair of diagonal metrics of the form g ij 2 (u) = g i (u)δ ij and g ij 1 (u) = f i (u i )g i (u)δ ij for any nonzero functions f i (u i ), i = 1, ..., N, (here they can be, for example, coinciding nonzero constants, that is, the pair of metrics may be "singular") is almost compatible, since the corresponding Nijenhuis tensor always vanishes for any pair of metrics of this form.
We shall prove now that any pair of metrics of this form is always compatible. Then Theorems 2.4 and 2.5 will be completely proved.
Consider two diagonal metrics of the form g ij 2 (u) = g i (u)δ ij and g ij .., N, are arbitrary (possibly, complex) nonzero functions of single variables, and consider their arbitrary linear combination where λ 1 and λ 2 are arbitrary constants such that det(g ij (u)) ≡ 0.
Let us prove that relation (1.7) is always fulfilled for the corresponding tensors of Riemannian curvature.
Recall that for any diagonal metric Γ i jk (u) = 0 if all the indices i, j, k are distinct. Correspondingly, R ij kl (u) = 0 if all the indices i, j, k, l are distinct. Besides, as a result of the well-known symmetries of the tensor of Riemannian curvature, we have: . Thus, it is sufficient to prove relation (1.7) only for the following components of the corresponding tensors of Riemannian curvature: R ij il (u), where i = j, i = l. For an arbitrary diagonal metric g ij 2 (u) = g i (u)δ ij , we have It is necessary to consider two the following different cases separately: Respectively, for the metric we obtain (here we use that all the indices i, j, l are distinct): Respectively, for the metric we obtain (here we use that the indices i and j are distinct): Theorems 2.4 and 2.5 are proved. Thus, the complete explicit description of nonsingular pairs of compatible and almost compatible metrics is obtained.

Equations for nonsingular pairs of compatible flat metrics
Now, let us consider, in detail, the problem on nonsingular pairs of compatible flat metrics. It follows from Theorem 2.5 that it is sufficient to classify all pairs of flat metrics of the following special diagonal form g ij 2 (u) = g i (u)δ ij and g ij The problem of description of diagonal flat metrics, that is, flat metrics g ij 2 (u) = g i (u)δ ij , is a classical problem of differential geometry. This problem is equivalent to the problem of description of curvilinear orthogonal coordinate systems in an N-dimensional pseudo-Euclidean space and it was studied in detail and mainly solved in the beginning of the 20th century (see [4]). Locally, such coordinate systems are determined by N (N − 1)/2 arbitrary functions of two variables. Recently, Zakharov showed that the Lamé equations describing curvilinear orthogonal coordinate systems can be integrated by the inverse scattering method [38] (see also an algebraic-geometric approach in [21]).
The condition that the metric g ij 1 (u) = f i (u i )g i (u)δ ij is also flat exactly gives N (N − 1)/2 additional equations linear with respect to the functions f i (u i ). Note that, in this case, components (4.6) of the corresponding tensor of Riemannian curvature automatically vanish as a result of formula (4.7). And the vanishing of components (4.8) gives the corresponding N (N − 1)/2 equations. In particular, in the case N = 2, this completely solves the problem of description for nonsingular pairs of compatible two-component flat metrics. In the next section, we present this complete description. It is also very interesting to classify all the N -orthogonal curvilinear coordinate systems in a pseudo-Euclidean space (or, in other words, to classify the corresponding functions g i (u)) such that the functions f i (u i ) = (u i ) n define the corresponding compatible flat metrics (respectively, separately for n = 1; n = 1, 2; n = 1, 2, 3, and so on).
Theorem 5.1 Any nonsingular pair of compatible flat metrics is described by the following integrable nonlinear system which is the special reduction of the Lamé equations: Proof. Consider the conditions of flatness for the diagonal metrics g ij 2 (u) = g i (u)δ ij and g ij .., N, are arbitrary (possibly, complex) functions of the given single variables (but these functions are not equal to zero identically).
As is shown in the previous section, for any diagonal metric, it is sufficient to consider the condition R ij kl (u) = 0 (the condition of flatness for a metric) only for the following components of the tensor of Riemannian curvature: R ij il (u), where i = j, i = l.
Again as above, for an arbitrary diagonal metric g ij 2 (u) = g i (u)δ ij , it is necessary to consider two the following different cases separately.
Introducing the standard classical notation where H i (u) are the Lamé coefficients and β ik (u) are the rotation coefficients, we derive that equations (5.4) are equivalent to the equations where i = j, i = k, j = k. Equations (5.7) are equivalent to equations (5.1).
The condition that the metric g ij 1 (u) = f i (u i )g i (u)δ ij is also flat gives exactly N (N − 1)/2 additional equations (5.3) which are linear with respect to the given functions f i (u i ). Note that, in this case, components (5.4) of the corresponding tensor of Riemannian curvature automatically vanish. And the vanishing of components (5.8) gives the corresponding N (N − 1)/2 additional equations.
Actually, for the metric g ij Respectively, equations (5.1) are also fulfilled for the rotation coefficients β ik (u) and equations (5.2) for them give equations (5.3), which can be rewritten as follows (as linear equations with respect to the functions f i (u i )): q.e.d.

Two-component compatible flat metrics
Here we present the complete description for nonsingular pairs of two-component compatible flat metrics (see also [26], [30], [29], where an integrable four-component nondiagonalizable homogeneous system of hydrodynamic type, describing all the two-component compatible flat metrics, was derived and investigated). It is shown above that for any nonsingular pair of two-component compatible metrics g ij 1 (u) and g ij 2 (u) there always exist local coordinates u 1 , ..., u N such that where ε i = ±1, i = 1, 2; b i (u) and f i (u i ), i = 1, 2, are arbitrary nonzero functions of the corresponding variables. Lemma 6.1 An arbitrary diagonal metric g ij 2 (u) (6.1) is flat if and only if the functions b i (u), i = 1, 2, are solutions of the following linear system: where F (u) is an arbitrary function.
If the eigenvalues of the pair of metrics g ij 1 (u) and g ij 2 (u) are not only distinct but also are not constants, then we can always choose local coordinates such that f 1 (u 1 ) = u 1 , f 2 (u 2 ) = u 2 (see also the remark in [12]). In this case, equation (6.3) has the form 2 Let us continue this recurrent procedure for the metrics G ij n+1 (u) = v i s (u)G sj n (u) with the help of the affinor v i j (u) = u i δ i j . Theorem 6.2 Three metrics The metrics G ij n (u), n = 0, 1, 2, are flat and the metric G ij 3 (u) is a metric of nonzero constant Riemannian curvature K = 0 (in this case, the metrics G ij n , n = 0, 1, 2, 3, form a pencil of metrics of constant Riemannian curvature) if and only if 7 Almost compatible metrics that are not compatible is flat if and only if the function a(u) is harmonic, that is, In particular, the metric g ij 1 (u) = exp(u 1 u 2 )δ ij , 1 ≤ i, j ≤ 2, is flat. It is obvious that the flat metrics g ij 1 (u) = exp(u 1 u 2 )δ ij , 1 ≤ i, j ≤ 2, and g ij 2 (u) = δ ij , 1 ≤ i, j ≤ 2, are almost compatible, the corresponding Nijenhuis tensor (3.6) vanishes. But it follows from Lemma 7.1 that these metrics are not compatible, their sum is not a flat metric.
Similarly, it is also possible to construct other counterexamples to Theorem 2.3. Moreover, the following statement is true. Proposition 7.1 Any nonconstant real harmonic function a(u) defines a pair of almost compatible metrics g ij 1 (u) = exp(a(u))δ ij , 1 ≤ i, j ≤ 2, and g ij 2 (u) = δ ij , 1 ≤ i, j ≤ 2, which are not compatible. These metrics are compatible if and only if a = a(u 1 ± iu 2 ).
Let us also construct almost compatible metrics of constant Riemannian curvature that are not compatible.
Lemma 7.2 Two-component diagonal conformally Euclidean metric is a metric of constant Riemannian curvature K if and only if the function a(u) is a solution of the Liouville equation Proposition 7.2 For the metrics g ij 1 (u) = exp(a(u))δ ij , 1 ≤ i, j ≤ 2, and g ij 2 (u) = δ ij , 1 ≤ i, j ≤ 2, the corresponding Nijenhuis tensor vanishes, that is, they are always almost compatible. But they are real compatible metrics of constant Riemannian curvature K and 0, respectively, only in the most trivial case when the function a(u) is constant and, consequently, K = 0. Complex metrics are compatible if and only if a(u) = a(u 1 ± iu 2 ) and, in this case, also K = 0.
Note that all the one-component "metrics" are always compatible, and all the one-component local Poisson structures of hydrodynamic type are also always compatible. Let us construct examples of almost compatible metrics that are not compatible for any N > 1.  We must choose a matrix function F ij (s, s ′ , u) and solve the linear integral equation Then we obtain a one-parameter family of solutions of the Lamé equations by the formula β ij (s, u) = K ji (s, s, u). y) is an arbitrary matrix function of two variables, then formula (8.2) produces solutions of equations (5.1). To satisfy equations (5.2), Zakharov proposed to impose on the "dressing matrix function" F ij (s − u i , s ′ − u j ) a certain additional linear differential relation. If F ij (s − u i , s ′ − u j ) satisfy the Zakharov differential relation, then the rotation coefficients β ij (u) satisfy additionally equations (5.2).
Let us present a scheme for integrating all the system (5.1)-(5.3).
Lemma 8.1 If both the function F ij (s − u i , s ′ − u j ) and the function satisfy the Zakharov differential relation, then the corresponding rotation coefficients β ij (u) (8.2) satisfy all the equations (5.1)-(5.3).
Proof. Actually, if K ij (s, s ′ , u) is the solution of the linear integral equation (8.1) corresponding to the function F ij (s − u i , s ′ − u j ), then is the solution of (8.1) corresponding to function (8.3). It is easy to prove multiplying the integral equation (8.1) by
For the function 6) the Zakharov differential relation (9.1) exactly gives N (N −1)/2 linear partial differential equations of the second order for N (N −1)/2 functions Φ ij (s−u i , s ′ −u j ), i < j, of two variables: or, equivalently, It is very interesting that all these equations (9.8) for the functions Φ ij (s−u i , s ′ − u j ) are of the same type as in the two-component case. In fact, these equations coincide with the corresponding single equation (6.3) for the two-component case.
Besides, for N functions Φ ii (s − u i , s ′ − u i ), we have also N linear partial differential equations of the second order from the Zakharov differential relation (9.1): Any solution of linear partial differential equations (9.8) and (9.10) generates a one-parameter family of solutions of system (5.1)-(5.3) by linear relations and formulas (9.2), (9.3), (9.4), (8.1) and (8.2). Thus, our problem is linearized.