The basic setting and two ternary casesWe take a finite-dimensional vector space V over a field F and take also an F -bilinear symmetric form ϕ : V × V → F . We then put ϕ[x] = ϕ(x, x) for x ∈ V, thus using the same letter ϕ for the quadratic form and the corresponding symmetric form. By a quadratic Diophantine equation we mean an equation of the typewith a given q ∈ F × . In particular, in the classical case with F = Q and V = Q n , we usually assume that ϕ is Z-valued on Z n and q ∈ Z. The purpose of the present article is to present some new ideas on various arithmetical questions on such an equation. We start with some of our basic symbols and terminology. For a set X we denote by #X or #{X} the number (≤ ∞) of elements of X. For an associative ring R with identity element, we denote by R × the group of invertible elements of R and by M n (R) the ring of all square matrices of size n with entries in R. We then put GL n (R) = M n (R) × and denote by 1 n the identity element of M n (R). For two square matrices A and B of size m and n we denote by diag[A, B] the square matrix of size m + n with A and B in diagonal blocks and zeros in the remaining blocks. Now, given (V, ϕ) as above, we always assume that ϕ is nondegenerate. We also put n = dim(V ) and define, as usual, the orthogonal group O ϕ (V ) and the special orthogonal group SO ϕ (V ) by
written also SO(ϕ) and SO(V, ϕ).We let GL(V ) act on V on the right, so that xα is the image of x under α.As the base field F we take, for the moment, an algebraic number field or its completion at a nonarchimedean prime. We denote by g the ring of algebraic integers in the former case and the ring of local integers in the latter case. Those who are not much interested in the general case may assume that F is Q or the p-adic number field Q p for any prime number p, and g is Z or the ring Z p of p-adic integers. By a g-lattice (simply a lattice) in V we mean a finitely generated