File: Mathlib/Algebra/CubicDiscriminant.lean

full_name: Cubic.d
code: /-- The structure representing a cubic polynomial. -/
@[ext]
structure Cubic (R : Type*) where
  (a b c d : R)
goal: R

full_name: Cubic.b
code: /-- The structure representing a cubic polynomial. -/
@[ext]
structure Cubic (R : Type*) where
  (a b c d : R)
goal: R

full_name: Cubic.a
code: /-- The structure representing a cubic polynomial. -/
@[ext]
structure Cubic (R : Type*) where
  (a b c d : R)
goal: R

full_name: Cubic.c
code: /-- The structure representing a cubic polynomial. -/
@[ext]
structure Cubic (R : Type*) where
  (a b c d : R)
goal: R

full_name: Cubic
code: /-- The structure representing a cubic polynomial. -/
@[ext]
structure Cubic (R : Type*) where
  (a b c d : R)
goal: Type u_1

full_name: Cubic.instInhabited
code: instance [Inhabited R] : Inhabited (Cubic R) 
goal: Inhabited (Cubic R)

full_name: Cubic.instZero
code: instance [Zero R] : Zero (Cubic R) 
goal: Zero (Cubic R)

full_name: Cubic.toPoly
code: /-- Convert a cubic polynomial to a polynomial. -/
def toPoly (P : Cubic R) : R[X] 
goal: Polynomial R

full_name: Cubic.C_mul_prod_X_sub_C_eq
code: theorem C_mul_prod_X_sub_C_eq [CommRing S] {w x y z : S} :
    C w * (X - C x) * (X - C y) * (X - C z) =
      toPoly ⟨w, w * -(x + y + z), w * (x * y + x * z + y * z), w * -(x * y * z)⟩ 
goal: 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

full_name: Cubic.prod_X_sub_C_eq
code: theorem prod_X_sub_C_eq [CommRing S] {x y z : S} :
    (X - C x) * (X - C y) * (X - C z) =
      toPoly ⟨1, -(x + y + z), x * y + x * z + y * z, -(x * y * z)⟩ 
goal: (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

full_name: _private.Mathlib.Algebra.CubicDiscriminant.0.Cubic.coeffs
code: private theorem coeffs : (∀ n > 3, P.toPoly.coeff n = 0) ∧ P.toPoly.coeff 3 = P.a ∧
    P.toPoly.coeff 2 = P.b ∧ P.toPoly.coeff 1 = P.c ∧ P.toPoly.coeff 0 = P.d 
goal: (∀ n > 3, P.toPoly.coeff n = 0) ∧
  P.toPoly.coeff 3 = P.a ∧ P.toPoly.coeff 2 = P.b ∧ P.toPoly.coeff 1 = P.c ∧ P.toPoly.coeff 0 = P.d

full_name: Cubic.coeff_eq_zero
code: @[simp]
theorem coeff_eq_zero {n : ℕ} (hn : 3 < n) : P.toPoly.coeff n = 0 
goal: P.toPoly.coeff n = 0

full_name: Cubic.coeff_eq_a
code: @[simp]
theorem coeff_eq_a : P.toPoly.coeff 3 = P.a 
goal: P.toPoly.coeff 3 = P.a

full_name: Cubic.coeff_eq_b
code: @[simp]
theorem coeff_eq_b : P.toPoly.coeff 2 = P.b 
goal: P.toPoly.coeff 2 = P.b

full_name: Cubic.coeff_eq_c
code: @[simp]
theorem coeff_eq_c : P.toPoly.coeff 1 = P.c 
goal: P.toPoly.coeff 1 = P.c

full_name: Cubic.coeff_eq_d
code: @[simp]
theorem coeff_eq_d : P.toPoly.coeff 0 = P.d 
goal: P.toPoly.coeff 0 = P.d

full_name: Cubic.a_of_eq
code: theorem a_of_eq (h : P.toPoly = Q.toPoly) : P.a = Q.a 
goal: P.a = Q.a

full_name: Cubic.b_of_eq
code: theorem b_of_eq (h : P.toPoly = Q.toPoly) : P.b = Q.b 
goal: P.b = Q.b

full_name: Cubic.c_of_eq
code: theorem c_of_eq (h : P.toPoly = Q.toPoly) : P.c = Q.c 
goal: P.c = Q.c

full_name: Cubic.d_of_eq
code: theorem d_of_eq (h : P.toPoly = Q.toPoly) : P.d = Q.d 
goal: P.d = Q.d

full_name: Cubic.toPoly_injective
code: theorem toPoly_injective (P Q : Cubic R) : P.toPoly = Q.toPoly ↔ P = Q 
goal: P.toPoly = Q.toPoly ↔ P = Q

full_name: Cubic.of_a_eq_zero
code: theorem of_a_eq_zero (ha : P.a = 0) : P.toPoly = C P.b * X ^ 2 + C P.c * X + C P.d 
goal: P.toPoly = Polynomial.C P.b * Polynomial.X ^ 2 + Polynomial.C P.c * Polynomial.X + Polynomial.C P.d

full_name: Cubic.of_a_eq_zero'
code: theorem of_a_eq_zero' : toPoly ⟨0, b, c, d⟩ = C b * X ^ 2 + C c * X + C d 
goal: { a := 0, b := b, c := c, d := d }.toPoly =
  Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X + Polynomial.C d

full_name: Cubic.of_b_eq_zero
code: theorem of_b_eq_zero (ha : P.a = 0) (hb : P.b = 0) : P.toPoly = C P.c * X + C P.d 
goal: P.toPoly = Polynomial.C P.c * Polynomial.X + Polynomial.C P.d

full_name: Cubic.of_b_eq_zero'
code: theorem of_b_eq_zero' : toPoly ⟨0, 0, c, d⟩ = C c * X + C d 
goal: { a := 0, b := 0, c := c, d := d }.toPoly = Polynomial.C c * Polynomial.X + Polynomial.C d

full_name: Cubic.of_c_eq_zero
code: theorem of_c_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) : P.toPoly = C P.d 
goal: P.toPoly = Polynomial.C P.d

full_name: Cubic.of_c_eq_zero'
code: theorem of_c_eq_zero' : toPoly ⟨0, 0, 0, d⟩ = C d 
goal: { a := 0, b := 0, c := 0, d := d }.toPoly = Polynomial.C d

full_name: Cubic.of_d_eq_zero
code: theorem of_d_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) (hd : P.d = 0) :
    P.toPoly = 0 
goal: P.toPoly = 0

full_name: Cubic.of_d_eq_zero'
code: theorem of_d_eq_zero' : (⟨0, 0, 0, 0⟩ : Cubic R).toPoly = 0 
goal: { a := 0, b := 0, c := 0, d := 0 }.toPoly = 0

full_name: Cubic.zero
code: theorem zero : (0 : Cubic R).toPoly = 0 
goal: Cubic.toPoly 0 = 0

full_name: Cubic.toPoly_eq_zero_iff
code: theorem toPoly_eq_zero_iff (P : Cubic R) : P.toPoly = 0 ↔ P = 0 
goal: P.toPoly = 0 ↔ P = 0

full_name: _private.Mathlib.Algebra.CubicDiscriminant.0.Cubic.ne_zero
code: private theorem ne_zero (h0 : P.a ≠ 0 ∨ P.b ≠ 0 ∨ P.c ≠ 0 ∨ P.d ≠ 0) : P.toPoly ≠ 0 
goal: P.toPoly ≠ 0

full_name: Cubic.ne_zero_of_a_ne_zero
code: theorem ne_zero_of_a_ne_zero (ha : P.a ≠ 0) : P.toPoly ≠ 0 
goal: P.toPoly ≠ 0

full_name: Cubic.ne_zero_of_b_ne_zero
code: theorem ne_zero_of_b_ne_zero (hb : P.b ≠ 0) : P.toPoly ≠ 0 
goal: P.toPoly ≠ 0

full_name: Cubic.ne_zero_of_c_ne_zero
code: theorem ne_zero_of_c_ne_zero (hc : P.c ≠ 0) : P.toPoly ≠ 0 
goal: P.toPoly ≠ 0

full_name: Cubic.ne_zero_of_d_ne_zero
code: theorem ne_zero_of_d_ne_zero (hd : P.d ≠ 0) : P.toPoly ≠ 0 
goal: P.toPoly ≠ 0

full_name: Cubic.leadingCoeff_of_a_ne_zero
code: @[simp]
theorem leadingCoeff_of_a_ne_zero (ha : P.a ≠ 0) : P.toPoly.leadingCoeff = P.a 
goal: P.toPoly.leadingCoeff = P.a

full_name: Cubic.leadingCoeff_of_a_ne_zero'
code: @[simp]
theorem leadingCoeff_of_a_ne_zero' (ha : a ≠ 0) : (toPoly ⟨a, b, c, d⟩).leadingCoeff = a 
goal: { a := a, b := b, c := c, d := d }.toPoly.leadingCoeff = a

full_name: Cubic.leadingCoeff_of_b_ne_zero
code: @[simp]
theorem leadingCoeff_of_b_ne_zero (ha : P.a = 0) (hb : P.b ≠ 0) : P.toPoly.leadingCoeff = P.b 
goal: P.toPoly.leadingCoeff = P.b

full_name: Cubic.leadingCoeff_of_b_ne_zero'
code: @[simp]
theorem leadingCoeff_of_b_ne_zero' (hb : b ≠ 0) : (toPoly ⟨0, b, c, d⟩).leadingCoeff = b 
goal: { a := 0, b := b, c := c, d := d }.toPoly.leadingCoeff = b

full_name: Cubic.leadingCoeff_of_c_ne_zero
code: @[simp]
theorem leadingCoeff_of_c_ne_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c ≠ 0) :
    P.toPoly.leadingCoeff = P.c 
goal: P.toPoly.leadingCoeff = P.c

full_name: Cubic.leadingCoeff_of_c_ne_zero'
code: @[simp]
theorem leadingCoeff_of_c_ne_zero' (hc : c ≠ 0) : (toPoly ⟨0, 0, c, d⟩).leadingCoeff = c 
goal: { a := 0, b := 0, c := c, d := d }.toPoly.leadingCoeff = c

full_name: Cubic.leadingCoeff_of_c_eq_zero
code: @[simp]
theorem leadingCoeff_of_c_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) :
    P.toPoly.leadingCoeff = P.d 
goal: P.toPoly.leadingCoeff = P.d

full_name: Cubic.leadingCoeff_of_c_eq_zero'
code: theorem leadingCoeff_of_c_eq_zero' : (toPoly ⟨0, 0, 0, d⟩).leadingCoeff = d 
goal: { a := 0, b := 0, c := 0, d := d }.toPoly.leadingCoeff = d

full_name: Cubic.monic_of_a_eq_one
code: theorem monic_of_a_eq_one (ha : P.a = 1) : P.toPoly.Monic 
goal: P.toPoly.Monic

full_name: Cubic.monic_of_a_eq_one'
code: theorem monic_of_a_eq_one' : (toPoly ⟨1, b, c, d⟩).Monic 
goal: { a := 1, b := b, c := c, d := d }.toPoly.Monic

full_name: Cubic.monic_of_b_eq_one
code: theorem monic_of_b_eq_one (ha : P.a = 0) (hb : P.b = 1) : P.toPoly.Monic 
goal: P.toPoly.Monic

full_name: Cubic.monic_of_b_eq_one'
code: theorem monic_of_b_eq_one' : (toPoly ⟨0, 1, c, d⟩).Monic 
goal: { a := 0, b := 1, c := c, d := d }.toPoly.Monic

full_name: Cubic.monic_of_c_eq_one
code: theorem monic_of_c_eq_one (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 1) : P.toPoly.Monic 
goal: P.toPoly.Monic

full_name: Cubic.monic_of_c_eq_one'
code: theorem monic_of_c_eq_one' : (toPoly ⟨0, 0, 1, d⟩).Monic 
goal: { a := 0, b := 0, c := 1, d := d }.toPoly.Monic

full_name: Cubic.monic_of_d_eq_one
code: theorem monic_of_d_eq_one (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) (hd : P.d = 1) :
    P.toPoly.Monic 
goal: P.toPoly.Monic

full_name: Cubic.monic_of_d_eq_one'
code: theorem monic_of_d_eq_one' : (toPoly ⟨0, 0, 0, 1⟩).Monic 
goal: { a := 0, b := 0, c := 0, d := 1 }.toPoly.Monic

full_name: Cubic.equiv_symm_apply_c
code: /-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 } 
goal: (Cubic.equiv.symm f).c = (↑f).coeff 1

full_name: Cubic.equiv_apply_coe
code: /-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 } 
goal: ↑(Cubic.equiv P) = P.toPoly

full_name: Cubic.equiv_symm_apply_b
code: /-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 } 
goal: (Cubic.equiv.symm f).b = (↑f).coeff 2

full_name: Cubic.equiv_symm_apply_a
code: /-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 } 
goal: (Cubic.equiv.symm f).a = (↑f).coeff 3

full_name: Cubic.equiv_symm_apply_d
code: /-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 } 
goal: (Cubic.equiv.symm f).d = (↑f).coeff 0

full_name: Cubic.equiv
code: /-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 } 
goal: Cubic R ≃ { p // p.degree ≤ 3 }

full_name: Cubic.degree_of_a_ne_zero
code: @[simp]
theorem degree_of_a_ne_zero (ha : P.a ≠ 0) : P.toPoly.degree = 3 
goal: P.toPoly.degree = 3

full_name: Cubic.degree_of_a_ne_zero'
code: @[simp]
theorem degree_of_a_ne_zero' (ha : a ≠ 0) : (toPoly ⟨a, b, c, d⟩).degree = 3 
goal: { a := a, b := b, c := c, d := d }.toPoly.degree = 3

full_name: Cubic.degree_of_a_eq_zero
code: theorem degree_of_a_eq_zero (ha : P.a = 0) : P.toPoly.degree ≤ 2 
goal: P.toPoly.degree ≤ 2

full_name: Cubic.degree_of_a_eq_zero'
code: theorem degree_of_a_eq_zero' : (toPoly ⟨0, b, c, d⟩).degree ≤ 2 
goal: { a := 0, b := b, c := c, d := d }.toPoly.degree ≤ 2

full_name: Cubic.degree_of_b_ne_zero
code: @[simp]
theorem degree_of_b_ne_zero (ha : P.a = 0) (hb : P.b ≠ 0) : P.toPoly.degree = 2 
goal: P.toPoly.degree = 2

full_name: Cubic.degree_of_b_ne_zero'
code: @[simp]
theorem degree_of_b_ne_zero' (hb : b ≠ 0) : (toPoly ⟨0, b, c, d⟩).degree = 2 
goal: { a := 0, b := b, c := c, d := d }.toPoly.degree = 2

full_name: Cubic.degree_of_b_eq_zero
code: theorem degree_of_b_eq_zero (ha : P.a = 0) (hb : P.b = 0) : P.toPoly.degree ≤ 1 
goal: P.toPoly.degree ≤ 1

full_name: Cubic.degree_of_b_eq_zero'
code: theorem degree_of_b_eq_zero' : (toPoly ⟨0, 0, c, d⟩).degree ≤ 1 
goal: { a := 0, b := 0, c := c, d := d }.toPoly.degree ≤ 1

full_name: Cubic.degree_of_c_ne_zero
code: @[simp]
theorem degree_of_c_ne_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c ≠ 0) : P.toPoly.degree = 1 
goal: P.toPoly.degree = 1

full_name: Cubic.degree_of_c_ne_zero'
code: @[simp]
theorem degree_of_c_ne_zero' (hc : c ≠ 0) : (toPoly ⟨0, 0, c, d⟩).degree = 1 
goal: { a := 0, b := 0, c := c, d := d }.toPoly.degree = 1

full_name: Cubic.degree_of_c_eq_zero
code: theorem degree_of_c_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) : P.toPoly.degree ≤ 0 
goal: P.toPoly.degree ≤ 0

full_name: Cubic.degree_of_c_eq_zero'
code: theorem degree_of_c_eq_zero' : (toPoly ⟨0, 0, 0, d⟩).degree ≤ 0 
goal: { a := 0, b := 0, c := 0, d := d }.toPoly.degree ≤ 0

full_name: Cubic.degree_of_d_ne_zero
code: @[simp]
theorem degree_of_d_ne_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) (hd : P.d ≠ 0) :
    P.toPoly.degree = 0 
goal: P.toPoly.degree = 0

full_name: Cubic.degree_of_d_ne_zero'
code: @[simp]
theorem degree_of_d_ne_zero' (hd : d ≠ 0) : (toPoly ⟨0, 0, 0, d⟩).degree = 0 
goal: { a := 0, b := 0, c := 0, d := d }.toPoly.degree = 0

full_name: Cubic.degree_of_d_eq_zero
code: @[simp]
theorem degree_of_d_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) (hd : P.d = 0) :
    P.toPoly.degree = ⊥ 
goal: P.toPoly.degree = ⊥

full_name: Cubic.degree_of_d_eq_zero'
code: theorem degree_of_d_eq_zero' : (⟨0, 0, 0, 0⟩ : Cubic R).toPoly.degree = ⊥ 
goal: { a := 0, b := 0, c := 0, d := 0 }.toPoly.degree = ⊥

full_name: Cubic.degree_of_zero
code: @[simp]
theorem degree_of_zero : (0 : Cubic R).toPoly.degree = ⊥ 
goal: (Cubic.toPoly 0).degree = ⊥

full_name: Cubic.natDegree_of_a_ne_zero
code: @[simp]
theorem natDegree_of_a_ne_zero (ha : P.a ≠ 0) : P.toPoly.natDegree = 3 
goal: P.toPoly.natDegree = 3

full_name: Cubic.natDegree_of_a_ne_zero'
code: @[simp]
theorem natDegree_of_a_ne_zero' (ha : a ≠ 0) : (toPoly ⟨a, b, c, d⟩).natDegree = 3 
goal: { a := a, b := b, c := c, d := d }.toPoly.natDegree = 3

full_name: Cubic.natDegree_of_a_eq_zero
code: theorem natDegree_of_a_eq_zero (ha : P.a = 0) : P.toPoly.natDegree ≤ 2 
goal: P.toPoly.natDegree ≤ 2

full_name: Cubic.natDegree_of_a_eq_zero'
code: theorem natDegree_of_a_eq_zero' : (toPoly ⟨0, b, c, d⟩).natDegree ≤ 2 
goal: { a := 0, b := b, c := c, d := d }.toPoly.natDegree ≤ 2

full_name: Cubic.natDegree_of_b_ne_zero
code: @[simp]
theorem natDegree_of_b_ne_zero (ha : P.a = 0) (hb : P.b ≠ 0) : P.toPoly.natDegree = 2 
goal: P.toPoly.natDegree = 2

full_name: Cubic.natDegree_of_b_ne_zero'
code: @[simp]
theorem natDegree_of_b_ne_zero' (hb : b ≠ 0) : (toPoly ⟨0, b, c, d⟩).natDegree = 2 
goal: { a := 0, b := b, c := c, d := d }.toPoly.natDegree = 2

full_name: Cubic.natDegree_of_b_eq_zero
code: theorem natDegree_of_b_eq_zero (ha : P.a = 0) (hb : P.b = 0) : P.toPoly.natDegree ≤ 1 
goal: P.toPoly.natDegree ≤ 1

full_name: Cubic.natDegree_of_b_eq_zero'
code: theorem natDegree_of_b_eq_zero' : (toPoly ⟨0, 0, c, d⟩).natDegree ≤ 1 
goal: { a := 0, b := 0, c := c, d := d }.toPoly.natDegree ≤ 1

full_name: Cubic.natDegree_of_c_ne_zero
code: @[simp]
theorem natDegree_of_c_ne_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c ≠ 0) :
    P.toPoly.natDegree = 1 
goal: P.toPoly.natDegree = 1

full_name: Cubic.natDegree_of_c_ne_zero'
code: @[simp]
theorem natDegree_of_c_ne_zero' (hc : c ≠ 0) : (toPoly ⟨0, 0, c, d⟩).natDegree = 1 
goal: { a := 0, b := 0, c := c, d := d }.toPoly.natDegree = 1

full_name: Cubic.natDegree_of_c_eq_zero
code: @[simp]
theorem natDegree_of_c_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) :
    P.toPoly.natDegree = 0 
goal: P.toPoly.natDegree = 0

full_name: Cubic.natDegree_of_c_eq_zero'
code: theorem natDegree_of_c_eq_zero' : (toPoly ⟨0, 0, 0, d⟩).natDegree = 0 
goal: { a := 0, b := 0, c := 0, d := d }.toPoly.natDegree = 0

full_name: Cubic.natDegree_of_zero
code: @[simp]
theorem natDegree_of_zero : (0 : Cubic R).toPoly.natDegree = 0 
goal: (Cubic.toPoly 0).natDegree = 0

full_name: Cubic.map
code: /-- Map a cubic polynomial across a semiring homomorphism. -/
def map (φ : R →+* S) (P : Cubic R) : Cubic S 
goal: Cubic S

full_name: Cubic.map_toPoly
code: theorem map_toPoly : (map φ P).toPoly = Polynomial.map φ P.toPoly 
goal: (Cubic.map φ P).toPoly = Polynomial.map φ P.toPoly

full_name: Cubic.roots
code: /-- The roots of a cubic polynomial. -/
def roots [IsDomain R] (P : Cubic R) : Multiset R 
goal: Multiset R

full_name: Cubic.map_roots
code: theorem map_roots [IsDomain S] : (map φ P).roots = (Polynomial.map φ P.toPoly).roots 
goal: (Cubic.map φ P).roots = (Polynomial.map φ P.toPoly).roots

full_name: Cubic.mem_roots_iff
code: theorem mem_roots_iff [IsDomain R] (h0 : P.toPoly ≠ 0) (x : R) :
    x ∈ P.roots ↔ P.a * x ^ 3 + P.b * x ^ 2 + P.c * x + P.d = 0 
goal: x ∈ P.roots ↔ P.a * x ^ 3 + P.b * x ^ 2 + P.c * x + P.d = 0

full_name: Cubic.card_roots_le
code: theorem card_roots_le [IsDomain R] [DecidableEq R] : P.roots.toFinset.card ≤ 3 
goal: P.roots.toFinset.card ≤ 3

full_name: Cubic.splits_iff_card_roots
code: theorem splits_iff_card_roots (ha : P.a ≠ 0) :
    Splits φ P.toPoly ↔ Multiset.card (map φ P).roots = 3 
goal: Polynomial.Splits φ P.toPoly ↔ Multiset.card (Cubic.map φ P).roots = 3

full_name: Cubic.splits_iff_roots_eq_three
code: theorem splits_iff_roots_eq_three (ha : P.a ≠ 0) :
    Splits φ P.toPoly ↔ ∃ x y z : K, (map φ P).roots = {x, y, z} 
goal: Polynomial.Splits φ P.toPoly ↔ ∃ x y z, (Cubic.map φ P).roots = {x, y, z}

full_name: Cubic.eq_prod_three_roots
code: theorem eq_prod_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    (map φ P).toPoly = C (φ P.a) * (X - C x) * (X - C y) * (X - C z) 
goal: (Cubic.map φ P).toPoly =
  Polynomial.C (φ P.a) * (Polynomial.X - Polynomial.C x) * (Polynomial.X - Polynomial.C y) *
    (Polynomial.X - Polynomial.C z)

full_name: Cubic.eq_sum_three_roots
code: theorem eq_sum_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    map φ P =
      ⟨φ P.a, φ P.a * -(x + y + z), φ P.a * (x * y + x * z + y * z), φ P.a * -(x * y * z)⟩ 
goal: Cubic.map φ P =
  { a := φ P.a, b := φ P.a * -(x + y + z), c := φ P.a * (x * y + x * z + y * z), d := φ P.a * -(x * y * z) }

full_name: Cubic.b_eq_three_roots
code: theorem b_eq_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    φ P.b = φ P.a * -(x + y + z) 
goal: φ P.b = φ P.a * -(x + y + z)

full_name: Cubic.c_eq_three_roots
code: theorem c_eq_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    φ P.c = φ P.a * (x * y + x * z + y * z) 
goal: φ P.c = φ P.a * (x * y + x * z + y * z)

full_name: Cubic.d_eq_three_roots
code: theorem d_eq_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    φ P.d = φ P.a * -(x * y * z) 
goal: φ P.d = φ P.a * -(x * y * z)

full_name: Cubic.disc
code: /-- The discriminant of a cubic polynomial. -/
def disc {R : Type*} [Ring R] (P : Cubic R) : R 
goal: R

full_name: Cubic.disc_eq_prod_three_roots
code: theorem disc_eq_prod_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    φ P.disc = (φ P.a * φ P.a * (x - y) * (x - z) * (y - z)) ^ 2 
goal: φ P.disc = (φ P.a * φ P.a * (x - y) * (x - z) * (y - z)) ^ 2

full_name: Cubic.disc_ne_zero_iff_roots_ne
code: theorem disc_ne_zero_iff_roots_ne (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    P.disc ≠ 0 ↔ x ≠ y ∧ x ≠ z ∧ y ≠ z 
goal: P.disc ≠ 0 ↔ x ≠ y ∧ x ≠ z ∧ y ≠ z

full_name: Cubic.disc_ne_zero_iff_roots_nodup
code: theorem disc_ne_zero_iff_roots_nodup (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    P.disc ≠ 0 ↔ (map φ P).roots.Nodup 
goal: P.disc ≠ 0 ↔ (Cubic.map φ P).roots.Nodup

full_name: Cubic.card_roots_of_disc_ne_zero
code: theorem card_roots_of_disc_ne_zero [DecidableEq K] (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z})
    (hd : P.disc ≠ 0) : (map φ P).roots.toFinset.card = 3 
goal: (Cubic.map φ P).roots.toFinset.card = 3