Skip to content

Commit bc7bce2

Browse files
committed
feat(MvPowerSeries): MvPowerSeries.C is injective and add @[grind inj] (#37689)
Co-authored-by: WenrongZou <wenrongzou@outlook.com>
1 parent 9e24e9a commit bc7bce2

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

Mathlib/Algebra/MvPolynomial/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ theorem C_mul : (C (a * a') : MvPolynomial σ R) = C a * C a' :=
157157
theorem C_pow (a : R) (n : ℕ) : (C (a ^ n) : MvPolynomial σ R) = C a ^ n :=
158158
map_pow _ _ _
159159

160+
@[grind inj]
160161
theorem C_injective (σ : Type*) (R : Type*) [CommSemiring R] :
161162
Function.Injective (C : R → MvPolynomial σ R) :=
162163
Finsupp.single_injective _

Mathlib/Algebra/Polynomial/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ theorem C_mul_X_eq_monomial : C a * X = monomial 1 a := by rw [← C_mul_X_pow_e
679679
theorem toFinsupp_C_mul_X (a : R) : (C a * X).toFinsupp = .single 1 a := by
680680
rw [C_mul_X_eq_monomial, toFinsupp_monomial]
681681

682+
@[grind inj]
682683
theorem C_injective : Injective (C : R → R[X]) :=
683684
monomial_injective 0
684685

Mathlib/RingTheory/MvPowerSeries/Basic.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,16 @@ theorem coeff_C [DecidableEq σ] (n : σ →₀ ℕ) (a : R) :
351351
theorem coeff_zero_C (a : R) : coeff (0 : σ →₀ ℕ) (C a) = a :=
352352
coeff_monomial_same 0 a
353353

354+
@[grind inj]
355+
theorem C_injective : Function.Injective (C : R → MvPowerSeries σ R) := by
356+
intro a b h
357+
rw [← coeff_zero_C a, h, coeff_zero_C]
358+
359+
theorem C_surjective [IsEmpty σ] : Function.Surjective (C : R → MvPowerSeries σ R) :=
360+
fun p => ⟨p 0, by ext n; simpa [coeff_C, Subsingleton.eq_zero n] using coeff_apply _ _⟩
361+
362+
@[simp] theorem C_inj (r s : R) : (C r : MvPowerSeries σ R) = C s ↔ r = s := (C_injective).eq_iff
363+
354364
/-- The variables of the multivariate formal power series ring. -/
355365
def X (s : σ) : MvPowerSeries σ R :=
356366
monomial (single s 1) 1

Mathlib/RingTheory/PowerSeries/Basic.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,8 @@ theorem coeff_ne_zero_C {a : R} {n : ℕ} (h : n ≠ 0) : coeff n (C a) = 0 := b
192192
theorem coeff_succ_C {a : R} {n : ℕ} : coeff (n + 1) (C a) = 0 :=
193193
coeff_ne_zero_C n.succ_ne_zero
194194

195-
theorem C_injective : Function.Injective (C (R := R)) := by
196-
intro a b H
197-
simp_rw [PowerSeries.ext_iff] at H
198-
simpa only [coeff_zero_C] using H 0
195+
@[grind inj]
196+
theorem C_injective : Function.Injective (C (R := R)) := MvPowerSeries.C_injective
199197

200198
protected theorem subsingleton_iff : Subsingleton R⟦X⟧ ↔ Subsingleton R := by
201199
refine ⟨fun h ↦ ?_, fun _ ↦ inferInstance⟩

0 commit comments

Comments
 (0)