Skip to content

Commit ff9ef15

Browse files
Update lean-toolchain for leanprover/lean4#11554
2 parents 28418d5 + 25918fa commit ff9ef15

File tree

395 files changed

+9102
-5112
lines changed

Some content is hidden

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

395 files changed

+9102
-5112
lines changed

Counterexamples/AharoniKorman.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,8 @@ theorem scattered {f : ℚ → Hollom} (hf : StrictMono f) : False := by
322322
-- Take `x ≠ y` with `g x = g y`
323323
obtain ⟨x, y, hgxy, hxy'⟩ : ∃ x y, g x = g y ∧ x ≠ y := by simpa [Function.Injective] using hg''
324324
-- and wlog `x < y`
325-
wlog hxy : x < y generalizing x y
326-
· simp only [not_lt] at hxy
327-
exact this y x hgxy.symm hxy'.symm (lt_of_le_of_ne' hxy hxy')
325+
wlog! hxy : x < y generalizing x y
326+
· exact this y x hgxy.symm hxy'.symm (lt_of_le_of_ne' hxy hxy')
328327
-- Now `f '' [x, y]` is infinite, as it is the image of an infinite set of rationals,
329328
have h₁ : (f '' Set.Icc x y).Infinite := (Set.Icc_infinite hxy).image hf.injective.injOn
330329
-- but it is contained in `[f x, f y]` by monotonicity

Mathlib.lean

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,7 @@ public import Mathlib.AlgebraicTopology.SimplicialSet.CompStruct
14251425
public import Mathlib.AlgebraicTopology.SimplicialSet.CompStructTruncated
14261426
public import Mathlib.AlgebraicTopology.SimplicialSet.Coskeletal
14271427
public import Mathlib.AlgebraicTopology.SimplicialSet.Degenerate
1428+
public import Mathlib.AlgebraicTopology.SimplicialSet.Dimension
14281429
public import Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat
14291430
public import Mathlib.AlgebraicTopology.SimplicialSet.Horn
14301431
public import Mathlib.AlgebraicTopology.SimplicialSet.HornColimits
@@ -1546,6 +1547,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries
15461547
public import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno
15471548
public import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension
15481549
public import Mathlib.Analysis.Calculus.ContDiff.Operations
1550+
public import Mathlib.Analysis.Calculus.ContDiff.Polynomial
15491551
public import Mathlib.Analysis.Calculus.ContDiff.RCLike
15501552
public import Mathlib.Analysis.Calculus.ContDiff.RestrictScalars
15511553
public import Mathlib.Analysis.Calculus.ContDiff.WithLp
@@ -1762,6 +1764,7 @@ public import Mathlib.Analysis.Convolution
17621764
public import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff
17631765
public import Mathlib.Analysis.Distribution.ContDiffMapSupportedIn
17641766
public import Mathlib.Analysis.Distribution.DerivNotation
1767+
public import Mathlib.Analysis.Distribution.Distribution
17651768
public import Mathlib.Analysis.Distribution.FourierSchwartz
17661769
public import Mathlib.Analysis.Distribution.SchwartzSpace
17671770
public import Mathlib.Analysis.Distribution.TemperateGrowth
@@ -2070,6 +2073,7 @@ public import Mathlib.Analysis.Real.Pi.Leibniz
20702073
public import Mathlib.Analysis.Real.Pi.Wallis
20712074
public import Mathlib.Analysis.Real.Spectrum
20722075
public import Mathlib.Analysis.Seminorm
2076+
public import Mathlib.Analysis.SpecialFunctions.Arcosh
20732077
public import Mathlib.Analysis.SpecialFunctions.Arsinh
20742078
public import Mathlib.Analysis.SpecialFunctions.Bernstein
20752079
public import Mathlib.Analysis.SpecialFunctions.BinaryEntropy
@@ -2153,6 +2157,7 @@ public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex
21532157
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.ComplexDeriv
21542158
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Cotangent
21552159
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
2160+
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp
21562161
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd
21572162
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse
21582163
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.InverseDeriv
@@ -3154,6 +3159,7 @@ public import Mathlib.Combinatorics.Enumerative.Partition
31543159
public import Mathlib.Combinatorics.Enumerative.Partition.Basic
31553160
public import Mathlib.Combinatorics.Enumerative.Partition.GenFun
31563161
public import Mathlib.Combinatorics.Enumerative.Partition.Glaisher
3162+
public import Mathlib.Combinatorics.Enumerative.Schroder
31573163
public import Mathlib.Combinatorics.Enumerative.Stirling
31583164
public import Mathlib.Combinatorics.Extremal.RuzsaSzemeredi
31593165
public import Mathlib.Combinatorics.Graph.Basic
@@ -4500,6 +4506,7 @@ public import Mathlib.LinearAlgebra.Dimension.Free
45004506
public import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition
45014507
public import Mathlib.LinearAlgebra.Dimension.LinearMap
45024508
public import Mathlib.LinearAlgebra.Dimension.Localization
4509+
public import Mathlib.LinearAlgebra.Dimension.OrzechProperty
45034510
public import Mathlib.LinearAlgebra.Dimension.RankNullity
45044511
public import Mathlib.LinearAlgebra.Dimension.StrongRankCondition
45054512
public import Mathlib.LinearAlgebra.Dimension.Subsingleton
@@ -4552,7 +4559,8 @@ public import Mathlib.LinearAlgebra.FreeModule.Norm
45524559
public import Mathlib.LinearAlgebra.FreeModule.PID
45534560
public import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition
45544561
public import Mathlib.LinearAlgebra.FreeProduct.Basic
4555-
public import Mathlib.LinearAlgebra.GeneralLinearGroup
4562+
public import Mathlib.LinearAlgebra.GeneralLinearGroup.AlgEquiv
4563+
public import Mathlib.LinearAlgebra.GeneralLinearGroup.Basic
45564564
public import Mathlib.LinearAlgebra.Goursat
45574565
public import Mathlib.LinearAlgebra.InvariantBasisNumber
45584566
public import Mathlib.LinearAlgebra.Isomorphisms
@@ -4648,6 +4656,9 @@ public import Mathlib.LinearAlgebra.PerfectPairing.Matrix
46484656
public import Mathlib.LinearAlgebra.PerfectPairing.Restrict
46494657
public import Mathlib.LinearAlgebra.Pi
46504658
public import Mathlib.LinearAlgebra.PiTensorProduct
4659+
public import Mathlib.LinearAlgebra.PiTensorProduct.DFinsupp
4660+
public import Mathlib.LinearAlgebra.PiTensorProduct.DirectSum
4661+
public import Mathlib.LinearAlgebra.PiTensorProduct.Finsupp
46514662
public import Mathlib.LinearAlgebra.Prod
46524663
public import Mathlib.LinearAlgebra.Projection
46534664
public import Mathlib.LinearAlgebra.Projectivization.Action
@@ -5877,6 +5888,7 @@ public import Mathlib.RingTheory.Finiteness.Lattice
58775888
public import Mathlib.RingTheory.Finiteness.ModuleFinitePresentation
58785889
public import Mathlib.RingTheory.Finiteness.Nakayama
58795890
public import Mathlib.RingTheory.Finiteness.Nilpotent
5891+
public import Mathlib.RingTheory.Finiteness.NilpotentKer
58805892
public import Mathlib.RingTheory.Finiteness.Prod
58815893
public import Mathlib.RingTheory.Finiteness.Projective
58825894
public import Mathlib.RingTheory.Finiteness.Quotient
@@ -6178,6 +6190,7 @@ public import Mathlib.RingTheory.PolynomialLaw.Basic
61786190
public import Mathlib.RingTheory.PowerBasis
61796191
public import Mathlib.RingTheory.PowerSeries.Basic
61806192
public import Mathlib.RingTheory.PowerSeries.Binomial
6193+
public import Mathlib.RingTheory.PowerSeries.Catalan
61816194
public import Mathlib.RingTheory.PowerSeries.CoeffMulMem
61826195
public import Mathlib.RingTheory.PowerSeries.Derivative
61836196
public import Mathlib.RingTheory.PowerSeries.Evaluation
@@ -6241,10 +6254,13 @@ public import Mathlib.RingTheory.SimpleRing.Defs
62416254
public import Mathlib.RingTheory.SimpleRing.Field
62426255
public import Mathlib.RingTheory.SimpleRing.Matrix
62436256
public import Mathlib.RingTheory.SimpleRing.Principal
6257+
public import Mathlib.RingTheory.Smooth.AdicCompletion
62446258
public import Mathlib.RingTheory.Smooth.Basic
6259+
public import Mathlib.RingTheory.Smooth.Flat
62456260
public import Mathlib.RingTheory.Smooth.Kaehler
62466261
public import Mathlib.RingTheory.Smooth.Local
62476262
public import Mathlib.RingTheory.Smooth.Locus
6263+
public import Mathlib.RingTheory.Smooth.NoetherianDescent
62486264
public import Mathlib.RingTheory.Smooth.Pi
62496265
public import Mathlib.RingTheory.Smooth.StandardSmooth
62506266
public import Mathlib.RingTheory.Smooth.StandardSmoothCotangent
@@ -7198,6 +7214,12 @@ public import Mathlib.Topology.NhdsWithin
71987214
public import Mathlib.Topology.NoetherianSpace
71997215
public import Mathlib.Topology.OmegaCompletePartialOrder
72007216
public import Mathlib.Topology.OpenPartialHomeomorph
7217+
public import Mathlib.Topology.OpenPartialHomeomorph.Basic
7218+
public import Mathlib.Topology.OpenPartialHomeomorph.Composition
7219+
public import Mathlib.Topology.OpenPartialHomeomorph.Constructions
7220+
public import Mathlib.Topology.OpenPartialHomeomorph.Continuity
7221+
public import Mathlib.Topology.OpenPartialHomeomorph.Defs
7222+
public import Mathlib.Topology.OpenPartialHomeomorph.IsImage
72017223
public import Mathlib.Topology.Order
72027224
public import Mathlib.Topology.Order.Basic
72037225
public import Mathlib.Topology.Order.Bornology

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/Algebra/Equiv.lean

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,3 +845,25 @@ of algebras provided here unless `e 1 = 1`. -/
845845
_ = x := by rw [map_smul, Algebra.smul_def, mul_left_comm, ← Algebra.smul_def _ (e 1),
846846
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, ← mul_assoc, ← Algebra.smul_def,
847847
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, one_mul]
848+
849+
namespace LinearEquiv
850+
variable {R S M₁ M₂ : Type*} [CommSemiring R] [AddCommMonoid M₁] [Module R M₁]
851+
[AddCommMonoid M₂] [Module R M₂] [Semiring S] [Module S M₁] [Module S M₂]
852+
[SMulCommClass S R M₁] [SMulCommClass S R M₂] [SMul R S] [IsScalarTower R S M₁]
853+
[IsScalarTower R S M₂]
854+
855+
variable (R) in
856+
/-- A linear equivalence of two modules induces an equivalence of algebras of their
857+
endomorphisms. -/
858+
@[simps!] def conjAlgEquiv (e : M₁ ≃ₗ[S] M₂) : Module.End S M₁ ≃ₐ[R] Module.End S M₂ where
859+
__ := e.conjRingEquiv
860+
commutes' _ := by ext; change e.restrictScalars R _ = _; simp
861+
862+
@[deprecated (since := "2025-12-06")] alias algConj := conjAlgEquiv
863+
864+
theorem conjAlgEquiv_apply (e : M₁ ≃ₗ[S] M₂) (f : Module.End S M₁) :
865+
e.conjAlgEquiv R f = e.toLinearMap ∘ₗ f ∘ₗ e.symm.toLinearMap := rfl
866+
867+
theorem symm_conjAlgEquiv (e : M₁ ≃ₗ[S] M₂) : (e.conjAlgEquiv R).symm = e.symm.conjAlgEquiv R := rfl
868+
869+
end LinearEquiv

Mathlib/Algebra/Azumaya/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ End R A ------------> End R B
7171
-/
7272
lemma mulLeftRight_comp_congr (e : A ≃ₐ[R] B) :
7373
(AlgHom.mulLeftRight R B).comp (Algebra.TensorProduct.congr e e.op).toAlgHom =
74-
(e.toLinearEquiv.algConj R).toAlgHom.comp (AlgHom.mulLeftRight R A) := by
74+
(e.toLinearEquiv.conjAlgEquiv R).toAlgHom.comp (AlgHom.mulLeftRight R A) := by
7575
ext <;> simp
7676

7777
theorem of_AlgEquiv (e : A ≃ₐ[R] B) [IsAzumaya R A] : IsAzumaya R B :=

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/Finsupp/Basic.lean

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ theorem sum_sub_index [AddGroup β] [AddCommGroup γ] {f g : α →₀ β} {h :
456456
theorem prod_embDomain [Zero M] [CommMonoid N] {v : α →₀ M} {f : α ↪ β} {g : β → M → N} :
457457
(v.embDomain f).prod g = v.prod fun a b => g (f a) b := by
458458
rw [prod, prod, support_embDomain, Finset.prod_map]
459-
simp_rw [embDomain_apply]
459+
simp_rw [embDomain_apply_self]
460460

461461
@[to_additive]
462462
theorem prod_finset_sum_index [AddCommMonoid M] [CommMonoid N] {s : Finset ι} {g : ι → α →₀ M}
@@ -584,18 +584,13 @@ At the time of writing Mathlib does not have a typeclass to express the conditio
584584
that addition on a `FunLike` type is pointwise; hence this is asserted via explicit hypotheses. -/
585585
theorem Finsupp.sum_apply'' {A F : Type*} [AddZeroClass A] [AddCommMonoid F] [FunLike F γ B]
586586
(g : ι →₀ A) (k : ι → A → F) (x : γ)
587-
(hg0 : ∀ (i : ι), k i 0 = 0) (hgadd : ∀ (i : ι) (a₁ a₂ : A), k i (a₁ + a₂) = k i a₁ + k i a₂)
588587
(h0 : (0 : F) x = 0) (hadd : ∀ (f g : F), (f + g : F) x = f x + g x) :
589588
g.sum k x = g.sum (fun i a ↦ k i a x) := by
590-
induction g using Finsupp.induction with
591-
| zero => simp [h0]
592-
| single_add i a f hf ha ih =>
593-
rw [Finsupp.sum_add_index' hg0 hgadd, Finsupp.sum_add_index', hadd, ih]
594-
· congr 1
595-
rw [Finsupp.sum_single_index (hg0 i), Finsupp.sum_single_index]
596-
simp [hg0, h0]
597-
· simp [hg0, h0]
598-
· simp [hgadd, hadd]
589+
classical
590+
unfold Finsupp.sum
591+
induction g.support using Finset.induction with
592+
| empty => simp [h0]
593+
| insert i s hi ih => simp [sum_insert hi, hadd, ih]
599594

600595
@[deprecated "use instead `sum_finset_sum_index` (with equality reversed)" (since := "2025-11-07")]
601596
theorem Finsupp.sum_sum_index' (h0 : ∀ i, t i 0 = 0) (h1 : ∀ i x y, t i (x + y) = t i x + t i y) :
@@ -632,10 +627,15 @@ end Nat
632627
namespace MulOpposite
633628
variable {ι M N : Type*} [AddCommMonoid M] [Zero N]
634629

635-
@[simp] lemma op_finsuppSum (f : ι →₀ N) (g : ι → N → M) :
630+
-- We additivise the following lemmas to themselves to avoid `to_additive` getting confused.
631+
-- TODO(Jovan): Remove the annotations once unnecessary again.
632+
633+
@[to_additive self (dont_translate := M), simp]
634+
lemma op_finsuppSum (f : ι →₀ N) (g : ι → N → M) :
636635
op (f.sum g) = f.sum fun i n ↦ op (g i n) := op_sum ..
637636

638-
@[simp] lemma unop_finsuppSum (f : ι →₀ N) (g : ι → N → Mᵐᵒᵖ) :
637+
@[to_additive self (dont_translate := M), simp]
638+
lemma unop_finsuppSum (f : ι →₀ N) (g : ι → N → Mᵐᵒᵖ) :
639639
unop (f.sum g) = f.sum fun i n ↦ unop (g i n) := unop_sum ..
640640

641641
end MulOpposite

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: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,7 @@ instance hasSMul : SMul S <| (restrictScalars f).obj (of _ S) →ₗ[R] M where
395395
{ toFun := fun s' : S => g (s' * s : S)
396396
map_add' := fun x y : S => by rw [add_mul, map_add]
397397
map_smul' := fun r (t : S) => by
398-
-- Porting note: needed some erw's even after dsimp to clean things up
399-
dsimp
400-
rw [← map_smul]
401-
erw [smul_eq_mul, smul_eq_mul, mul_assoc] }
398+
simp [← map_smul, ModuleCat.restrictScalars.smul_def (M := ModuleCat.of _ S), mul_assoc] }
402399

403400
@[simp]
404401
theorem smul_apply' (s : S) (g : (restrictScalars f).obj (of _ S) →ₗ[R] M) (s' : S) :
@@ -490,11 +487,8 @@ def HomEquiv.fromRestriction {X : ModuleCat R} {Y : ModuleCat S}
490487
{ toFun := fun s : S => g <| (s • y : Y)
491488
map_add' := fun s1 s2 : S => by simp only [add_smul]; rw [map_add]
492489
map_smul' := fun r (s : S) => by
493-
-- Porting note: dsimp clears out some rw's but less eager to apply others with Lean 4
494-
dsimp
495-
rw [← g.hom.map_smul]
496-
erw [smul_eq_mul, mul_smul]
497-
rfl }
490+
rw [ModuleCat.restrictScalars.smul_def _ (M := ModuleCat.of _ _) _ _, ← g.hom.map_smul]
491+
simp [mul_smul] }
498492
map_add' := fun y1 y2 : Y =>
499493
LinearMap.ext fun s : S => by
500494
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 =

0 commit comments

Comments
 (0)