Skip to content

Commit fe8d313

Browse files
committed
chore(Algebra): change two statements in CubicDiscriminant (#31912)
The conclusions of the two lemmas do not mention x,y,z, and we make the assumption not mention x,y,z in this PR. The new and old assumptions are equivalent by [Cubic.splits_iff_roots_eq_three](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/CubicDiscriminant.html#Cubic.splits_iff_roots_eq_three) earlier in the file. This contribution was created as part of the Heidelberg Lean workshop "Formalising algebraic geometry" in November 2025.
1 parent a19f0d8 commit fe8d313

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Mathlib/Algebra/CubicDiscriminant.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ variable {P : Cubic F} [Field F] [Field K] {φ : F →+* K} {x y z : K}
413413
section Split
414414

415415
theorem splits_iff_card_roots (ha : P.a ≠ 0) :
416-
Splits (P.toPoly.map φ) ↔ Multiset.card (map φ P).roots = 3 := by
417-
replace ha : (map φ P).a ≠ 0 := (_root_.map_ne_zero φ).mpr ha
416+
Splits (P.toPoly.map φ) ↔ (map φ P).roots.card = 3 := by
417+
replace ha : (map φ P).a ≠ 0 := (map_ne_zero φ).mpr ha
418418
nth_rw 1 [← RingHom.id_comp φ]
419419
rw [roots, ← splits_map_iff, ← map_toPoly, Polynomial.splits_iff_card_roots,
420420
← ((degree_eq_iff_natDegree_eq <| ne_zero_of_a_ne_zero ha).1 <| degree_of_a_ne_zero ha : _ = 3)]
@@ -435,7 +435,7 @@ theorem eq_prod_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z})
435435
theorem eq_sum_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
436436
map φ P =
437437
⟨φ P.a, φ P.a * -(x + y + z), φ P.a * (x * y + x * z + y * z), φ P.a * -(x * y * z)⟩ := by
438-
apply_fun @toPoly _ _
438+
apply_fun toPoly
439439
· rw [eq_prod_three_roots ha h3, C_mul_prod_X_sub_C_eq]
440440
· exact fun P Q ↦ (toPoly_injective P Q).mp
441441

@@ -471,23 +471,23 @@ theorem discr_eq_prod_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x,
471471

472472
theorem discr_ne_zero_iff_roots_ne (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
473473
P.discr ≠ 0 ↔ x ≠ y ∧ x ≠ z ∧ y ≠ z := by
474-
rw [← _root_.map_ne_zero φ, discr_eq_prod_three_roots ha h3, pow_two]
474+
rw [← map_ne_zero φ, discr_eq_prod_three_roots ha h3, pow_two]
475475
simp_rw [mul_ne_zero_iff, sub_ne_zero, _root_.map_ne_zero, and_self_iff, and_iff_right ha,
476476
and_assoc]
477477

478-
theorem discr_ne_zero_iff_roots_nodup (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
478+
theorem discr_ne_zero_iff_roots_nodup (ha : P.a ≠ 0) (hP : (P.toPoly.map φ).Splits) :
479479
P.discr ≠ 0 ↔ (map φ P).roots.Nodup := by
480+
have ⟨x, y, z, h3⟩ := (splits_iff_roots_eq_three ha).mp hP
480481
rw [discr_ne_zero_iff_roots_ne ha h3, h3]
481482
change _ ↔ (x ::ₘ y ::ₘ {z}).Nodup
482483
rw [nodup_cons, nodup_cons, mem_cons, mem_singleton, mem_singleton]
483484
simp only [nodup_singleton]
484485
tauto
485486

486-
theorem card_roots_of_discr_ne_zero [DecidableEq K] (ha : P.a ≠ 0)
487-
(h3 : (map φ P).roots = {x, y, z}) (hd : P.discr ≠ 0) : (map φ P).roots.toFinset.card = 3 := by
488-
rw [toFinset_card_of_nodup <| (discr_ne_zero_iff_roots_nodup ha h3).mp hd,
489-
← splits_iff_card_roots ha, splits_iff_roots_eq_three ha]
490-
exact ⟨x, ⟨y, ⟨z, h3⟩⟩⟩
487+
theorem card_roots_of_discr_ne_zero [DecidableEq K] (ha : P.a ≠ 0) (h3 : (P.toPoly.map φ).Splits)
488+
(hd : P.discr ≠ 0) : (map φ P).roots.toFinset.card = 3 := by
489+
rwa [toFinset_card_of_nodup <| (discr_ne_zero_iff_roots_nodup ha h3).mp hd,
490+
← splits_iff_card_roots ha]
491491

492492
@[deprecated (since := "2025-10-20")] alias disc := discr
493493
@[deprecated (since := "2025-10-20")] alias disc_eq_prod_three_roots := discr_eq_prod_three_roots

0 commit comments

Comments
 (0)