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.anisotropic
: anisotropic 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 formsbilin_form.exists_orthogonal_basis
: There exists an orthogonal basis with respect to any nondegenerate, symmetric bilinear formB
.
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
.
The variable S
is used when R
itself has a •
action.
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 := λ (x : quadratic_form R M), M → R, coe := quadratic_form.to_fun _inst_4}
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.add_comm_group = {add := has_add.add quadratic_form.has_add, add_assoc := _, zero := 0, zero_add := _, add_zero := _, nsmul := add_group.nsmul._default 0 has_add.add quadratic_form.add_comm_group._proof_4 quadratic_form.add_comm_group._proof_5, nsmul_zero' := _, nsmul_succ' := _, neg := has_neg.neg quadratic_form.has_neg, sub := add_group.sub._default has_add.add quadratic_form.add_comm_group._proof_8 0 quadratic_form.add_comm_group._proof_9 quadratic_form.add_comm_group._proof_10 (add_group.nsmul._default 0 has_add.add quadratic_form.add_comm_group._proof_4 quadratic_form.add_comm_group._proof_5) quadratic_form.add_comm_group._proof_11 quadratic_form.add_comm_group._proof_12 has_neg.neg, sub_eq_add_neg := _, gsmul := add_group.gsmul._default has_add.add quadratic_form.add_comm_group._proof_14 0 quadratic_form.add_comm_group._proof_15 quadratic_form.add_comm_group._proof_16 (add_group.nsmul._default 0 has_add.add quadratic_form.add_comm_group._proof_4 quadratic_form.add_comm_group._proof_5) quadratic_form.add_comm_group._proof_17 quadratic_form.add_comm_group._proof_18 has_neg.neg, gsmul_zero' := _, gsmul_succ' := _, gsmul_neg' := _, add_left_neg := _, add_comm := _}
@coe_fn (quadratic_form R M)
as an add_monoid_hom
.
This API mirrors add_monoid_hom.coe_fn
.
Equations
Evaluation on a particular element of the module M
is an additive map over quadratic forms.
Equations
- quadratic_form.eval_add_monoid_hom m = (add_monoid_hom.apply (λ (m : M), R) m).comp quadratic_form.coe_fn_add_monoid_hom
quadratic_form R M
inherits the scalar action from any algebra over R
.
When R
is commutative, this provides an R
-action via algebra.id
.
Equations
- quadratic_form.has_scalar = {smul := λ (a : S) (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.distrib_mul_action = {to_mul_action := {to_has_scalar := quadratic_form.has_scalar _inst_8, one_smul := _, mul_smul := _}, smul_add := _, smul_zero := _}
Equations
- quadratic_form.module = {to_distrib_mul_action := quadratic_form.distrib_mul_action _inst_8, 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_hom
is the map that sends a quadratic form on a module M
over R
to its
associated symmetric bilinear form. As provided here, this has the structure of an S
-linear map
where S
is a commutative subring of R
.
Over a commutative ring, use associated
, which gives an R
-linear map. Over a general ring with
no nontrivial distinguished commutative subring, use associated'
, which gives an additive
homomorphism (or more precisely a ℤ
-linear map.)
Equations
- quadratic_form.associated_hom S = {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' := _}
associated'
is the ℤ
-linear map that sends a quadratic form on a module M
over R
to its
associated symmetric bilinear form.
There exists a non-null vector with respect to any quadratic form Q
whose associated
bilinear form is non-degenerate, i.e. there exists x
such that Q x ≠ 0
.
associated
is the linear map that sends a quadratic form over a commutative ring to its
associated symmetric bilinear form.
An anisotropic quadratic form is zero only on zero vectors.
Equations
- Q.anisotropic = ∀ (x : M), ⇑Q x = 0 → x = 0
The associated bilinear form of an anisotropic quadratic form is nondegenerate.
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.
Equations
- Q.discr = Q.to_matrix'.det
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₂)
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.
A bilinear form is nondegenerate if the quadratic form it is associated with is anisotropic.
There exists a non-null vector with respect to any symmetric, nondegenerate bilinear form B
on a nontrivial module M
over a ring R
with invertible 2
, i.e. there exists some
x : M
such that B x x ≠ 0
.
Given a nondegenerate symmetric bilinear form B
on some vector space V
over the
field K
with invertible 2
, there exists an orthogonal basis with respect to B
.