@@ -271,6 +271,39 @@ theorem natDegree_map_eq_iff {f : R →+* S} {p : Polynomial R} :
271271 · simp_rw [h, ne_eq, or_true, iff_true, ← Nat.le_zero, ← h, natDegree_map_le]
272272 simp_all [natDegree, WithBot.unbotD_eq_unbotD_iff]
273273
274+ theorem degree_map_eq_of_isUnit_leadingCoeff [Nontrivial S] (f : R →+* S)
275+ (hp : IsUnit p.leadingCoeff) : (p.map f).degree = p.degree :=
276+ degree_map_eq_of_leadingCoeff_ne_zero _ <| f.isUnit_map hp |>.ne_zero
277+
278+ theorem natDegree_map_eq_of_isUnit_leadingCoeff [Nontrivial S] (f : R →+* S)
279+ (hp : IsUnit p.leadingCoeff) : (p.map f).natDegree = p.natDegree :=
280+ natDegree_eq_natDegree <| degree_map_eq_of_isUnit_leadingCoeff _ hp
281+
282+ theorem leadingCoeff_map_eq_of_isUnit_leadingCoeff [Nontrivial S] (f : R →+* S)
283+ (hp : IsUnit p.leadingCoeff) : (p.map f).leadingCoeff = f p.leadingCoeff :=
284+ leadingCoeff_map_of_leadingCoeff_ne_zero _ <| f.isUnit_map hp |>.ne_zero
285+
286+ theorem nextCoeff_map_eq_of_isUnit_leadingCoeff [Nontrivial S] (f : R →+* S)
287+ (hp : IsUnit p.leadingCoeff) : (p.map f).nextCoeff = f p.nextCoeff :=
288+ nextCoeff_map_of_leadingCoeff_ne_zero _ <| f.isUnit_map hp |>.ne_zero
289+
290+ theorem degree_map_eq_of_injective {f : R →+* S} (hf : Function.Injective f) (p : Polynomial R) :
291+ (p.map f).degree = p.degree := by
292+ simp [hf, map_ne_zero_iff, ne_or_eq]
293+
294+ theorem natDegree_map_eq_of_injective {f : R →+* S} (hf : Function.Injective f) (p : Polynomial R) :
295+ (p.map f).natDegree = p.natDegree :=
296+ natDegree_eq_of_degree_eq <| degree_map_eq_of_injective hf _
297+
298+ theorem leadingCoeff_map_of_injective {f : R →+* S} (hf : Function.Injective f)
299+ (p : Polynomial R) : (p.map f).leadingCoeff = f p.leadingCoeff := by
300+ simp only [leadingCoeff, natDegree_map_eq_of_injective hf, coeff_map]
301+
302+ theorem nextCoeff_map {f : R →+* S} (hf : Function.Injective f) (p : Polynomial R) :
303+ (p.map f).nextCoeff = f p.nextCoeff := by
304+ simp only [hf, nextCoeff, natDegree_map_eq_of_injective]
305+ split_ifs <;> simp
306+
274307theorem natDegree_pos_of_nextCoeff_ne_zero (h : p.nextCoeff ≠ 0 ) : 0 < p.natDegree := by
275308 grind [nextCoeff]
276309
@@ -323,6 +356,13 @@ lemma natDegree_eq_one : p.natDegree = 1 ↔ ∃ a ≠ 0, ∃ b, C a * X + C b =
323356 · rintro ⟨a, ha, b, rfl⟩
324357 simp [ha]
325358
359+ theorem subsingleton_isRoot_of_natDegree_eq_one [IsLeftCancelMulZero R] [IsRightCancelAdd R]
360+ (h : p.natDegree = 1 ) : { x | IsRoot p x }.Subsingleton := by
361+ intro r₁
362+ obtain ⟨r₂, hr₂, r₃, rfl⟩ : ∃ a, a ≠ 0 ∧ ∃ b, C a * X + C b = p := by rwa [natDegree_eq_one] at h
363+ have (x y : R) := mul_left_cancel₀ hr₂ (b := x) (c := y)
364+ grind [IsRoot, eval_add, eval_mul_X, eval_C]
365+
326366variable [NoZeroDivisors R]
327367
328368theorem degree_mul_C (a0 : a ≠ 0 ) : (p * C a).degree = p.degree := by
@@ -357,6 +397,14 @@ theorem leadingCoeff_comp (hq : natDegree q ≠ 0) :
357397 leadingCoeff (p.comp q) = leadingCoeff p * leadingCoeff q ^ natDegree p := by
358398 rw [← coeff_comp_degree_mul_degree hq, ← natDegree_comp, coeff_natDegree]
359399
400+ @[simp]
401+ theorem nextCoeff_C_mul : (C a * p).nextCoeff = a * p.nextCoeff := by
402+ by_cases h₀ : a = 0 <;> simp [h₀, nextCoeff, natDegree_C_mul]
403+
404+ @[simp]
405+ theorem nextCoeff_mul_C : (p * C a).nextCoeff = p.nextCoeff * a := by
406+ by_cases h₀ : a = 0 <;> simp [h₀, nextCoeff, natDegree_mul_C]
407+
360408end NoZeroDivisors
361409
362410@[simp] lemma comp_neg_X_leadingCoeff_eq [Ring R] (p : R[X]) :
0 commit comments