Skip to content

Commit 5cdb67d

Browse files
chore: deprecate duplicate Polynomial.Monic.natDegree_eq_zero_iff_eq_one (#30922)
1 parent e7d09b1 commit 5cdb67d

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

Mathlib/Algebra/Polynomial/Degree/Operations.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ theorem eq_one_of_monic_natDegree_zero (hf : p.Monic) (hfd : p.natDegree = 0) :
490490
rw [Monic.def, leadingCoeff, hfd] at hf
491491
rw [eq_C_of_natDegree_eq_zero hfd, hf, map_one]
492492

493+
@[simp]
493494
theorem Monic.natDegree_eq_zero (hf : p.Monic) : p.natDegree = 0 ↔ p = 1 :=
494495
⟨eq_one_of_monic_natDegree_zero hf, by rintro rfl; simp⟩
495496

Mathlib/Algebra/Polynomial/Monic.lean

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,11 @@ lemma comp_X_add_C (hp : p.Monic) (r : R) : (p.comp (X + C r)).Monic := by
134134
rw [natDegree_X_add_C] at ha
135135
exact one_ne_zero ha
136136

137-
@[simp]
138-
theorem natDegree_eq_zero_iff_eq_one (hp : p.Monic) : p.natDegree = 0 ↔ p = 1 := by
139-
constructor <;> intro h
140-
swap
141-
· rw [h]
142-
exact natDegree_one
143-
have : p = C (p.coeff 0) := by
144-
rw [← Polynomial.degree_le_zero_iff]
145-
rwa [Polynomial.natDegree_eq_zero_iff_degree_le_zero] at h
146-
rw [this]
147-
rw [← h, ← Polynomial.leadingCoeff, Monic.def.1 hp, C_1]
137+
@[deprecated (since := "2025-10-26")] alias natDegree_eq_zero_iff_eq_one := natDegree_eq_zero
148138

149139
@[simp]
150140
theorem degree_le_zero_iff_eq_one (hp : p.Monic) : p.degree ≤ 0 ↔ p = 1 := by
151-
rw [← hp.natDegree_eq_zero_iff_eq_one, natDegree_eq_zero_iff_degree_le_zero]
141+
rw [← hp.natDegree_eq_zero, natDegree_eq_zero_iff_degree_le_zero]
152142

153143
theorem natDegree_mul (hp : p.Monic) (hq : q.Monic) :
154144
(p * q).natDegree = p.natDegree + q.natDegree := by
@@ -228,7 +218,7 @@ theorem Monic.eq_one_of_isUnit (hm : Monic p) (hpu : IsUnit p) : p = 1 := by
228218
obtain ⟨q, h⟩ := hpu.exists_right_inv
229219
have := hm.natDegree_mul' (right_ne_zero_of_mul_eq_one h)
230220
rw [h, natDegree_one, eq_comm, add_eq_zero] at this
231-
exact hm.natDegree_eq_zero_iff_eq_one.mp this.1
221+
exact hm.natDegree_eq_zero.mp this.1
232222

233223
theorem Monic.isUnit_iff (hm : p.Monic) : IsUnit p ↔ p = 1 :=
234224
⟨hm.eq_one_of_isUnit, fun h => h.symm ▸ isUnit_one⟩
@@ -303,7 +293,7 @@ lemma Monic.irreducible_iff_natDegree (hp : p.Monic) :
303293
by_cases hp1 : p = 1; · simp [hp1]
304294
rw [irreducible_of_monic hp hp1, and_iff_right hp1]
305295
refine forall₄_congr fun a b ha hb => ?_
306-
rw [ha.natDegree_eq_zero_iff_eq_one, hb.natDegree_eq_zero_iff_eq_one]
296+
rw [ha.natDegree_eq_zero, hb.natDegree_eq_zero]
307297

308298
lemma Monic.irreducible_iff_natDegree' (hp : p.Monic) : Irreducible p ↔ p ≠ 1
309299
∀ f g : R[X], f.Monic → g.Monic → f * g = p → g.natDegree ∉ Ioc 0 (p.natDegree / 2) := by
@@ -493,7 +483,7 @@ theorem Monic.mul_right_ne_zero (hp : Monic p) {q : R[X]} (hq : q ≠ 0) : p * q
493483
theorem Monic.mul_natDegree_lt_iff (h : Monic p) {q : R[X]} :
494484
(p * q).natDegree < p.natDegree ↔ p ≠ 1 ∧ q = 0 := by
495485
by_cases hq : q = 0
496-
· suffices 0 < p.natDegree ↔ p.natDegree ≠ 0 by simpa [hq, ← h.natDegree_eq_zero_iff_eq_one]
486+
· suffices 0 < p.natDegree ↔ p.natDegree ≠ 0 by simpa [hq, ← h.natDegree_eq_zero]
497487
exact ⟨fun h => h.ne', fun h => lt_of_le_of_ne (Nat.zero_le _) h.symm⟩
498488
· simp [h.natDegree_mul', hq]
499489

Mathlib/Topology/Algebra/Polynomial.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ open Multiset
144144

145145
theorem eq_one_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (hB : B < 0) (h1 : p.Monic)
146146
(h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) : p = 1 :=
147-
h1.natDegree_eq_zero_iff_eq_one.mp (by
147+
h1.natDegree_eq_zero.mp (by
148148
contrapose! hB
149149
rw [← h1.natDegree_map f, natDegree_eq_card_roots' h2] at hB
150150
obtain ⟨z, hz⟩ := card_pos_iff_exists_mem.mp (zero_lt_iff.mpr hB)

0 commit comments

Comments
 (0)