The structure is taken literally from linear_algebra/matrix/bilinear_form with generalizations and easier proofs where possible.
linear_algebra/matrix/bilinear_form