@@ -64,74 +64,12 @@ open Finsupp (single)
6464
6565variable {R : Type *}
6666
67- section
68-
6967/--
7068`R⟦X⟧` is notation for `PowerSeries R`,
7169the semiring of formal power series in one variable over a semiring `R`.
7270-/
7371scoped notation :9000 R "⟦X⟧" => PowerSeries R
7472
75- instance [Inhabited R] : Inhabited R⟦X⟧ := by
76- dsimp only [PowerSeries]
77- infer_instance
78-
79- instance [Zero R] : Zero R⟦X⟧ := by
80- dsimp only [PowerSeries]
81- infer_instance
82-
83- instance [AddMonoid R] : AddMonoid R⟦X⟧ := by
84- dsimp only [PowerSeries]
85- infer_instance
86-
87- instance [AddGroup R] : AddGroup R⟦X⟧ := by
88- dsimp only [PowerSeries]
89- infer_instance
90-
91- instance [AddCommMonoid R] : AddCommMonoid R⟦X⟧ := by
92- dsimp only [PowerSeries]
93- infer_instance
94-
95- instance [AddCommGroup R] : AddCommGroup R⟦X⟧ := by
96- dsimp only [PowerSeries]
97- infer_instance
98-
99- instance [Semiring R] : Semiring R⟦X⟧ := by
100- dsimp only [PowerSeries]
101- infer_instance
102-
103- instance [CommSemiring R] : CommSemiring R⟦X⟧ := by
104- dsimp only [PowerSeries]
105- infer_instance
106-
107- instance [Ring R] : Ring R⟦X⟧ := by
108- dsimp only [PowerSeries]
109- infer_instance
110-
111- instance [CommRing R] : CommRing R⟦X⟧ := by
112- dsimp only [PowerSeries]
113- infer_instance
114-
115- instance [Nontrivial R] : Nontrivial R⟦X⟧ := by
116- dsimp only [PowerSeries]
117- infer_instance
118-
119- set_option backward.isDefEq.respectTransparency false in
120- instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R A⟦X⟧ := by
121- dsimp only [PowerSeries]
122- infer_instance
123-
124- instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
125- [IsScalarTower R S A] : IsScalarTower R S A⟦X⟧ :=
126- Pi.isScalarTower
127-
128- set_option backward.isDefEq.respectTransparency false in
129- instance {A} [Semiring A] [CommSemiring R] [Algebra R A] : Algebra R A⟦X⟧ := by
130- dsimp only [PowerSeries]
131- infer_instance
132-
133- end
134-
13573section Semiring
13674
13775variable [Semiring R]
@@ -229,7 +167,6 @@ theorem coeff_zero_eq_constantCoeff : ⇑(coeff (R := R) 0) = constantCoeff := b
229167theorem coeff_zero_eq_constantCoeff_apply (φ : R⟦X⟧) : coeff 0 φ = constantCoeff φ := by
230168 rw [coeff_zero_eq_constantCoeff]
231169
232- set_option backward.isDefEq.respectTransparency false in
233170@[simp]
234171theorem monomial_zero_eq_C : ⇑(monomial (R := R) 0 ) = C := by
235172 -- This used to be `rw`, but we need `rw; rfl` after https://github.com/leanprover/lean4/pull/2644
@@ -268,7 +205,6 @@ theorem X_eq : (X : R⟦X⟧) = monomial 1 1 :=
268205theorem coeff_X (n : ℕ) : coeff n (X : R⟦X⟧) = if n = 1 then 1 else 0 := by
269206 rw [X_eq, coeff_monomial]
270207
271- set_option backward.isDefEq.respectTransparency false in
272208@[simp]
273209theorem coeff_zero_X : coeff 0 (X : R⟦X⟧) = 0 := by
274210 rw [coeff, Finsupp.single_zero, X, MvPowerSeries.coeff_zero_X]
@@ -326,14 +262,12 @@ theorem smul_eq_C_mul (f : R⟦X⟧) (a : R) : a • f = C a * f := by
326262 ext
327263 simp
328264
329- set_option backward.isDefEq.respectTransparency false in
330265@[simp]
331266theorem coeff_succ_mul_X (n : ℕ) (φ : R⟦X⟧) : coeff (n + 1 ) (φ * X) = coeff n φ := by
332267 simp only [coeff, Finsupp.single_add]
333268 convert φ.coeff_add_mul_monomial (single () n) (single () 1 ) _
334269 rw [mul_one]
335270
336- set_option backward.isDefEq.respectTransparency false in
337271@[simp]
338272theorem coeff_succ_X_mul (n : ℕ) (φ : R⟦X⟧) : coeff (n + 1 ) (X * φ) = coeff n φ := by
339273 simp only [coeff, Finsupp.single_add, add_comm n 1 ]
@@ -592,7 +526,6 @@ variable [CommSemiring R]
592526
593527open Finset Nat
594528
595- set_option backward.isDefEq.respectTransparency false in
596529/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
597530noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
598531 toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff n f
@@ -670,7 +603,6 @@ open Finset.HasAntidiagonal Finset
670603
671604variable {R : Type *} [CommSemiring R] {ι : Type *}
672605
673- set_option backward.isDefEq.respectTransparency false in
674606/-- Coefficients of a product of power series -/
675607theorem coeff_prod [DecidableEq ι] (f : ι → PowerSeries R) (d : ℕ) (s : Finset ι) :
676608 coeff d (∏ j ∈ s, f j) = ∑ l ∈ finsuppAntidiag s d, ∏ i ∈ s, coeff (l i) (f i) := by
@@ -710,7 +642,6 @@ lemma coeff_one_mul (φ ψ : R⟦X⟧) : coeff 1 (φ * ψ) =
710642 mul_comm, add_comm]
711643 simp
712644
713- set_option backward.isDefEq.respectTransparency false in
714645/-- First coefficient of the `n`-th power of a power series. -/
715646lemma coeff_one_pow (n : ℕ) (φ : R⟦X⟧) :
716647 coeff 1 (φ ^ n) = n * coeff 1 φ * (constantCoeff φ) ^ (n - 1 ) := by
@@ -747,7 +678,6 @@ section CommRing
747678
748679variable {A : Type *} [CommRing A]
749680
750- set_option backward.isDefEq.respectTransparency false in
751681theorem not_isField : ¬IsField A⟦X⟧ := by
752682 by_cases hA : Subsingleton A
753683 · exact not_isField_of_subsingleton _
@@ -767,7 +697,6 @@ theorem rescale_X (a : A) : rescale a X = C a * X := by
767697 simp only [coeff_rescale, coeff_C_mul, coeff_X]
768698 split_ifs with h <;> simp [h]
769699
770- set_option backward.isDefEq.respectTransparency false in
771700theorem rescale_neg_one_X : rescale (-1 : A) X = -X := by
772701 rw [rescale_X, map_neg, map_one, neg_one_mul]
773702
@@ -791,7 +720,6 @@ theorem C_eq_algebraMap {r : R} : C r = (algebraMap R R⟦X⟧) r :=
791720theorem algebraMap_apply {r : R} : algebraMap R A⟦X⟧ r = C (algebraMap R A r) :=
792721 MvPowerSeries.algebraMap_apply
793722
794- set_option backward.isDefEq.respectTransparency false in
795723instance [Nontrivial R] : Nontrivial (Subalgebra R R⟦X⟧) :=
796724 { (inferInstance : Nontrivial <| Subalgebra R <| MvPowerSeries Unit R) with }
797725
@@ -914,7 +842,6 @@ theorem coeToPowerSeries.ringHom_apply : coeToPowerSeries.ringHom φ = φ :=
914842theorem coe_pow (n : ℕ) : ((φ ^ n : R[X]) : PowerSeries R) = (φ : PowerSeries R) ^ n :=
915843 coeToPowerSeries.ringHom.map_pow _ _
916844
917- set_option backward.isDefEq.respectTransparency false in
918845theorem eval₂_C_X_eq_coe : φ.eval₂ PowerSeries.C PowerSeries.X = ↑φ := by
919846 nth_rw 2 [← eval₂_C_X (p := φ)]
920847 rw [← coeToPowerSeries.ringHom_apply, eval₂_eq_sum_range, eval₂_eq_sum_range, map_sum]
@@ -929,7 +856,6 @@ section CommSemiring
929856
930857variable {R : Type *} [CommSemiring R] (φ ψ : R[X])
931858
932- set_option backward.isDefEq.respectTransparency false in
933859theorem _root_.MvPolynomial.toMvPowerSeries_pUnitAlgEquiv {f : MvPolynomial PUnit R} :
934860 (f.toMvPowerSeries : PowerSeries R) = (f.pUnitAlgEquiv R).toPowerSeries := by
935861 induction f using MvPolynomial.induction_on' with
0 commit comments