Bilinear forms diagonalization

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

ϕ:V×V⟶R

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

ϕ(v,w)=b−1(v)t⋅MB⋅b−1(w)

Since MB is symmetric, we can apply successive transformations like

(10…0−a12a111⋮⋮⋱0−a1na110…1)⋅(a11a12…a1na12⋮Ma1n)⋅(1−a12a11…−a1na11010⋮⋱⋮0…01)=(a110…00⋮M′0)

And so we get a diagonal matrix D that verify:

D=PtMBP

If we considerate a new basis N such that n=b∘P, it is clear that the coordinates of v and w are n−1(v)=P−1b−1(v) and n−1(w)=P−1b−1(w). Since

ϕ(v,w)=b−1(v)t⋅MB⋅b−1(w)=n−1(v)t⋅D⋅n−1(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 1≤i≤r,j=i−1 si r+1≤i≤s,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.