Bilinear forms diagonalization

Let V be a vector space, and let ϕ be a bilinear form

ϕ:V×VR

If ϕ is symmetric, then given a basis B we get a matrix MB that is symmetric. For v,wV, and following the characterization here we get:

ϕ(v,w)=b1(v)tMBb1(w)

Since MB is symmetric, we can apply successive transformations like

(100a12a1110a1na1101)(a11a12a1na12Ma1n)(1a12a11a1na11010001)=(a11000M0)

And so we get a diagonal matrix D that verify:

D=PtMBP

If we considerate a new basis N such that n=bP, it is clear that the coordinates of v and w are n1(v)=P1b1(v) and n1(w)=P1b1(w). Since

ϕ(v,w)=b1(v)tMBb1(w)=n1(v)tDn1(w)

we conclude that D is the matrix of ϕ in the new basis N.

From here, with an easy change of basis, rearranging the elements and scaling them by 1aii, we obtain that the matrix is of the form:

(D)ij={1 si 1ir,j=i1 si r+1is,j=i0 otherwise

The integers r and s are constant through base changes and they allow us to define the signature of the bilinear forms.