Skip to content

Commit a1e8445

Browse files
committed
merge master
2 parents 7390809 + 23398d9 commit a1e8445

File tree

68 files changed

+1978
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1978
-384
lines changed

Mathlib.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries
15471547
public import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno
15481548
public import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension
15491549
public import Mathlib.Analysis.Calculus.ContDiff.Operations
1550+
public import Mathlib.Analysis.Calculus.ContDiff.Polynomial
15501551
public import Mathlib.Analysis.Calculus.ContDiff.RCLike
15511552
public import Mathlib.Analysis.Calculus.ContDiff.RestrictScalars
15521553
public import Mathlib.Analysis.Calculus.ContDiff.WithLp
@@ -1763,6 +1764,7 @@ public import Mathlib.Analysis.Convolution
17631764
public import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff
17641765
public import Mathlib.Analysis.Distribution.ContDiffMapSupportedIn
17651766
public import Mathlib.Analysis.Distribution.DerivNotation
1767+
public import Mathlib.Analysis.Distribution.Distribution
17661768
public import Mathlib.Analysis.Distribution.FourierSchwartz
17671769
public import Mathlib.Analysis.Distribution.SchwartzSpace
17681770
public import Mathlib.Analysis.Distribution.TemperateGrowth
@@ -2071,6 +2073,7 @@ public import Mathlib.Analysis.Real.Pi.Leibniz
20712073
public import Mathlib.Analysis.Real.Pi.Wallis
20722074
public import Mathlib.Analysis.Real.Spectrum
20732075
public import Mathlib.Analysis.Seminorm
2076+
public import Mathlib.Analysis.SpecialFunctions.Arcosh
20742077
public import Mathlib.Analysis.SpecialFunctions.Arsinh
20752078
public import Mathlib.Analysis.SpecialFunctions.Bernstein
20762079
public import Mathlib.Analysis.SpecialFunctions.BinaryEntropy
@@ -6257,6 +6260,7 @@ public import Mathlib.RingTheory.Smooth.Flat
62576260
public import Mathlib.RingTheory.Smooth.Kaehler
62586261
public import Mathlib.RingTheory.Smooth.Local
62596262
public import Mathlib.RingTheory.Smooth.Locus
6263+
public import Mathlib.RingTheory.Smooth.NoetherianDescent
62606264
public import Mathlib.RingTheory.Smooth.Pi
62616265
public import Mathlib.RingTheory.Smooth.StandardSmooth
62626266
public import Mathlib.RingTheory.Smooth.StandardSmoothCotangent

Mathlib/Algebra/Algebra/Bilinear.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,7 @@ lemma comp_mul' (f : A →ₐ B) : f.toLinearMap ∘ₗ μ = μ[R] ∘ₗ (f.toL
305305
TensorProduct.ext' <| by simp
306306

307307
end AlgHom
308+
309+
lemma LinearMap.toSpanSingleton_one_eq_algebraLinearMap [CommSemiring R] [Semiring A]
310+
[Algebra R A] : toSpanSingleton R A 1 = Algebra.linearMap R A := by
311+
ext; simp

Mathlib/Algebra/BigOperators/Fin.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,27 @@ theorem prod_trunc {a b : ℕ} (f : Fin (a + b) → M) (hf : ∀ j : Fin b, f (n
168168
(∏ i : Fin (a + b), f i) = ∏ i : Fin a, f (castAdd b i) := by
169169
rw [prod_univ_add, Fintype.prod_eq_one _ hf, mul_one]
170170

171+
@[to_additive]
172+
private lemma prod_insertNth_go :
173+
∀ n i (h : i < n + 1) x (p : Fin n → M), ∏ j, insertNth ⟨i, h⟩ x p j = x * ∏ j, p j
174+
| n, 0, h, x, p => by simp
175+
| 0, i, h, x, p => by simp [fin_one_eq_zero ⟨i, h⟩]
176+
| n + 1, i + 1, h, x, p => by
177+
obtain ⟨hd, tl, rfl⟩ := exists_cons p
178+
have i_lt := Nat.lt_of_succ_lt_succ h
179+
let i_fin : Fin (n + 1) := ⟨i, i_lt⟩
180+
rw [show ⟨i + 1, h⟩ = i_fin.succ from rfl]
181+
simp only [insertNth_succ_cons, prod_cons]
182+
rw [prod_insertNth_go n i i_lt x tl, mul_left_comm]
183+
184+
@[to_additive (attr := simp)]
185+
theorem prod_insertNth i x (p : Fin n → M) : ∏ j, insertNth i x p j = x * ∏ j, p j :=
186+
prod_insertNth_go n i.val i.isLt x p
187+
188+
@[to_additive (attr := simp)]
189+
theorem mul_prod_removeNth i (f : Fin (n + 1) → M) : f i * ∏ j, removeNth i f j = ∏ j, f j := by
190+
rw [← prod_insertNth, insertNth_self_removeNth]
191+
171192
/-!
172193
### Products over intervals: `Fin.cast`
173194
-/

Mathlib/Algebra/BigOperators/Group/List/Basic.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,37 @@ lemma prod_eq_pow_single [DecidableEq M] (a : M) (h : ∀ a', a' ≠ a → a'
198198
l.prod = a ^ l.count a :=
199199
_root_.trans (by rw [map_id]) (prod_map_eq_pow_single a id h)
200200

201+
@[to_additive (attr := simp)]
202+
theorem prod_insertIdx {i} (hlen : i ≤ l.length) (hcomm : ∀ a' ∈ l.take i, Commute a a') :
203+
(l.insertIdx i a).prod = a * l.prod := by
204+
induction i generalizing l
205+
case zero => rfl
206+
case succ i ih =>
207+
obtain ⟨hd, tl, rfl⟩ := exists_cons_of_length_pos (Nat.zero_lt_of_lt hlen)
208+
simp only [insertIdx_succ_cons, prod_cons,
209+
ih (Nat.le_of_lt_succ hlen) (fun a' a'_mem => hcomm a' (mem_of_mem_tail a'_mem))]
210+
exact Commute.left_comm (hcomm hd (mem_of_mem_head? rfl)).symm tl.prod
211+
212+
@[to_additive (attr := simp)]
213+
theorem mul_prod_eraseIdx {i} (hlen : i < l.length) (hcomm : ∀ a' ∈ l.take i, Commute l[i] a') :
214+
l[i] * (l.eraseIdx i).prod = l.prod := by
215+
rw [← prod_insertIdx (by grind : i ≤ (l.eraseIdx i).length) (fun a' a'_mem =>
216+
hcomm a' (by rwa [take_eraseIdx_eq_take_of_le l i i (Nat.le_refl i)] at a'_mem)),
217+
insertIdx_eraseIdx_getElem hlen]
218+
201219
end Monoid
202220

203221
section CommMonoid
204222
variable [CommMonoid M] {a : M} {l l₁ l₂ : List M}
205223

224+
@[to_additive (attr := simp)]
225+
theorem CommMonoid.prod_insertIdx {i} (h : i ≤ l.length) : (l.insertIdx i a).prod = a * l.prod :=
226+
List.prod_insertIdx h (fun a' _ ↦ Commute.all a a')
227+
228+
@[to_additive (attr := simp)]
229+
theorem CommMonoid.mul_prod_eraseIdx {i} (h : i < l.length) : l[i] * (l.eraseIdx i).prod = l.prod :=
230+
List.mul_prod_eraseIdx h (fun a' _ ↦ Commute.all l[i] a')
231+
206232
@[to_additive (attr := simp)]
207233
lemma prod_erase [DecidableEq M] (ha : a ∈ l) : a * (l.erase a).prod = l.prod :=
208234
prod_erase_of_comm ha fun x _ y _ ↦ mul_comm x y

Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,8 @@ def HomEquiv.fromRestriction {X : ModuleCat R} {Y : ModuleCat S}
487487
{ toFun := fun s : S => g <| (s • y : Y)
488488
map_add' := fun s1 s2 : S => by simp only [add_smul]; rw [map_add]
489489
map_smul' := fun r (s : S) => by
490-
-- Porting note: dsimp clears out some rw's but less eager to apply others with Lean 4
491-
dsimp
492-
rw [← g.hom.map_smul]
493-
erw [smul_eq_mul, mul_smul]
494-
rfl }
490+
rw [ModuleCat.restrictScalars.smul_def _ (M := ModuleCat.of _ _) _ _, ← g.hom.map_smul]
491+
simp [mul_smul] }
495492
map_add' := fun y1 y2 : Y =>
496493
LinearMap.ext fun s : S => by
497494
simp [smul_add, map_add]

Mathlib/Algebra/Category/ModuleCat/Monoidal/Basic.lean

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,16 @@ theorem leftUnitor_naturality {M N : SemimoduleCat R} (f : M ⟶ N) :
132132
ext : 1
133133
-- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): broken ext
134134
apply TensorProduct.ext
135-
ext x
136-
dsimp
137-
erw [TensorProduct.lid_tmul, TensorProduct.lid_tmul]
138-
rw [map_smul]
139-
rfl
135+
ext
136+
simp [tensorHom, tensorObj, leftUnitor]
140137

141138
theorem rightUnitor_naturality {M N : SemimoduleCat R} (f : M ⟶ N) :
142139
tensorHom f (𝟙 (SemimoduleCat.of R R)) ≫ (rightUnitor N).hom = (rightUnitor M).hom ≫ f := by
143140
ext : 1
144141
-- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): broken ext
145142
apply TensorProduct.ext
146-
ext x
147-
dsimp
148-
erw [TensorProduct.rid_tmul, TensorProduct.rid_tmul]
149-
rw [map_smul]
150-
rfl
143+
ext
144+
simp [tensorHom, tensorObj, rightUnitor]
151145

152146
theorem triangle (M N : SemimoduleCat.{u} R) :
153147
(associator M (SemimoduleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =

Mathlib/Algebra/DirectSum/Module.lean

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -429,30 +429,8 @@ noncomputable def IsInternal.collectedBasis (h : IsInternal A) {α : ι → Type
429429
@[simp]
430430
theorem IsInternal.collectedBasis_coe (h : IsInternal A) {α : ι → Type*}
431431
(v : ∀ i, Basis (α i) R (A i)) : ⇑(h.collectedBasis v) = fun a : Σ i, α i ↦ ↑(v a.1 a.2) := by
432-
funext a
433-
-- Porting note: was
434-
-- simp only [IsInternal.collectedBasis, toModule, coeLinearMap, Basis.coe_ofRepr,
435-
-- Basis.repr_symm_apply, DFinsupp.lsum_apply_apply, DFinsupp.mapRange.linearEquiv_apply,
436-
-- DFinsupp.mapRange.linearEquiv_symm, DFinsupp.mapRange_single, linearCombination_single,
437-
-- LinearEquiv.ofBijective_apply, LinearEquiv.symm_symm, LinearEquiv.symm_trans_apply, one_smul,
438-
-- sigmaFinsuppAddEquivDFinsupp_apply, sigmaFinsuppEquivDFinsupp_single,
439-
-- sigmaFinsuppLequivDFinsupp_apply]
440-
-- convert DFinsupp.sumAddHom_single (fun i ↦ (A i).subtype.toAddMonoidHom) a.1 (v a.1 a.2)
441-
simp only [IsInternal.collectedBasis, coeLinearMap, Basis.coe_ofRepr, LinearEquiv.trans_symm,
442-
LinearEquiv.symm_symm, LinearEquiv.trans_apply, sigmaFinsuppLequivDFinsupp_apply,
443-
AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, EquivLike.coe_coe,
444-
sigmaFinsuppAddEquivDFinsupp_apply, sigmaFinsuppEquivDFinsupp_single,
445-
LinearEquiv.ofBijective_apply]
446-
rw [DFinsupp.mapRange.linearEquiv_symm]
447-
-- `DFunLike.coe (β := fun x ↦ ⨁ (i : ι), ↥(A i))`
448-
-- appears in the goal, but the lemma is expecting
449-
-- `DFunLike.coe (β := fun x ↦ Π₀ (i : ι), ↥(A i))`
450-
erw [DFinsupp.mapRange.linearEquiv_apply]
451-
simp only [DFinsupp.mapRange_single, Basis.repr_symm_apply, linearCombination_single, one_smul,
452-
toModule]
453-
-- Similarly here.
454-
erw [DFinsupp.lsum_single]
455-
simp only [Submodule.coe_subtype]
432+
simp [IsInternal.collectedBasis, coeLinearMap, DFinsupp.mapRange.linearEquiv,
433+
toModule, DFinsupp.lsum]
456434

457435
theorem IsInternal.collectedBasis_mem (h : IsInternal A) {α : ι → Type*}
458436
(v : ∀ i, Basis (α i) R (A i)) (a : Σ i, α i) : h.collectedBasis v a ∈ A a.1 := by simp

Mathlib/Algebra/Homology/HomologicalComplexLimits.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ noncomputable def coneOfHasLimitEval : Cone F where
7474
naturality := fun i j φ => by
7575
ext n
7676
dsimp
77-
erw [limit.w]
78-
rw [id_comp] }
77+
simp only [Category.id_comp]
78+
rw [← eval_map, ← Functor.comp_map, limit.w] }
7979

8080
/-- The cone `coneOfHasLimitEval F` is limit. -/
8181
noncomputable def isLimitConeOfHasLimitEval : IsLimit (coneOfHasLimitEval F) :=
@@ -151,8 +151,8 @@ noncomputable def coconeOfHasColimitEval : Cocone F where
151151
naturality := fun i j φ => by
152152
ext n
153153
dsimp
154-
erw [colimit.w (F ⋙ eval C c n) φ]
155-
rw [comp_id] }
154+
simp only [Category.comp_id]
155+
rw [← eval_map, ← Functor.comp_map, colimit.w] }
156156

157157
/-- The cocone `coconeOfHasLimitEval F` is colimit. -/
158158
noncomputable def isColimitCoconeOfHasColimitEval : IsColimit (coconeOfHasColimitEval F) :=

Mathlib/Algebra/Module/CharacterModule.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ lemma eq_zero_of_ofSpanSingleton_apply_self (a : A)
200200
(h : ofSpanSingleton a ⟨a, Submodule.mem_span_singleton_self a⟩ = 0) : a = 0 := by
201201
erw [ofSpanSingleton, LinearMap.toAddMonoidHom_coe, LinearMap.comp_apply,
202202
intSpanEquivQuotAddOrderOf_apply_self, Submodule.liftQSpanSingleton_apply,
203-
AddMonoidHom.coe_toIntLinearMap, int.divByNat, LinearMap.toSpanSingleton_one,
203+
AddMonoidHom.coe_toIntLinearMap, int.divByNat, LinearMap.toSpanSingleton_apply_one,
204204
AddCircle.coe_eq_zero_iff] at h
205205
rcases h with ⟨n, hn⟩
206206
apply_fun Rat.den at hn

Mathlib/Algebra/Module/PID.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ theorem torsion_by_prime_power_decomposition (hM : Module.IsTorsion' M (Submonoi
214214
ext i : 3
215215
simp only [LinearMap.coe_comp, Function.comp_apply, mkQ_apply]
216216
rw [LinearEquiv.coe_toLinearMap, LinearMap.id_apply, DirectSum.toModule_lof,
217-
liftQSpanSingleton_apply, LinearMap.toSpanSingleton_one, Ideal.Quotient.mk_eq_mk,
217+
liftQSpanSingleton_apply, LinearMap.toSpanSingleton_apply_one, Ideal.Quotient.mk_eq_mk,
218218
map_one (Ideal.Quotient.mk _), (this i).choose_spec.right]
219219
· exact (mk_surjective _).forall.mpr fun x =>
220220
⟨(@hM x).choose, by rw [← Quotient.mk_smul, (@hM x).choose_spec, Quotient.mk_zero]⟩

0 commit comments

Comments
 (0)