File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,11 +73,11 @@ theorem Monic.leadingCoeff {p : R[X]} (hp : p.Monic) : leadingCoeff p = 1 :=
7373theorem Monic.coeff_natDegree {p : R[X]} (hp : p.Monic) : p.coeff p.natDegree = 1 :=
7474 hp
7575
76- @[simp]
76+ @ [simp, grind = ]
7777theorem degree_zero : degree (0 : R[X]) = ⊥ :=
7878 rfl
7979
80- @[simp]
80+ @ [simp, grind = ]
8181theorem natDegree_zero : natDegree (0 : R[X]) = 0 :=
8282 rfl
8383
@@ -161,18 +161,18 @@ theorem degree_C_lt : degree (C a) < 1 :=
161161
162162theorem degree_one_le : degree (1 : R[X]) ≤ (0 : WithBot ℕ) := by rw [← C_1]; exact degree_C_le
163163
164- @[simp]
164+ @ [simp, grind = ]
165165theorem natDegree_C (a : R) : natDegree (C a) = 0 := by
166166 by_cases ha : a = 0
167167 · have : C a = 0 := by rw [ha, C_0]
168168 rw [natDegree, degree_eq_bot.2 this, WithBot.unbotD_bot]
169169 · rw [natDegree, degree_C ha, WithBot.unbotD_zero]
170170
171- @[simp]
171+ @ [simp, grind = ]
172172theorem natDegree_one : natDegree (1 : R[X]) = 0 :=
173173 natDegree_C 1
174174
175- @[simp]
175+ @ [simp, grind = ]
176176theorem natDegree_natCast (n : ℕ) : natDegree (n : R[X]) = 0 := by
177177 simp only [← C_eq_natCast, natDegree_C]
178178
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public import Mathlib.Data.Set.Finite.Lemmas
1212public import Mathlib.RingTheory.Coprime.Lemmas
1313public import Mathlib.RingTheory.Localization.FractionRing
1414public import Mathlib.SetTheory.Cardinal.Order
15+ public import Mathlib.Order.Filter.TendstoCofinite
1516
1617/-!
1718# Theory of univariate polynomials
@@ -157,6 +158,15 @@ theorem eq_of_infinite_eval_eq (p q : R[X]) (h : Set.Infinite { x | eval x p = e
157158 apply eq_zero_of_infinite_isRoot
158159 simpa only [IsRoot, eval_sub, sub_eq_zero]
159160
161+ /-- Non-constant polynomials have finite fibres, provided the coefficients are a domain. -/
162+ lemma tendstoCofinite_of_natDegree_ne_zero {R : Type } [CommRing R] [IsDomain R] (p : R[X])
163+ (hp : p.natDegree ≠ 0 ) : Filter.TendstoCofinite p.eval := by
164+ rw [Filter.tendstoCofinite_iff_finite_preimage_singleton]
165+ intro x
166+ by_contra! hx
167+ obtain ⟨rfl⟩ : p = C x := p.eq_of_infinite_eval_eq (C x) (by simpa)
168+ simp at hp
169+
160170theorem roots_mul {p q : R[X]} (hpq : p * q ≠ 0 ) : (p * q).roots = p.roots + q.roots := by
161171 classical
162172 exact Multiset.ext.mpr fun r => by
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ theorem mem_span_pow {x y : S} {d : ℕ} (hd : d ≠ 0) :
115115 · rintro ⟨f, h, hy⟩
116116 refine ⟨f, ?_, hy⟩
117117 by_cases hf : f = 0
118- · simp only [hf, natDegree_zero, degree_zero] at h ⊢
118+ · simp only [hf, natDegree_zero, Polynomial. degree_zero] at h ⊢
119119 first | exact lt_of_le_of_ne (Nat.zero_le d) hd.symm | exact WithBot.bot_lt_coe d
120120 simpa [degree_eq_natDegree hf] using h
121121
You can’t perform that action at this time.
0 commit comments