Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Mathlib/Algebra/Polynomial/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,9 @@ theorem coeff_C : coeff (C a) n = ite (n = 0) a 0 := by
theorem coeff_C_zero : coeff (C a) 0 = a :=
coeff_monomial

theorem coeff_C_ne_zero (h : n ≠ 0) : (C a).coeff n = 0 := by rw [coeff_C, if_neg h]
theorem coeff_C_of_ne_zero (h : n ≠ 0) : (C a).coeff n = 0 := by rw [coeff_C, if_neg h]

@[deprecated (since := "2026-05-20")] alias coeff_C_ne_zero := coeff_C_of_ne_zero

@[simp]
lemma coeff_C_succ {r : R} {n : ℕ} : coeff (C r) (n + 1) = 0 := by simp [coeff_C]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Polynomial/Eval/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ theorem eval₂_mul_C' (h : Commute (f a) x) : eval₂ f x (p * C a) = eval₂ f
intro k
by_cases hk : k = 0
· simp only [hk, h, coeff_C_zero]
· simp only [coeff_C_ne_zero hk, map_zero, Commute.zero_left]
· simp only [coeff_C_of_ne_zero hk, map_zero, Commute.zero_left]

theorem eval₂_list_prod_noncomm (ps : List R[X])
(hf : ∀ p ∈ ps, ∀ (k), Commute (f <| coeff p k) x) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/HahnSeries/HEval.lean
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ theorem heval_C (r : R) : heval x (C r) = r • 1 := by
ext g
simp only [heval_apply, coeff_hsum, smulFamily_toFun, powers_toFun, HahnSeries.coeff_smul,
HahnSeries.coeff_one, smul_eq_mul, mul_ite, mul_one, mul_zero]
rw [finsum_eq_single _ 0 (fun n hn ↦ by simp [coeff_ne_zero_C hn])]
rw [finsum_eq_single _ 0 (fun n hn ↦ by simp [coeff_C_of_ne_zero hn])]
by_cases hg : g = 0 <;> simp

theorem heval_X (hx : 0 < x.orderTop) : heval x X = x := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Polynomial/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ theorem isPrime_map_C_iff_isPrime (P : Ideal R) :
constructor
· rintro h (- | n)
· rwa [coeff_C_zero]
· simp only [coeff_C_ne_zero (Nat.succ_ne_zero _), Submodule.zero_mem]
· simp only [coeff_C_of_ne_zero (Nat.succ_ne_zero _), Submodule.zero_mem]
· intro h
simpa only [coeff_C_zero] using h 0
· intro h
Expand Down
6 changes: 4 additions & 2 deletions Mathlib/RingTheory/PowerSeries/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ theorem coeff_C (n : ℕ) (a : R) : coeff n (C a : R⟦X⟧) = if n = 0 then a e
theorem coeff_zero_C (a : R) : coeff 0 (C a) = a := by
rw [coeff_C, if_pos rfl]

theorem coeff_ne_zero_C {a : R} {n : ℕ} (h : n ≠ 0) : coeff n (C a) = 0 := by
theorem coeff_C_of_ne_zero {a : R} {n : ℕ} (h : n ≠ 0) : coeff n (C a) = 0 := by
rw [coeff_C, if_neg h]

@[deprecated (since := "2026-05-20")] alias coeff_ne_zero_C := coeff_C_of_ne_zero

@[simp]
theorem coeff_succ_C {a : R} {n : ℕ} : coeff (n + 1) (C a) = 0 :=
coeff_ne_zero_C n.succ_ne_zero
coeff_C_of_ne_zero n.succ_ne_zero

@[grind inj]
theorem C_injective : Function.Injective (C (R := R)) := MvPowerSeries.C_injective
Expand Down
Loading