Cubics and discriminants #
This file defines cubic polynomials over a semiring and their discriminants over a splitting field.
Main definitions #
Cubic: the structure representing a cubic polynomial.Cubic.discr: the discriminant of a cubic polynomial.
Main statements #
Cubic.discr_ne_zero_iff_roots_nodup: the cubic discriminant is not equal to zero if and only if the cubic has no duplicate roots.
References #
Tags #
cubic, discriminant, polynomial, root
The structure representing a cubic polynomial.
- a : R
The degree-3 coefficient
- b : R
The degree-2 coefficient
- c : R
The degree-1 coefficient
- d : R
The degree-0 coefficient
Instances For
@[implicit_reducible]
@[implicit_reducible]
Convert a cubic polynomial to a polynomial.
Instances For
theorem
Cubic.C_mul_prod_X_sub_C_eq
{S : Type u_2}
[CommRing S]
{w x y z : S}
:
Polynomial.C w * (Polynomial.X - Polynomial.C x) * (Polynomial.X - Polynomial.C y) * (Polynomial.X - Polynomial.C z) = { a := w, b := w * -(x + y + z), c := w * (x * y + x * z + y * z), d := w * -(x * y * z) }.toPoly
theorem
Cubic.prod_X_sub_C_eq
{S : Type u_2}
[CommRing S]
{x y z : S}
:
(Polynomial.X - Polynomial.C x) * (Polynomial.X - Polynomial.C y) * (Polynomial.X - Polynomial.C z) = { a := 1, b := -(x + y + z), c := x * y + x * z + y * z, d := -(x * y * z) }.toPoly
Coefficients #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Cubic.of_a_eq_zero
{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
:
P.toPoly = Polynomial.C P.b * Polynomial.X ^ 2 + Polynomial.C P.c * Polynomial.X + Polynomial.C P.d
theorem
Cubic.of_a_eq_zero'
{R : Type u_1}
{b c d : R}
[Semiring R]
:
{ a := 0, b := b, c := c, d := d }.toPoly = Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X + Polynomial.C d
theorem
Cubic.of_b_eq_zero
{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
:
P.toPoly = Polynomial.C P.c * Polynomial.X + Polynomial.C P.d
theorem
Cubic.of_b_eq_zero'
{R : Type u_1}
{c d : R}
[Semiring R]
:
{ a := 0, b := 0, c := c, d := d }.toPoly = Polynomial.C c * Polynomial.X + Polynomial.C d
theorem
Cubic.of_c_eq_zero
{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
(hc : P.c = 0)
:
P.toPoly = Polynomial.C P.d
theorem
Cubic.of_c_eq_zero'
{R : Type u_1}
{d : R}
[Semiring R]
:
{ a := 0, b := 0, c := 0, d := d }.toPoly = Polynomial.C d
@[simp]
theorem
Cubic.leadingCoeff_of_a_ne_zero
{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a ≠ 0)
:
P.toPoly.leadingCoeff = P.a
theorem
Cubic.leadingCoeff_of_a_ne_zero'
{R : Type u_1}
{a b c d : R}
[Semiring R]
(ha : a ≠ 0)
:
{ a := a, b := b, c := c, d := d }.toPoly.leadingCoeff = a
@[simp]
theorem
Cubic.leadingCoeff_of_b_ne_zero
{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b ≠ 0)
:
P.toPoly.leadingCoeff = P.b
theorem
Cubic.leadingCoeff_of_b_ne_zero'
{R : Type u_1}
{b c d : R}
[Semiring R]
(hb : b ≠ 0)
:
{ a := 0, b := b, c := c, d := d }.toPoly.leadingCoeff = b
@[simp]
theorem
Cubic.leadingCoeff_of_c_ne_zero
{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
(hc : P.c ≠ 0)
:
P.toPoly.leadingCoeff = P.c
theorem
Cubic.leadingCoeff_of_c_ne_zero'
{R : Type u_1}
{c d : R}
[Semiring R]
(hc : c ≠ 0)
:
{ a := 0, b := 0, c := c, d := d }.toPoly.leadingCoeff = c
@[simp]
theorem
Cubic.leadingCoeff_of_c_eq_zero
{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
(hc : P.c = 0)
:
P.toPoly.leadingCoeff = P.d
theorem
Cubic.leadingCoeff_of_c_eq_zero'
{R : Type u_1}
{d : R}
[Semiring R]
:
{ a := 0, b := 0, c := 0, d := d }.toPoly.leadingCoeff = d
Degrees #
The equivalence between cubic polynomials and polynomials of degree at most three.
Instances For
@[simp]
theorem
Cubic.equiv_symm_apply_b
{R : Type u_1}
[Semiring R]
(f : { p : Polynomial R // p.degree ≤ 3 })
:
@[simp]
theorem
Cubic.equiv_symm_apply_d
{R : Type u_1}
[Semiring R]
(f : { p : Polynomial R // p.degree ≤ 3 })
:
@[simp]
@[simp]
theorem
Cubic.equiv_symm_apply_c
{R : Type u_1}
[Semiring R]
(f : { p : Polynomial R // p.degree ≤ 3 })
:
@[simp]
theorem
Cubic.equiv_symm_apply_a
{R : Type u_1}
[Semiring R]
(f : { p : Polynomial R // p.degree ≤ 3 })
:
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
Map across a homomorphism #
Roots over an extension #
The roots of a cubic polynomial.
Instances For
Roots over a splitting field #
theorem
Cubic.eq_prod_three_roots
{F : Type u_3}
{K : Type u_4}
{P : Cubic F}
[Field F]
[Field K]
{φ : F →+* K}
{x y z : K}
(ha : P.a ≠ 0)
(h3 : (map φ P).roots = {x, y, z})
:
(map φ P).toPoly = Polynomial.C (φ P.a) * (Polynomial.X - Polynomial.C x) * (Polynomial.X - Polynomial.C y) * (Polynomial.X - Polynomial.C z)
Discriminant over a splitting field #
The discriminant of a cubic polynomial.
Instances For
@[deprecated Cubic.discr (since := "2025-10-20")]
Alias of Cubic.discr.
The discriminant of a cubic polynomial.
Instances For
@[deprecated Cubic.discr_ne_zero_iff_roots_ne (since := "2025-10-20")]
theorem
Cubic.disc_ne_zero_iff_roots_ne
{F : Type u_3}
{K : Type u_4}
{P : Cubic F}
[Field F]
[Field K]
{φ : F →+* K}
{x y z : K}
(ha : P.a ≠ 0)
(h3 : (map φ P).roots = {x, y, z})
:
P.discr ≠ 0 ↔ x ≠ y ∧ x ≠ z ∧ y ≠ z
Alias of Cubic.discr_ne_zero_iff_roots_ne.
@[deprecated Cubic.discr_ne_zero_iff_roots_nodup (since := "2025-10-20")]
theorem
Cubic.disc_ne_zero_iff_roots_nodup
{F : Type u_3}
{K : Type u_4}
{P : Cubic F}
[Field F]
[Field K]
{φ : F →+* K}
(ha : P.a ≠ 0)
(hP : (Polynomial.map φ P.toPoly).Splits)
:
Alias of Cubic.discr_ne_zero_iff_roots_nodup.
@[deprecated Cubic.card_roots_of_discr_ne_zero (since := "2025-10-20")]
theorem
Cubic.card_roots_of_disc_ne_zero
{F : Type u_3}
{K : Type u_4}
{P : Cubic F}
[Field F]
[Field K]
{φ : F →+* K}
[DecidableEq K]
(ha : P.a ≠ 0)
(h3 : (Polynomial.map φ P.toPoly).Splits)
(hd : P.discr ≠ 0)
:
Alias of Cubic.card_roots_of_discr_ne_zero.