same size according to the formula Any symmetric matrix A can be transformed into a diagonal matrix by a suitable choice of an orthogonal matrix S, and the diagonal entries of B are uniquely determined – this is Jacobi's theorem. If S is allowed to be any invertible matrix then B can be made to have only 0,1, and −1 on the diagonal, and the number of the entries of each type (n0 for 0, n+ for 1, and n− for −1) depends only on A. This is one of the formulations of Sylvester's law of inertia and the numbers n+ and n− are called the positive and negative indices of inertia. Although their definition involved a choice of basis and consideration of the corresponding real symmetric matrix A, Sylvester's law of inertia means that they are invariants of the quadratic form q. The quadratic form q is positive definite (resp., negative definite) if (resp., ) for every nonzero vector v. When q(v) assumes both positive and negative values, q is an indefinite quadratic form. The theorems of Jacobi and Sylvester show that any positive definite quadratic form in n variables can be brought to the sum of n squares by a suitable invertible linear transformation: geometrically, there is only one positive definite real quadratic form of every dimension. Its isometry group is a compact orthogonal group O(n). This stands in contrast with the case of indefinite forms, when the corresponding group, the indefinite orthogonal group O(p, q), is non-compact. Further, the isometry groups of Q and −Q are the same (, but the associated Clifford algebras (and hence pin groups) are different. Definitions A quadratic form over a field K is a map from a finite-dimensional K-vector space to K such that for all and the function is bilinear. More concretely, an n-ary quadratic form over a field K is a homogeneous polynomial of degree 2 in n variables with coefficients in K: This formula may be rewritten using matrices: let x be the column vector with components x1, ..., xn and be the n×n matrix over K whose entries are the coefficients of q. Then A vector is a null vector if q(v) = 0. Two n-ary quadratic forms φ and ψ over K are equivalent if there exists a nonsingular linear transformation such that Let the characteristic of K be different from 2. The coefficient matrix A