Quadratic forms
This file defines quadratic forms over a R
-module M
.
A quadratic form is a map Q : M → R
such that
(to_fun_smul
) Q (a • x) = a * a * Q x
(polar_...
) The map polar Q := λ x y, Q (x + y) - Q x - Q y
is bilinear.
They come with a scalar multiplication, (a • Q) x = Q (a • x) = a * a * Q x
,
and composition with linear maps f
, Q.comp f x = Q (f x)
.
Main definitions
quadratic_form.associated
: associated bilinear formquadratic_form.pos_def
: positive definite quadratic formsquadratic_form.discr
: discriminant of a quadratic form
Main statements
quadratic_form.associated_left_inverse
,quadratic_form.associated_right_inverse
: in a commutative ring where 2 has an inverse, there is a correspondence between quadratic forms and symmetric bilinear forms
Notation
In this file, the variable R
is used when a ring
structure is sufficient and
R₁
is used when specifically a comm_ring
is required. This allows us to keep
[module R M]
and [module R₁ M]
assumptions in the variables without
confusion between *
from ring
and *
from comm_ring
.
References
- https://en.wikipedia.org/wiki/Quadratic_form
- https://en.wikipedia.org/wiki/Discriminant#Quadratic_forms
Tags
quadratic form, homogeneous polynomial, quadratic polynomial
Up to a factor 2, Q.polar
is the associated bilinear form for a quadratic form Q
.d
Source of this name: https://en.wikipedia.org/wiki/Quadratic_form#Generalization
Equations
- quadratic_form.polar f x y = f (x + y) - f x - f y
- to_fun : M → R
- to_fun_smul : ∀ (a : R) (x : M), c.to_fun (a • x) = a * a * c.to_fun x
- polar_add_left' : ∀ (x x' y : M), quadratic_form.polar c.to_fun (x + x') y = quadratic_form.polar c.to_fun x y + quadratic_form.polar c.to_fun x' y
- polar_smul_left' : ∀ (a : R) (x y : M), quadratic_form.polar c.to_fun (a • x) y = a • quadratic_form.polar c.to_fun x y
- polar_add_right' : ∀ (x y y' : M), quadratic_form.polar c.to_fun x (y + y') = quadratic_form.polar c.to_fun x y + quadratic_form.polar c.to_fun x y'
- polar_smul_right' : ∀ (a : R) (x y : M), quadratic_form.polar c.to_fun x (a • y) = a • quadratic_form.polar c.to_fun x y
A quadratic form over a module.
Equations
- quadratic_form.has_coe_to_fun = {F := λ (B : quadratic_form R M), M → R, coe := λ (B : quadratic_form R M), B.to_fun}
The simp
normal form for a quadratic form is coe_fn
, not to_fun
.
Equations
- quadratic_form.has_zero = {zero := {to_fun := λ (x : M), 0, to_fun_smul := _, polar_add_left' := _, polar_smul_left' := _, polar_add_right' := _, polar_smul_right' := _}}
Equations
Equations
- quadratic_form.has_add = {add := λ (Q Q' : quadratic_form R M), {to_fun := ⇑Q + ⇑Q', to_fun_smul := _, polar_add_left' := _, polar_smul_left' := _, polar_add_right' := _, polar_smul_right' := _}}
Equations
- quadratic_form.has_neg = {neg := λ (Q : quadratic_form R M), {to_fun := -⇑Q, to_fun_smul := _, polar_add_left' := _, polar_smul_left' := _, polar_add_right' := _, polar_smul_right' := _}}
Equations
- quadratic_form.has_scalar = {smul := λ (a : R₁) (Q : quadratic_form R₁ M), {to_fun := a • ⇑Q, to_fun_smul := _, polar_add_left' := _, polar_smul_left' := _, polar_add_right' := _, polar_smul_right' := _}}
Equations
- quadratic_form.add_comm_group = {add := has_add.add quadratic_form.has_add, add_assoc := _, zero := 0, zero_add := _, add_zero := _, neg := has_neg.neg quadratic_form.has_neg, add_left_neg := _, add_comm := _}
Equations
- quadratic_form.module = {to_distrib_mul_action := {to_mul_action := {to_has_scalar := quadratic_form.has_scalar _inst_5, one_smul := _, mul_smul := _}, smul_add := _, smul_zero := _}, add_smul := _, zero_smul := _}
Compose the quadratic form with a linear function.
Equations
- Q.comp f = {to_fun := λ (x : M), ⇑Q (⇑f x), to_fun_smul := _, polar_add_left' := _, polar_smul_left' := _, polar_add_right' := _, polar_smul_right' := _}
Create a quadratic form in a commutative ring by proving only one side of the bilinearity.
Equations
- quadratic_form.mk_left f to_fun_smul polar_add_left polar_smul_left = {to_fun := f, to_fun_smul := to_fun_smul, polar_add_left' := polar_add_left, polar_smul_left' := polar_smul_left, polar_add_right' := _, polar_smul_right' := _}
The product of linear forms is a quadratic form.
Equations
- quadratic_form.lin_mul_lin f g = quadratic_form.mk_left (⇑f * ⇑g) _ _ _
proj i j
is the quadratic form mapping the vector x : n → R₁
to x i * x j
Equations
Associated bilinear forms
Over a commutative ring with an inverse of 2, the theory of quadratic forms is
basically identical to that of symmetric bilinear forms. The map from quadratic
forms to bilinear forms giving this identification is called the associated
quadratic form.
A bilinear form gives a quadratic form by applying the argument twice.
Equations
- B.to_quadratic_form = {to_fun := λ (x : M), ⇑B x x, to_fun_smul := _, polar_add_left' := _, polar_smul_left' := _, polar_add_right' := _, polar_smul_right' := _}
associated
is the linear map that sends a quadratic form to its associated
symmetric bilinear form
Equations
- quadratic_form.associated = {to_fun := λ (Q : quadratic_form R₁ M), {bilin := λ (x y : M), ⅟ 2 * quadratic_form.polar ⇑Q x y, bilin_add_left := _, bilin_smul_left := _, bilin_add_right := _, bilin_smul_right := _}, map_add' := _, map_smul' := _}
A positive definite quadratic form is positive on nonzero vectors.
Quadratic forms and matrices
Connect quadratic forms and matrices, in order to explicitly compute with them. The convention is twos out, so there might be a factor 2⁻¹ in the entries of the matrix. The determinant of the matrix is the discriminant of the quadratic form.
M.to_quadratic_form
is the map λ x, col x ⬝ M ⬝ row x
as a quadratic form.
Equations
A matrix representation of the quadratic form.
Equations
The discriminant of a quadratic form generalizes the discriminant of a quadratic polynomial.
An isometry between two quadratic spaces M₁, Q₁
and M₂, Q₂
over a ring R
,
is a linear equivalence between M₁
and M₂
that commutes with the quadratic forms.
Two quadratic forms over a ring R
are equivalent
if there exists an isometry between them:
a linear equivalence that transforms one quadratic form into the other.
Equations
- Q₁.equivalent Q₂ = nonempty (Q₁.isometry Q₂)
Equations
The identity isometry from a quadratic form to itself.
Equations
- quadratic_form.isometry.refl Q = {to_linear_equiv := {to_fun := (linear_equiv.refl R M).to_fun, map_add' := _, map_smul' := _, inv_fun := (linear_equiv.refl R M).inv_fun, left_inv := _, right_inv := _}, map_app' := _}
The inverse isometry of an isometry between two quadratic forms.
The composition of two isometries between quadratic forms.