Sylvester's law of inertia is a theorem in matrix algebra about certain properties of the coefficient matrix of a real quadratic form that remain invariant under a change of basis. Namely, if A is the symmetric matrix that defines the quadratic form, and S is any invertible matrix such that D = SAST is diagonal, then the number of negative elements in the diagonal of D is always the same, for all such S; and the same goes for the number of positive elements. This property is named after James Joseph Sylvester who published its proof in 1852. Statement Let A be a symmetric square matrix of order n with real entries. Any non-singular matrix S of the same size is said to transform A into another symmetric matrix , also of order n, where ST is the transpose of S. It is also said that matrices A and B are congruent. If A is the coefficient matrix of some quadratic form of Rn, then B is the matrix for the same form after the change of basis defined by S. A symmetric matrix A can always be transformed in this way into a diagonal matrix D which has only entries 0, +1 and −1 along the diagonal. Sylvester's law of inertia states that the number of diagonal entries of each kind is an invariant of A, i.e. it does not depend on the matrix S used. The number of +1s, denoted n+, is called the positive index of inertia of A, and the number of −1s, denoted n−, is called the negative index of inertia. The number of 0s, denoted n0, is the dimension of the null space of A, known as the nullity of A. These numbers satisfy an obvious relation The difference, , is usually called the signature of A. (However, some authors use that term for the triple consisting of the nullity and the positive and negative indices of inertia of A; for a non-degenerate form of a given dimension these are equivalent data, but in general the triple yields more data.) If the matrix A has the property that every principal upper left minor Δk is non-zero then the negative index of inertia is equal to the number of sign changes in the sequence Statement in terms of eigenvalues The law can also be stated as follows: two symmetric square matrices of the same size