Binary quadratic forms and the action of SL(2, R) #
A binary quadratic form over a commutative ring R is a polynomial a x² + b x y + c y²; here it
is recorded by its three coefficients, as TauCeti.BinaryQuadraticForm R. The group SL(2, R) acts
on such forms by linear change of variables, and over ℤ the forms that are positive definite of a
fixed discriminant -D < 0 form a sub-action. Its orbits are the classes counted, with weights, by
the Hurwitz class number H(D) (TauCeti.hurwitzClassNumber). Through the form v ↦ det(v, M v)
attached to an integer matrix M, they also describe the SL(2, ℤ)-conjugacy classes of integer
matrices of fixed trace and determinant, which is how they enter the Eichler–Selberg trace formula.
This file supplies the action on which both descriptions are built.
The action is on the left, by γ • f = f ∘ γ⁻¹. For γ = !![p, q; r, s] the inverse is the
adjugate !![s, -q; -r, p] (Mathlib's Matrix.SpecialLinearGroup.SL2_inv_expl), so
(γ • f)(x, y) = f(s x - q y, -r x + p y) and the new coefficients are
a' = a s² - b r s + c r²
b' = b (p s + q r) - 2 a q s - 2 c p r
c' = a q² - b p q + c p².
Only the entries of the adjugate occur, so the action laws are polynomial identities and need no
determinant hypothesis. The substitution f ↦ f ∘ γ found in much of the classical literature is
a right action; composing with γ⁻¹ instead gives the left action that MulAction expects, with
the same orbits. With this convention T • ⟨a, b, c⟩ = ⟨a, b - 2 a, a - b + c⟩ and
S • ⟨a, b, c⟩ = ⟨c, -b, a⟩, where S and T are Mathlib's ModularGroup.S = !![0, -1; 1, 0]
and ModularGroup.T = !![1, 1; 0, 1] (T_smul, S_smul).
It is also the convention for which the root (-b + √(-D)) / (2 a) of a positive definite form
moves by the Möbius action of γ on the upper half-plane.
The discriminant discrim a b c = b² - 4 a c changes by the factor (det γ)² = 1. Positivity of
the leading coefficient is then preserved: (γ • f).a = f(s, -r) is a value of the non-negative
form f, and a form of negative discriminant with non-negative leading coefficient has positive
leading coefficient. This needs D ≠ 0: the form ⟨1, 2, 1⟩ of discriminant 0 is sent by
!![1, 0; 1, 1] to a form with leading coefficient 0.
Mathlib's QuadraticForm R (Fin 2 → R) is not used, because its discriminant is built from the
associated bilinear form and so requires 2 to be invertible in R, which fails over ℤ.
Main definitions #
TauCeti.BinaryQuadraticForm R: the binary quadratic forma x² + b x y + c y²overR.TauCeti.BinaryQuadraticForm.equivProd: a form is its triple of coefficients(a, b, c).- Binary quadratic forms inherit coefficientwise addition and scalar multiplication, including
Module S (TauCeti.BinaryQuadraticForm R)wheneverRis anS-module. TauCeti.BinaryQuadraticForm.discrim: its discriminantb² - 4 a c.TauCeti.BinaryQuadraticForm.eval: its valuea x² + b x y + c y²at(x, y).TauCeti.BinaryQuadraticForm.map: the form with coefficients mapped along a ring homomorphism, for instance an integral form read overℤ_porℚ.- The instance
MulAction SL(2, R) (TauCeti.BinaryQuadraticForm R): the actionγ • f = f ∘ γ⁻¹, for a commutative ringR. TauCeti.BinaryQuadraticForm.posDef D: forD ≠ 0, the positive definite integral forms of discriminant-D, as a sub-action ofSL(2, ℤ).
Main results #
TauCeti.BinaryQuadraticForm.smul_a,TauCeti.BinaryQuadraticForm.smul_bandTauCeti.BinaryQuadraticForm.smul_c: the coefficients ofγ • f.TauCeti.BinaryQuadraticForm.eval_smul:γ • fisf ∘ γ⁻¹.TauCeti.BinaryQuadraticForm.discrim_smul: the discriminant is invariant underSL(2, R).TauCeti.BinaryQuadraticForm.smul_map: mapping coefficients is equivariant for the entrywise mapSL(2, R) →* SL(2, S), so automorphs map to automorphs (TauCeti.BinaryQuadraticForm.map_mem_stabilizer_map).TauCeti.BinaryQuadraticForm.T_zpow_smul,TauCeti.BinaryQuadraticForm.T_smulandTauCeti.BinaryQuadraticForm.S_smul: the action ofT ^ k,TandSon coefficients.TauCeti.BinaryQuadraticForm.isUnit_det_of_quadratic_identity: a coordinate change producing a unit discriminant has unit determinant over any commutative ring.TauCeti.BinaryQuadraticForm.mem_posDef: membership inposDef D.
Implementation notes #
discrim and equivProd are exposed, so that the kernel can evaluate them, as decide does for
the values of TauCeti.hurwitzClassNumber. The additive coefficient equivalence addEquivProd
is also exposed to transport the module structure.
References #
- H. Cohen, A Course in Computational Algebraic Number Theory, Graduate Texts in Mathematics 138, Springer, 1993, §5.2–5.3.
- D. A. Buell, Binary Quadratic Forms: Classical Theory and Modern Computations, Springer, 1989.
- A. Popa and D. Zagier, An elementary proof of the Eichler–Selberg trace formula, J. Reine Angew. Math. 762 (2020), 105–122, arXiv:1711.00327.
Instances For
A binary quadratic form is its triple of coefficients (a, b, c).
Instances For
The zero binary quadratic form has zero coefficients.
Addition of binary quadratic forms is coefficientwise.
Negation of binary quadratic forms is coefficientwise.
Subtraction of binary quadratic forms is coefficientwise.
Scalar multiplication acts coefficientwise on binary quadratic forms.
Addition of binary quadratic forms is coefficientwise.
Binary quadratic forms over an additive group form an additive group.
The additive coefficient equivalence used to transport the module structure.
Instances For
A module structure on the coefficients induces one on binary quadratic forms.
Regular scalars act injectively on binary quadratic forms.
Negation negates the leading coefficient.
Negation negates the middle coefficient.
Negation negates the last coefficient.
The value a x² + b x y + c y² of the form f at (x, y).
Instances For
The value of f at (1, 0) is its first coefficient a.
The value of f at (0, 1) is its last coefficient c.
Scaling a form multiplies every represented value by the scalar.
Evaluation at fixed coordinates is linear in the coefficients of the form.
Instances For
The evaluation linear map evaluates the form at its fixed coordinates.
The form φ(a) x² + φ(b) x y + φ(c) y² obtained by applying φ : R →+* S to the
coefficients of f = a x² + b x y + c y².
Instances For
Evaluation respects negation of forms.
If the binary form am² + umn + bn² becomes Am² + Cmn + Bn² under the
coordinate change with matrix !![e₁, f₁; e₂, f₂], and 4AB - C² is a unit, then that matrix
has unit determinant: the discriminants satisfy 4AB - C² = (e₁f₂ - f₁e₂)² (4ab - u²).
A form of nonsquare discriminant has nonzero leading coefficient.
A form of nonsquare discriminant has nonzero last coefficient.
γ • f is the form f ∘ γ⁻¹ (eval_smul). The coefficients are written through the entries
of the adjugate γ⁻¹ = !![s, -q; -r, p] of γ = !![p, q; r, s], so each is a polynomial in the
entries of γ.
The x²-coefficient of γ • f is f(s, -r) = a s² - b r s + c r², for
γ = !![p, q; r, s].
The x y-coefficient of γ • f is b (p s + q r) - 2 a q s - 2 c p r, for
γ = !![p, q; r, s].
The y²-coefficient of γ • f is f(-q, p) = a q² - b p q + c p², for
γ = !![p, q; r, s].
γ • f is f ∘ γ⁻¹: its value at (x, y) is f(s x - q y, -r x + p y), for
γ = !![p, q; r, s].
f ↦ f ∘ γ⁻¹ is a left action of SL(2, R) on binary quadratic forms.
Proper changes of variables act additively on forms.
Scaling the coefficients commutes with a proper change of variables.
A primitively represented value can be moved to the leading coefficient by a proper change.
The discriminant b² - 4 a c of a binary quadratic form is invariant under SL(2, R).
Mapping the coefficients is equivariant for the action of SL(2, R) on forms, through the
entrywise map SL(2, R) →* SL(2, S).
An automorph of f over R maps to an automorph of f.map φ over S.
The positive definite integral binary quadratic forms of discriminant -D, for D ≠ 0, as a
sub-action of SL(2, ℤ): the forms of discriminant -D whose leading coefficient is positive.
Instances For
The translation T ^ k sends a x² + b x y + c y² to
a x² + (b - 2 a k) x y + (a k² - b k + c) y², the form f(x - k y, y).