The areas / V09. Commutative algebra I: ideals, polynomials, factorization
Mathlib.RingTheory.Polynomial.Resultant.Basic
69 declarations and 2 deprecated aliases. Mathlib docs · Source
Resultant of two polynomials
This file contains basic facts about resultant of two polynomials over commutative rings.
Main definitions
Polynomial.resultant: The resultant of two polynomialspandqis defined as the determinant of the Sylvester matrix ofpandq.Polynomial.discr: The discriminant of a polynomialfis defined as the resultant offandf.derivative, modified by factoring out a sign and a power of the leading term.
TODO
- The eventual goal is to prove the following property:
resultant (∏ a ∈ s, (X - C a)) f = ∏ a ∈ s, f.eval a. This allows us to write theresultant f gas the product of terms of the forma - bwhereais a root offandbis a root ofg. - Resultant of two binary forms (i.e. homogeneous polynomials in two variables), after binary forms are implemented.
theorem Polynomial.sylvesterMap.congr_simp E1 #
∀ {m n : ℕ} {R : Type u_1} [inst : CommRing R] (f f_1 : Polynomial R) (e_f : f = f_1) (g g_1 : Polynomial R)
(e_g : g = g_1) (hf : f.natDegree ≤ m) (hg : g.natDegree ≤ n), f.sylvesterMap g hf hg = f_1.sylvesterMap g_1 ⋯ ⋯
def Polynomial.sylvester E1 #
{R : Type u_1} → [inst : Semiring R] → Polynomial R → Polynomial R → (m n : ℕ) → Matrix (Fin (m + n)) (Fin (m + n)) R
The Sylvester matrix of two polynomials f and g of degrees m and n respectively is a
(m+n) × (m+n) matrix with the coefficients of f and g arranged in a specific way. Here, m
and n are free variables, not necessarily equal to the actual degrees of the polynomials f and
g.
Note that the natural definition would be a Matrix (Fin (m + n)) (Fin m ⊕ Fin n) R but we prefer
having this as a square matrix to take determinants later on.
theorem Polynomial.sylvester_zero_left_deg E0 #
∀ {R : Type u_1} [inst : Semiring R] (f g : Polynomial R) (m : ℕ), f.sylvester g 0 m = Matrix.diagonal fun x ↦ f.coeff 0
theorem Polynomial.sylvester_comm E1 #
∀ {R : Type u_1} [inst : Semiring R] (f g : Polynomial R) (m n : ℕ),
f.sylvester g m n =
(Matrix.reindex (finCongr ⋯) (finSumFinEquiv.symm.trans ((Equiv.sumComm (Fin n) (Fin m)).trans finSumFinEquiv)))
(g.sylvester f n m)
theorem Polynomial.sylvester_map_map E1 #
∀ {R : Type u_1} {S : Type u_2} [inst : Semiring R] [inst_1 : Semiring S] (f g : Polynomial R) (m n : ℕ) (φ : R →+* S),
(Polynomial.map φ f).sylvester (Polynomial.map φ g) m n = φ.mapMatrix (f.sylvester g m n)
def Polynomial.sylvesterDeriv E1 #
{R : Type u_1} →
[inst : Semiring R] →
(f : Polynomial R) → Matrix (Fin (f.natDegree - 1 + f.natDegree)) (Fin (f.natDegree - 1 + f.natDegree)) R
The Sylvester matrix for f and f.derivative, modified by dividing the bottom row by
the leading coefficient of f. Important because its determinant is (up to a sign) the
discriminant of f.
theorem Polynomial.sylvesterDeriv_updateRow E1 #
∀ {R : Type u_1} [inst : Semiring R] (f : Polynomial R) (hf : 0 < f.natDegree),
f.sylvesterDeriv.updateRow ⟨2 * f.natDegree - 2, ⋯⟩ (f.leadingCoeff • f.sylvesterDeriv ⟨2 * f.natDegree - 2, ⋯⟩) =
(Polynomial.derivative f).sylvester f (f.natDegree - 1) f.natDegree
We can get the usual Sylvester matrix of f and f.derivative back from the modified one
by multiplying the last row by the leading coefficient of f.
def Polynomial.resultant E3 #
{R : Type u_1} → [inst : CommRing R] → (f g : Polynomial R) → optParam ℕ f.natDegree → optParam ℕ g.natDegree → R
The resultant of two polynomials f and g is the determinant of the Sylvester matrix of f
and g. The size arguments m and n are implemented as optParam, meaning that the default
values are f.natDegree and g.natDegree respectively, but they can also be specified to be
other values.
theorem Polynomial.resultant_map_map E0 #
∀ {R : Type u_1} {S : Type u_2} [inst : CommRing R] [inst_1 : CommRing S] (f g : Polynomial R) (m n : ℕ) (φ : R →+* S),
(Polynomial.map φ f).resultant (Polynomial.map φ g) m n = φ (f.resultant g m n)
theorem Polynomial.resultant_zero_left_deg E0 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m : ℕ), f.resultant g 0 m = f.coeff 0 ^ m
theorem Polynomial.resultant_C_zero_left E1 #
∀ {R : Type u_1} [inst : CommRing R] (g : Polynomial R) (r : R) (m : ℕ), (Polynomial.C r).resultant g 0 m = r ^ m
For polynomial f and constant a, Res(f, a) = a ^ m.
theorem Polynomial.resultant_comm E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n : ℕ),
f.resultant g m n = (-1) ^ (m * n) * g.resultant f n m
Res(f, g) = (-1)ᵐⁿ Res(g, f)
theorem Polynomial.resultant_zero_right_deg E0 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m : ℕ), f.resultant g m 0 = g.coeff 0 ^ m
theorem Polynomial.resultant_C_zero_right E1 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (m : ℕ) (r : R), f.resultant (Polynomial.C r) m 0 = r ^ m
Res(a, g) = a ^ deg g
theorem Polynomial.resultant_zero_right E0 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (m n : ℕ), f.resultant 0 m n = 0 ^ m * f.coeff 0 ^ n
theorem Polynomial.resultant_zero_left E0 #
∀ {R : Type u_1} [inst : CommRing R] (g : Polynomial R) (m n : ℕ), Polynomial.resultant 0 g m n = 0 ^ n * g.coeff 0 ^ m
theorem Polynomial.resultant_zero_zero E1 #
∀ {R : Type u_1} [inst : CommRing R] (m n : ℕ), Polynomial.resultant 0 0 m n = 0 ^ (m + n)
theorem Polynomial.resultant_add_mul_right E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g p : Polynomial R) (m n : ℕ),
p.natDegree + m ≤ n → f.natDegree ≤ m → f.resultant (g + f * p) m n = f.resultant g m n
Res(f, g + fp) = Res(f, g) if deg f + deg p ≤ deg g.
theorem Polynomial.resultant_add_mul_left E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g p : Polynomial R) (m n : ℕ),
p.natDegree + n ≤ m → g.natDegree ≤ n → (f + g * p).resultant g m n = f.resultant g m n
Res(f + gp, g) = Res(f, g) if deg g + deg p ≤ deg f.
theorem Polynomial.resultant_C_mul_right E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n : ℕ) (r : R),
f.resultant (Polynomial.C r * g) m n = r ^ m * f.resultant g m n
Res(f, a • g) = a ^ {deg f} * Res(f, g).
theorem Polynomial.resultant_C_mul_left E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n : ℕ) (r : R),
(Polynomial.C r * f).resultant g m n = r ^ n * f.resultant g m n
Res(a • f, g) = a ^ {deg g} * Res(f, g).
theorem Polynomial.resultant_succ_left_deg E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n : ℕ),
f.natDegree ≤ m → f.resultant g (m + 1) n = (-1) ^ n * g.coeff n * f.resultant g m n
theorem Polynomial.resultant_add_left_deg E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n k : ℕ),
f.natDegree ≤ m → f.resultant g (m + k) n = (-1) ^ (n * k) * g.coeff n ^ k * f.resultant g m n
theorem Polynomial.resultant_add_right_deg E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n k : ℕ),
g.natDegree ≤ n → f.resultant g m (n + k) = f.coeff m ^ k * f.resultant g m n
theorem Polynomial.resultant_eq_zero_of_lt_lt E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n : ℕ),
f.natDegree < m → g.natDegree < n → f.resultant g m n = 0
theorem Polynomial.resultant_C_left E0 #
∀ {R : Type u_1} [inst : CommRing R] (g : Polynomial R) (m n : ℕ) (r : R),
(Polynomial.C r).resultant g m n = (-1) ^ (m * n) * g.coeff n ^ m * r ^ n
theorem Polynomial.resultant_C_right E0 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (m n : ℕ) (r : R),
f.resultant (Polynomial.C r) m n = f.coeff m ^ n * r ^ m
theorem Polynomial.resultant_one_left E0 #
∀ {R : Type u_1} [inst : CommRing R] (g : Polynomial R) (m n : ℕ),
Polynomial.resultant 1 g m n = (-1) ^ (m * n) * g.coeff n ^ m
theorem Polynomial.resultant_one_right E0 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (m n : ℕ), f.resultant 1 m n = f.coeff m ^ n
theorem Polynomial.resultant_X_sub_C_left E0 #
∀ {R : Type u_1} [inst : CommRing R] (g : Polynomial R) (n : ℕ) (r : R),
g.natDegree ≤ n → (Polynomial.X - Polynomial.C r).resultant g 1 n = Polynomial.eval r g
Res(X - r, g) = g(r)
theorem Polynomial.resultant_X_add_C_left E0 #
∀ {R : Type u_1} [inst : CommRing R] (g : Polynomial R) (n : ℕ) (r : R),
g.natDegree ≤ n → (Polynomial.X + Polynomial.C r).resultant g 1 n = Polynomial.eval (-r) g
Res(X + r, g) = g(-r)
theorem Polynomial.resultant_X_sub_C_right E0 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (m : ℕ) (r : R),
f.natDegree ≤ m → f.resultant (Polynomial.X - Polynomial.C r) m 1 = (-1) ^ m * Polynomial.eval r f
Res(f, X - r) = (-1)^{deg f} * f(r)
theorem Polynomial.resultant_X_add_C_right E0 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (m : ℕ) (r : R),
f.natDegree ≤ m → f.resultant (Polynomial.X + Polynomial.C r) m 1 = (-1) ^ m * Polynomial.eval (-r) f
Res(f, X + r) = (-1)^{deg f} * f(-r)
theorem Polynomial.resultant_eq_prod_roots_sub E1 #
∀ {K : Type u_3} [inst : Field K] (f g : Polynomial K),
f.Monic →
g.Monic → f.Splits → g.Splits → f.resultant g = (Multiset.map (fun ij ↦ ij.1 - ij.2) (f.roots ×ˢ g.roots)).prod
If f and g are monic and splits, then Res(f, g) = ∏ (α - β),
where α and β runs through the roots of f and g respectively.
theorem Polynomial.resultant_eq_prod_eval E1 #
∀ {R : Type u_1} [inst : CommRing R] [inst_1 : IsDomain R] (f g : Polynomial R) (n : ℕ),
g.natDegree ≤ n →
f.Splits →
f.resultant g f.natDegree n = f.leadingCoeff ^ n * (Multiset.map (fun x ↦ Polynomial.eval x g) f.roots).prod
If f splits with leading coeff a and degree n,
then Res(f, g) = aⁿ * ∏ g(α) where α runs through the roots of f.
theorem Polynomial.induction_of_Splits_of_injective_of_surjective E1 #
∀ {R : Type u} [inst : CommRing R] (p : Polynomial R) (P : {R : Type u} → [inst : CommRing R] → Polynomial R → Prop),
(∀ (R : Type u) [inst : Field R] (p : Polynomial R), p.Splits → P p) →
(∀ (R S : Type u) [inst : CommRing R] [inst_1 : CommRing S] (φ : R →+* S),
Function.Injective ⇑φ → ∀ (p : Polynomial R), P (Polynomial.map φ p) → P p) →
(∀ (R S : Type u) [inst : CommRing R] [inst_1 : CommRing S] (φ : R →+* S),
Function.Surjective ⇑φ → ∀ (p : Polynomial S), (∀ (q : Polynomial R), P q) → P p) →
P p
An induction principle useful to prove statements about resultants.
Let P be a predicate on a polynomial.
If R → S injective implies (∀ p : S[X], P p) → (∀ p : R[X], P p),
and if R → S surjective implies (∀ p : R[X], P p) → (∀ p : S[X], P p),
then we may reduce to the case where R is a field and p splits.
theorem Polynomial.resultant_mul_right E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g₁ g₂ : Polynomial R) (m : ℕ),
f.natDegree ≤ m → f.resultant (g₁ * g₂) m (g₁.natDegree + g₂.natDegree) = f.resultant g₁ m * f.resultant g₂ m
Res(f, g₁ * g₂) = Res(f, g₁) * Res(f, g₂).
theorem Polynomial.resultant_mul_left E1 #
∀ {R : Type u_1} [inst : CommRing R] (f₁ f₂ g : Polynomial R) (n : ℕ),
g.natDegree ≤ n →
(f₁ * f₂).resultant g (f₁.natDegree + f₂.natDegree) n =
f₁.resultant g f₁.natDegree n * f₂.resultant g f₂.natDegree n
Res(f₁ * f₂, g) = Res(f₁, g) * Res(f₂, g).
theorem Polynomial.resultant_self E0 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R), f.resultant f = 0 ^ f.natDegree
Res(f, f) = 0 unless deg f = 0. Also see resultant_self_eq_zero.
theorem Polynomial.resultant_self_eq_zero E1 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R), f.natDegree ≠ 0 → f.resultant f = 0
theorem Polynomial.resultant_dvd_leadingCoeff_pow E1 #
∀ {R : Type u_1} [inst : CommRing R] [IsDomain R] (f g : Polynomial R),
IsCoprime f g → ∃ n, f.resultant g ∣ f.leadingCoeff ^ n
theorem Polynomial.resultant_ne_zero E1 #
∀ {R : Type u_1} [inst : CommRing R] [IsDomain R] (f g : Polynomial R), IsCoprime f g → f.resultant g ≠ 0
theorem Polynomial.resultant_prod_left E0 #
∀ {R : Type u_1} [inst : CommRing R] {ι : Type u_3} (s : Finset ι) (f : ι → Polynomial R) (g : Polynomial R) (n : ℕ),
∏ i ∈ s, (f i).leadingCoeff ≠ 0 →
g.natDegree ≤ n →
(∏ i ∈ s, f i).resultant g (∏ i ∈ s, f i).natDegree n = ∏ i ∈ s, (f i).resultant g (f i).natDegree n
theorem Polynomial.resultant_prod_right E0 #
∀ {R : Type u_1} [inst : CommRing R] {ι : Type u_3} (s : Finset ι) (f : Polynomial R) (g : ι → Polynomial R) (m : ℕ),
f.natDegree ≤ m → ∏ i ∈ s, (g i).leadingCoeff ≠ 0 → f.resultant (∏ i ∈ s, g i) m = ∏ i ∈ s, f.resultant (g i) m
theorem Polynomial.resultant_pow_left E0 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n : ℕ),
f.leadingCoeff ^ m ≠ 0 → g.natDegree ≤ n → (f ^ m).resultant g (f ^ m).natDegree n = f.resultant g f.natDegree n ^ m
theorem Polynomial.resultant_pow_right E0 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (m n : ℕ),
f.natDegree ≤ m → g.leadingCoeff ^ n ≠ 0 → f.resultant (g ^ n) m = f.resultant g m ^ n
theorem Polynomial.resultant_X_sub_C_pow_left E1 #
∀ {R : Type u_1} [inst : CommRing R] (r : R) (g : Polynomial R) (m n : ℕ),
g.natDegree ≤ n → ((Polynomial.X - Polynomial.C r) ^ m).resultant g m n = Polynomial.eval r g ^ m
theorem Polynomial.resultant_X_sub_C_pow_right E1 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (r : R) (m n : ℕ),
f.natDegree ≤ m → f.resultant ((Polynomial.X - Polynomial.C r) ^ n) m n = (-1) ^ (m * n) * Polynomial.eval r f ^ n
theorem Polynomial.resultant_X_pow_left E1 #
∀ {R : Type u_1} [inst : CommRing R] (g : Polynomial R) (m n : ℕ),
g.natDegree ≤ n → (Polynomial.X ^ m).resultant g m n = g.coeff 0 ^ m
theorem Polynomial.resultant_X_pow_right E1 #
∀ {R : Type u_1} [inst : CommRing R] (f : Polynomial R) (m n : ℕ),
f.natDegree ≤ m → f.resultant (Polynomial.X ^ n) m n = (-1) ^ (m * n) * f.coeff 0 ^ n
theorem Polynomial.resultant_scaleRoots E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (r : R),
(f.scaleRoots r).resultant (g.scaleRoots r) = r ^ (f.natDegree * g.natDegree) * f.resultant g
theorem Polynomial.resultant_integralNormalization E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R),
g.natDegree ≠ 0 →
(f.scaleRoots g.leadingCoeff).resultant g.integralNormalization =
g.leadingCoeff ^ (f.natDegree * (g.natDegree - 1)) * f.resultant g
theorem Polynomial.resultant_taylor E1 #
∀ {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (r : R),
((Polynomial.taylor r) f).resultant ((Polynomial.taylor r) g) = f.resultant g
Res(f(x + r), g(x + r)) = Res(f, g).
def Polynomial.sylvesterMap E1 #
{m n : ℕ} →
{R : Type u_1} →
[inst : CommRing R] →
(f g : Polynomial R) →
f.natDegree ≤ m →
g.natDegree ≤ n →
↥(Polynomial.degreeLT R m) × ↥(Polynomial.degreeLT R n) →ₗ[R] ↥(Polynomial.degreeLT R (m + n))
The map (p, q) ↦ f * q + g * p whose associated matrix is Syl(f, g).
theorem Polynomial.sylvesterMap_apply_coe E0 #
∀ {m n : ℕ} {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (hf : f.natDegree ≤ m) (hg : g.natDegree ≤ n)
(pq : ↥(Polynomial.degreeLT R m) × ↥(Polynomial.degreeLT R n)), ↑((f.sylvesterMap g hf hg) pq) = f * ↑pq.2 + g * ↑pq.1
theorem Polynomial.toMatrix_sylvesterMap E1 #
∀ {m n : ℕ} {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (hf : f.natDegree ≤ m) (hg : g.natDegree ≤ n),
(LinearMap.toMatrix ((Polynomial.degreeLT.basis R m).prod (Polynomial.degreeLT.basis R n))
(Polynomial.degreeLT.basis R (m + n)))
(f.sylvesterMap g hf hg) =
(Matrix.reindex (Equiv.refl (Fin (m + n))) finSumFinEquiv.symm) (f.sylvester g m n)
theorem Polynomial.toMatrix_sylvesterMap' E1 #
∀ {m n : ℕ} {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (hf : f.natDegree ≤ m) (hg : g.natDegree ≤ n),
(LinearMap.toMatrix (((Polynomial.degreeLT.basis R m).prod (Polynomial.degreeLT.basis R n)).reindex finSumFinEquiv)
(Polynomial.degreeLT.basis R (m + n)))
(f.sylvesterMap g hf hg) =
f.sylvester g m n
def Polynomial.adjSylvester E1 #
{m n : ℕ} →
{R : Type u_1} →
[inst : CommRing R] →
Polynomial R →
Polynomial R → ↥(Polynomial.degreeLT R (m + n)) →ₗ[R] ↥(Polynomial.degreeLT R m) × ↥(Polynomial.degreeLT R n)
The adjugate map of the sylvester map. It takes P to (p, q) such that
f * q + g * p = Res(f, g) * P.
theorem Polynomial.sylvesterMap_comp_adjSylvester E1 #
∀ {m n : ℕ} {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (hf : f.natDegree ≤ m) (hg : g.natDegree ≤ n),
f.sylvesterMap g hf hg ∘ₗ f.adjSylvester g = f.resultant g m n • LinearMap.id
theorem Polynomial.adjSylvester_comp_sylvesterMap E1 #
∀ {m n : ℕ} {R : Type u_1} [inst : CommRing R] (f g : Polynomial R) (hf : f.natDegree ≤ m) (hg : g.natDegree ≤ n),
f.adjSylvester g ∘ₗ f.sylvesterMap g hf hg = f.resultant g m n • LinearMap.id
theorem Polynomial.exists_mul_add_mul_eq_C_resultant E1 #
∀ {m n : ℕ} {R : Type u_1} [inst : CommRing R] (f g : Polynomial R),
f.natDegree ≤ m →
g.natDegree ≤ n →
m ≠ 0 ∨ n ≠ 0 → ∃ p q, p.degree < ↑n ∧ q.degree < ↑m ∧ f * p + g * q = Polynomial.C (f.resultant g m n)
Note that if n = m = 0 then resultant = 1 but f and g aren't necessarily coprime.
theorem Polynomial.isUnit_resultant_iff_isCoprime E1 #
∀ {R : Type u_1} [inst : CommRing R] {f g : Polynomial R}, f.Monic → (IsUnit (f.resultant g) ↔ IsCoprime f g)
theorem Polynomial.resultant_eq_zero_iff E0 #
∀ {K : Type u_2} [inst : Field K] {f g : Polynomial K}, f.resultant g = 0 ↔ (f ≠ 0 ∨ g ≠ 0) ∧ ¬IsCoprime f g
def Polynomial.discr E3 #
{R : Type u_1} → [inst : CommRing R] → Polynomial R → R
The discriminant of a polynomial, defined as the determinant of f.sylvesterDeriv modified
by a sign. The sign is chosen so polynomials over ℝ with all roots real have non-negative
discriminant.
theorem Polynomial.discr_C E0 #
∀ {R : Type u_1} [inst : CommRing R] (r : R), (Polynomial.C r).discr = 1
The discriminant of a constant polynomial is 1.
theorem Polynomial.discr_of_degree_eq_one E1 #
∀ {R : Type u_1} [inst : CommRing R] {f : Polynomial R}, f.degree = 1 → f.discr = 1
The discriminant of a linear polynomial is 1.
theorem Polynomial.discr_of_degree_eq_two E2 #
∀ {R : Type u_1} [inst : CommRing R] {f : Polynomial R},
f.degree = 2 → f.discr = f.coeff 1 ^ 2 - 4 * f.coeff 0 * f.coeff 2
Standard formula for the discriminant of a quadratic polynomial.
theorem Polynomial.resultant_deriv E1 #
∀ {R : Type u_1} [inst : CommRing R] {f : Polynomial R},
0 < f.degree →
f.resultant (Polynomial.derivative f) f.natDegree (f.natDegree - 1) =
(-1) ^ (f.natDegree * (f.natDegree - 1) / 2) * f.leadingCoeff * f.discr
Relation between the resultant and the discriminant.
(Note this is actually false when f is a constant polynomial not equal to 1, so the assumption on
the degree is genuinely needed.)
theorem Polynomial.discr_of_degree_eq_three E2 #
∀ {R : Type u_1} [inst : CommRing R] {f : Polynomial R},
f.degree = 3 →
f.discr =
f.coeff 2 ^ 2 * f.coeff 1 ^ 2 - 4 * f.coeff 3 * f.coeff 1 ^ 3 - 4 * f.coeff 2 ^ 3 * f.coeff 0 -
27 * f.coeff 3 ^ 2 * f.coeff 0 ^ 2 +
18 * f.coeff 3 * f.coeff 2 * f.coeff 1 * f.coeff 0
Standard formula for the discriminant of a cubic polynomial.
Deprecated aliases
| Name | New name | Since |
|---|---|---|
Polynomial.adjSylvester_comp_sylveserMap | Polynomial.adjSylvester_comp_sylvesterMap | 2026-09-17 |
Polynomial.sylveserMap_comp_adjSylvester | Polynomial.sylvesterMap_comp_adjSylvester | 2026-09-17 |