A quadratic form on a finite-dimensional real vector space is a function for a symmetric bilinear form . Conversely recovers that bilinear form. Two quadratic forms are congruent if a linear isomorphism satisfies ; in coordinates this is matrix congruence, , with invertible.
Sylvester's law of inertia says that a real quadratic form admits coordinates in which
and the numbers of positive, negative and zero squares, , are independent of the coordinates. Here ; and are the maximal dimensions of subspaces on which the quadratic form is positive definite and negative definite, while is the dimension of its radical of a bilinear form. These numbers are the inertia of a bilinear form. The rank of a quadratic form is , and the signature of a quadratic form, in the signed-difference convention, is .
Completing squares gives
The change of coordinates is invertible, so the inertia is and the signature is . If signature is recorded as an ordered pair instead, that pair is .
The symmetric bilinear form associated with a real quadratic form is obtained by polarization identity:
In coordinates , replacing by its symmetric part does not change , and the formula gives ; this proves existence. A symmetric form is positive semidefinite when for every , and positive definite when the inequality is strict for every .
The diagonalization theorem for real quadratic forms says that some basis puts any symmetric form into
with further zero coordinates. Sylvester's law of inertia says that is independent of the diagonalizing basis. To prove this, let be the span of the positive coordinate vectors and let be the span of the negative and zero vectors. If is positive definite for another diagonalization and , then
so the two spaces intersect nontrivially. A vector in the intersection would have both positive and nonpositive square, a contradiction. Thus ; symmetry gives . Applying the same argument to gives , and then .
For the nondegenerate form on , write its inertia as , so . The restriction vanishes identically on : polarization gives for . Projection of to the positive coordinate space is injective, since a vector with zero positive projection cannot be isotropic unless it is zero. Hence ; projection to the negative space likewise gives . Therefore .
The matrix of is . If , it has rank one and inertia , hence signature one; if , its rank and signature are zero. The coefficientwise product has matrix , where , so it has the same rank-one conclusion when and is zero otherwise.
Finally, diagonalization writes every positive semidefinite form as a sum of squares, say and . Bilinearity of coefficientwise multiplication gives
a sum of positive semidefinite rank-at-most-one forms. Thus is positive semidefinite.
For a real symmetric bilinear form, let and be the dimensions of its positive and negative diagonal subspaces. This pair gives the first two components of the inertia of a bilinear form and is independent of basis by the Sylvester's law of inertia. For a nondegenerate form their sum is the full dimension; otherwise the nullity is an additional invariant. Another convention calls the difference the signature of a quadratic form. The pair convention describes the positive and negative harmonic spaces of the real de Rham intersection form in dimension four.