Skip to content

Commit 605092f

Browse files
authored
Merge branch 'leanprover-community:master' into MvPowerSeries_Equiv_prep
2 parents 78b287c + 08fd130 commit 605092f

File tree

145 files changed

+3589
-1961
lines changed

Some content is hidden

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

145 files changed

+3589
-1961
lines changed

.github/workflows/maintainer_merge_wf_run.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ jobs:
150150
legacy_suffix=" (legacy)"
151151
fi
152152
metadata=$'['"${trigger_name}"$']('"${trigger_run_url}"$'), [wf_run]('"${wf_run_url}"$')'"${legacy_suffix}"
153-
message="${message}"$'\n\n---\n'"${metadata}"
153+
echo "${metadata}"
154+
# message="${message}"$'\n\n---\n'"${metadata}"
154155
printf 'title<<EOF\n%s\nEOF' "${message}" | tee "$GITHUB_OUTPUT"
155156
env:
156157
AUTHOR: ${{ steps.inputs.outputs.author }}
@@ -188,7 +189,8 @@ jobs:
188189
legacy_suffix=" (legacy)"
189190
fi
190191
metadata=$'['"${trigger_name}"$']('"${trigger_run_url}"$'), [wf_run]('"${wf_run_url}"$')'"${legacy_suffix}"
191-
body="${body}"$'\n\n---\n'"${metadata}"
192+
echo "${metadata}"
193+
# body="${body}"$'\n\n---\n'"${metadata}"
192194
printf 'body<<EOF\n%s\nEOF\n' "${body}" | tee -a "$GITHUB_OUTPUT"
193195
194196
- name: Add comment to PR

Counterexamples/Phillips.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,9 @@ theorem sierpinski_pathological_family (Hcont : #ℝ = ℵ₁) :
474474
· simp only [h, iff_true, or_true]; exact asymm h
475475
rw [this]
476476
apply Countable.union _ (countable_singleton _)
477-
rw [Cardinal.countable_iff_lt_aleph_one, ← Hcont]
477+
rw [Cardinal.le_aleph0_iff_set_countable, ← Cardinal.lt_aleph_one_iff, ← Hcont]
478478
exact Cardinal.card_typein_lt x H
479-
· rw [Cardinal.countable_iff_lt_aleph_one, ← Hcont]
479+
· rw [Cardinal.le_aleph0_iff_set_countable, ← Cardinal.lt_aleph_one_iff, ← Hcont]
480480
exact Cardinal.card_typein_lt y H
481481

482482
/-- A family of sets in `ℝ` which only miss countably many points, but such that any point is

Mathlib.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,7 @@ public import Mathlib.Analysis.Normed.Order.Lattice
21552155
public import Mathlib.Analysis.Normed.Order.UpperLower
21562156
public import Mathlib.Analysis.Normed.Ring.Basic
21572157
public import Mathlib.Analysis.Normed.Ring.Finite
2158+
public import Mathlib.Analysis.Normed.Ring.InfiniteProd
21582159
public import Mathlib.Analysis.Normed.Ring.InfiniteSum
21592160
public import Mathlib.Analysis.Normed.Ring.Int
21602161
public import Mathlib.Analysis.Normed.Ring.Lemmas
@@ -3314,6 +3315,7 @@ public import Mathlib.CategoryTheory.Subfunctor.Sieves
33143315
public import Mathlib.CategoryTheory.Subfunctor.Subobject
33153316
public import Mathlib.CategoryTheory.Subobject.ArtinianObject
33163317
public import Mathlib.CategoryTheory.Subobject.Basic
3318+
public import Mathlib.CategoryTheory.Subobject.Classifier.Defs
33173319
public import Mathlib.CategoryTheory.Subobject.Comma
33183320
public import Mathlib.CategoryTheory.Subobject.FactorThru
33193321
public import Mathlib.CategoryTheory.Subobject.HasCardinalLT
@@ -3336,7 +3338,6 @@ public import Mathlib.CategoryTheory.Sums.Associator
33363338
public import Mathlib.CategoryTheory.Sums.Basic
33373339
public import Mathlib.CategoryTheory.Sums.Products
33383340
public import Mathlib.CategoryTheory.Thin
3339-
public import Mathlib.CategoryTheory.Topos.Classifier
33403341
public import Mathlib.CategoryTheory.Topos.Sheaf
33413342
public import Mathlib.CategoryTheory.Triangulated.Adjunction
33423343
public import Mathlib.CategoryTheory.Triangulated.Basic
@@ -5576,6 +5577,7 @@ public import Mathlib.NumberTheory.ModularForms.Cusps
55765577
public import Mathlib.NumberTheory.ModularForms.DedekindEta
55775578
public import Mathlib.NumberTheory.ModularForms.Delta
55785579
public import Mathlib.NumberTheory.ModularForms.Derivative
5580+
public import Mathlib.NumberTheory.ModularForms.Discriminant
55795581
public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Basic
55805582
public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs
55815583
public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.E2.Defs
@@ -7298,8 +7300,10 @@ public import Mathlib.Topology.Algebra.Module.PerfectPairing
72987300
public import Mathlib.Topology.Algebra.Module.PerfectSpace
72997301
public import Mathlib.Topology.Algebra.Module.PointwiseConvergence
73007302
public import Mathlib.Topology.Algebra.Module.Simple
7303+
public import Mathlib.Topology.Algebra.Module.Spaces.CompactConvergenceCLM
7304+
public import Mathlib.Topology.Algebra.Module.Spaces.ContinuousLinearMap
7305+
public import Mathlib.Topology.Algebra.Module.Spaces.UniformConvergenceCLM
73017306
public import Mathlib.Topology.Algebra.Module.Star
7302-
public import Mathlib.Topology.Algebra.Module.StrongTopology
73037307
public import Mathlib.Topology.Algebra.Module.TopDualPairing
73047308
public import Mathlib.Topology.Algebra.Module.TransferInstance
73057309
public import Mathlib.Topology.Algebra.Module.UniformConvergence

Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,26 +1184,46 @@ lemma commute_of_mem_adjoin_self {a b : A} (hb : b ∈ adjoin R {a}) :
11841184
Commute a b :=
11851185
commute_of_mem_adjoin_singleton_of_commute hb rfl
11861186

1187+
variable (R) in
1188+
/-- If all elements of `s : Set A` commute pairwise, then `adjoin R s` is commutative. -/
1189+
theorem isMulCommutative_adjoin {s : Set A} (hcomm : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x) :
1190+
IsMulCommutative (adjoin R s) :=
1191+
have := adjoin_le_centralizer_centralizer R s
1192+
.of_setLike_mul_comm fun _ h₁ _ h₂ ↦
1193+
Set.centralizer_centralizer_comm_of_comm hcomm _ (this h₁) _ (this h₂)
1194+
1195+
variable (R) in
1196+
instance isMulCommutative_adjoin_singleton (x : A) :
1197+
IsMulCommutative (adjoin R ({x} : Set A)) :=
1198+
isMulCommutative_adjoin R (by simp)
1199+
1200+
open scoped IsMulCommutative in
11871201
variable (R) in
11881202
/-- If all elements of `s : Set A` commute pairwise, then `adjoin R s` is a non-unital commutative
11891203
semiring.
11901204
11911205
See note [reducible non-instances]. -/
1206+
@[deprecated isMulCommutative_adjoin (since := "2026-03-11")]
11921207
abbrev adjoinNonUnitalCommSemiringOfComm {s : Set A} (hcomm : ∀ a ∈ s, ∀ b ∈ s, a * b = b * a) :
11931208
NonUnitalCommSemiring (adjoin R s) :=
1194-
{ (adjoin R s).toNonUnitalSemiring with
1195-
mul_comm := fun ⟨_, h₁⟩ ⟨_, h₂⟩ ↦
1196-
have := adjoin_le_centralizer_centralizer R s
1197-
Subtype.ext <| Set.centralizer_centralizer_comm_of_comm hcomm _ (this h₁) _ (this h₂) }
1209+
have := isMulCommutative_adjoin R hcomm
1210+
inferInstance
1211+
1212+
instance instIsMulCommutative_adjoin {S : Type*} [SetLike S A] [MulMemClass S A] (s : S)
1213+
[IsMulCommutative s] : IsMulCommutative (adjoin R (s : Set A)) :=
1214+
isMulCommutative_adjoin R fun _ h₁ _ h₂ => setLike_mul_comm h₁ h₂
11981215

1216+
open scoped IsMulCommutative in
11991217
/-- If all elements of `s : Set A` commute pairwise, then `adjoin R s` is a non-unital commutative
12001218
ring.
12011219
12021220
See note [reducible non-instances]. -/
1221+
@[deprecated isMulCommutative_adjoin (since := "2026-03-11")]
12031222
abbrev adjoinNonUnitalCommRingOfComm (R : Type*) {A : Type*} [CommRing R] [NonUnitalRing A]
12041223
[Module R A] [IsScalarTower R A A] [SMulCommClass R A A] {s : Set A}
12051224
(hcomm : ∀ a ∈ s, ∀ b ∈ s, a * b = b * a) : NonUnitalCommRing (adjoin R s) :=
1206-
{ (adjoin R s).toNonUnitalRing, adjoinNonUnitalCommSemiringOfComm R hcomm with }
1225+
have := isMulCommutative_adjoin R hcomm
1226+
inferInstance
12071227

12081228
end NonUnitalAlgebra
12091229

Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,13 +731,31 @@ lemma adjoin_le_centralizer_centralizer (s : Set A) :
731731
adjoin R s ≤ Subalgebra.centralizer R (Subalgebra.centralizer R s) :=
732732
adjoin_le Set.subset_centralizer_centralizer
733733

734-
/-- If all elements of `s : Set A` commute pairwise, then `adjoin s` is a commutative semiring. -/
734+
/-- If all elements of `s : Set A` commute pairwise, then `adjoin R s` is commutative. -/
735+
theorem isMulCommutative_adjoin {s : Set A} (hcomm : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x) :
736+
IsMulCommutative (adjoin R s) :=
737+
have := adjoin_le_centralizer_centralizer R s
738+
.of_setLike_mul_comm fun _ h₁ _ h₂ ↦
739+
Set.centralizer_centralizer_comm_of_comm hcomm _ (this h₁) _ (this h₂)
740+
741+
instance isMulCommutative_adjoin_singleton (x : A) :
742+
IsMulCommutative (adjoin R ({x} : Set A)) :=
743+
isMulCommutative_adjoin R (by simp)
744+
745+
open scoped IsMulCommutative in
746+
/-- If all elements of `s : Set A` commute pairwise, then `adjoin R s` is a non-unital commutative
747+
semiring.
748+
749+
See note [reducible non-instances]. -/
750+
@[deprecated isMulCommutative_adjoin (since := "2026-03-11")]
735751
abbrev adjoinCommSemiringOfComm {s : Set A} (hcomm : ∀ a ∈ s, ∀ b ∈ s, a * b = b * a) :
736752
CommSemiring (adjoin R s) :=
737-
{ (adjoin R s).toSemiring with
738-
mul_comm := fun ⟨_, h₁⟩ ⟨_, h₂⟩ ↦
739-
have := adjoin_le_centralizer_centralizer R s
740-
Subtype.ext <| Set.centralizer_centralizer_comm_of_comm hcomm _ (this h₁) _ (this h₂) }
753+
have := isMulCommutative_adjoin R hcomm
754+
inferInstance
755+
756+
instance instIsMulCommutative_adjoin {S : Type*} [SetLike S A] [MulMemClass S A] (s : S)
757+
[IsMulCommutative s] : IsMulCommutative (adjoin R (s : Set A)) :=
758+
isMulCommutative_adjoin R fun _ h₁ _ h₂ => setLike_mul_comm h₁ h₂
741759

742760
variable {R}
743761

@@ -806,11 +824,15 @@ theorem mem_adjoin_iff {s : Set A} {x : A} :
806824

807825
variable (R)
808826

827+
set_option backward.isDefEq.respectTransparency false in
828+
open scoped IsMulCommutative in
809829
/-- If all elements of `s : Set A` commute pairwise, then `adjoin R s` is a commutative
810830
ring. -/
831+
@[deprecated isMulCommutative_adjoin (since := "2026-03-11")]
811832
abbrev adjoinCommRingOfComm {s : Set A} (hcomm : ∀ a ∈ s, ∀ b ∈ s, a * b = b * a) :
812833
CommRing (adjoin R s) :=
813-
{ (adjoin R s).toRing, adjoinCommSemiringOfComm R hcomm with }
834+
have := isMulCommutative_adjoin R hcomm
835+
inferInstance
814836

815837
end Ring
816838

Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def pushforwardPushforwardAdj : pushforward.{v} φ ⊣ pushforward.{v} ψ where
230230
ext U x
231231
change (X.val.presheaf.map (adj.counit.app (F.obj U.unop)).op ≫
232232
X.val.presheaf.map (F.map (adj.unit.app U.unop)).op) _ = _
233+
dsimp only [id_obj]
233234
rw [← Functor.map_comp, ← op_comp, adj.left_triangle_components]
234235
simp
235236
right_triangle_components X := by

Mathlib/Algebra/Group/Defs.lean

Lines changed: 118 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,15 +1285,128 @@ class IsMulCommutative (M : Type*) [Mul M] : Prop where
12851285
is_comm : Std.Commutative (α := M) (· * ·)
12861286

12871287
@[to_additive]
1288-
instance (priority := 100) CommMonoid.ofIsMulCommutative {M : Type*} [Monoid M]
1289-
[IsMulCommutative M] :
1290-
CommMonoid M where
1291-
mul_comm := IsMulCommutative.is_comm.comm
1288+
lemma isMulCommutative_iff {M : Type*} [Mul M] :
1289+
IsMulCommutative M ↔ ∀ a b : M, a * b = b * a := by
1290+
grind [IsMulCommutative, Std.Commutative]
12921291

12931292
@[to_additive]
1294-
instance (priority := 100) CommGroup.ofIsMulCommutative {G : Type*} [Group G] [IsMulCommutative G] :
1293+
alias ⟨_, IsMulCommutative.of_comm⟩ := isMulCommutative_iff
1294+
1295+
/-- An alternative to `mul_comm` which uses the mixin `IsMulCommutative` instead of bundled
1296+
commutative algebraic structures. In general, you should prefer `mul_comm` unless you are working
1297+
with commutative subobjects in a noncommutative algebraic structure. -/
1298+
@[to_additive
1299+
/-- An alternative to `add_comm` which uses the mixin `IsAddCommutative` instead of bundled
1300+
commutative algebraic structures. In general, you should prefer `add_comm` unless you are working
1301+
with commutative subobjects in a noncommutative algebraic structure. -/ ]
1302+
lemma mul_comm' {M : Type*} [Mul M] [IsMulCommutative M] (a b : M) : a * b = b * a :=
1303+
IsMulCommutative.is_comm.comm ..
1304+
1305+
namespace IsMulCommutative
1306+
1307+
/-- A magma which `IsMulCommutative` is a `CommMagma`.
1308+
1309+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1310+
subobjects in a noncommutative ambient type. As such this is only available inside the
1311+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1312+
commutativity.
1313+
1314+
See note [commutative subobjects]. -/
1315+
@[to_additive
1316+
/-- An additive magma which `IsMulCommutative` is a `AddCommMagma`.
1317+
1318+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1319+
subobjects in a noncommutative ambient type. As such this is only available inside the
1320+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1321+
commutativity.
1322+
1323+
See note [commutative subobjects]. -/ ]
1324+
scoped instance (priority := 50) {M : Type*} [Mul M] [IsMulCommutative M] :
1325+
CommMagma M where
1326+
mul_comm := IsMulCommutative.is_comm.comm
1327+
1328+
/-- A `Semigroup` which `IsMulCommutative` is a `CommSemigroup`.
1329+
1330+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1331+
subobjects in a noncommutative ambient type. As such this is only available inside the
1332+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1333+
commutativity.
1334+
1335+
See note [commutative subobjects]. -/
1336+
@[to_additive
1337+
/-- An `AddSemigroup` which `IsMulCommutative` is a `AddCommSemigroup`.
1338+
1339+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1340+
subobjects in a noncommutative ambient type. As such this is only available inside the
1341+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1342+
commutativity.
1343+
1344+
See note [commutative subobjects]. -/ ]
1345+
scoped instance (priority := 50) {M : Type*} [Semigroup M] [IsMulCommutative M] :
1346+
CommSemigroup M where
1347+
1348+
/-- A `Monoid` which `IsMulCommutative` is a `CommMonoid`.
1349+
1350+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1351+
subobjects in a noncommutative ambient type. As such this is only available inside the
1352+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1353+
commutativity.
1354+
1355+
See note [commutative subobjects]. -/
1356+
@[to_additive
1357+
/-- A `AddMonoid` which `IsMulCommutative` is a `AddCommMonoid`.
1358+
1359+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1360+
subobjects in a noncommutative ambient type. As such this is only available inside the
1361+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1362+
commutativity.
1363+
1364+
See note [commutative subobjects]. -/ ]
1365+
scoped instance (priority := 50) {M : Type*} [Monoid M] [IsMulCommutative M] :
1366+
CommMonoid M where
1367+
1368+
/-- A `DivisionMonoid` which `IsMulCommutative` is a `DivisionCommMonoid`.
1369+
1370+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1371+
subobjects in a noncommutative ambient type. As such this is only available inside the
1372+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1373+
commutativity.
1374+
1375+
See note [commutative subobjects]. -/
1376+
@[to_additive
1377+
/-- A `SubtractionMonoid` which `IsMulCommutative` is a `SubtractionCommMonoid`.
1378+
1379+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1380+
subobjects in a noncommutative ambient type. As such this is only available inside the
1381+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1382+
commutativity.
1383+
1384+
See note [commutative subobjects]. -/ ]
1385+
scoped instance (priority := 50) {M : Type*} [DivisionMonoid M] [IsMulCommutative M] :
1386+
DivisionCommMonoid M where
1387+
1388+
/-- A `Group` which `IsMulCommutative` is a `CommGroup`.
1389+
1390+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1391+
subobjects in a noncommutative ambient type. As such this is only available inside the
1392+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1393+
commutativity.
1394+
1395+
See note [commutative subobjects]. -/
1396+
@[to_additive
1397+
/-- An `AddGroup` which `IsMulCommutative` is a `AddCommGroup`.
1398+
1399+
This is primarily used to deduce the bundled version from the unbundled one for commutative
1400+
subobjects in a noncommutative ambient type. As such this is only available inside the
1401+
`IsMulCommutative` scope so as to avoid deleterious effects to type class synthesis for bundled
1402+
commutativity.
1403+
1404+
See note [commutative subobjects]. -/ ]
1405+
scoped instance (priority := 50) {G : Type*} [Group G] [IsMulCommutative G] :
12951406
CommGroup G where
12961407

1408+
end IsMulCommutative
1409+
12971410
end IsCommutative
12981411

12991412
/-! We initialize all projections for `@[simps]` here, so that we don't have to do it in later

Mathlib/Algebra/Group/Subgroup/Defs.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,10 @@ instance commGroup_isMulCommutative {G : Type*} [CommGroup G] (H : Subgroup G) :
702702
IsMulCommutative H :=
703703
⟨CommMagma.to_isCommutative⟩
704704

705-
@[to_additive]
705+
@[to_additive (attr := deprecated setLike_mul_comm (since := "2026-03-09"))]
706706
lemma mul_comm_of_mem_isMulCommutative [IsMulCommutative H] {a b : G} (ha : a ∈ H) (hb : b ∈ H) :
707-
a * b = b * a := by
708-
simpa only [MulMemClass.mk_mul_mk, Subtype.mk.injEq] using mul_comm (⟨a, ha⟩ : H) (⟨b, hb⟩ : H)
707+
a * b = b * a :=
708+
setLike_mul_comm ha hb
709709

710710
end Subgroup
711711

Mathlib/Algebra/Group/Subgroup/Map.lean

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -373,21 +373,16 @@ theorem subgroupOf_eq_top {H K : Subgroup G} : H.subgroupOf K = ⊤ ↔ K ≤ H
373373
variable (H : Subgroup G)
374374

375375
@[to_additive]
376-
instance map_isMulCommutative (f : G →* G') [IsMulCommutative H] : IsMulCommutative (H.map f) :=
377-
⟨⟨by
378-
rintro ⟨-, a, ha, rfl⟩ ⟨-, b, hb, rfl⟩
379-
rw [Subtype.ext_iff, coe_mul, coe_mul, Subtype.coe_mk, Subtype.coe_mk, ← map_mul, ← map_mul]
380-
exact congr_arg f (Subtype.ext_iff.mp (mul_comm (⟨a, ha⟩ : H) ⟨b, hb⟩))⟩⟩
376+
instance map_isMulCommutative (f : G →* G') [IsMulCommutative H] : IsMulCommutative (H.map f) := by
377+
refine .of_setLike_mul_comm ?_
378+
rintro - ⟨a, ha, rfl⟩ - ⟨b, hb, rfl⟩
379+
simpa [map_mul] using congr(f $(setLike_mul_comm ha hb))
381380

382381
@[to_additive]
383382
theorem comap_injective_isMulCommutative {f : G' →* G} (hf : Injective f) [IsMulCommutative H] :
384383
IsMulCommutative (H.comap f) :=
385-
⟨⟨fun a b =>
386-
Subtype.ext
387-
(by
388-
have := mul_comm (⟨f a, a.2⟩ : H) (⟨f b, b.2⟩ : H)
389-
rwa [Subtype.ext_iff, coe_mul, coe_mul, coe_mk, coe_mk, ← map_mul, ← map_mul,
390-
hf.eq_iff] at this)⟩⟩
384+
.of_setLike_mul_comm fun a (ha : f a ∈ H) b (hb : f b ∈ H) ↦ hf <| by
385+
simpa using setLike_mul_comm ha hb
391386

392387
@[to_additive]
393388
instance subgroupOf_isMulCommutative [IsMulCommutative H] : IsMulCommutative (H.subgroupOf K) :=

Mathlib/Algebra/Group/Subsemigroup/Defs.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,18 @@ theorem coe_subtype : (MulMemClass.subtype S' : S' → M) = Subtype.val :=
331331
rfl
332332

333333
end MulMemClass
334+
335+
@[to_additive]
336+
lemma isMulCommutative_iff_of_setLike {S M : Type*} [SetLike S M] [Mul M] [MulMemClass S M]
337+
{s : S} : IsMulCommutative s ↔ ∀ a ∈ s, ∀ b ∈ s, a * b = b * a := by
338+
simp [isMulCommutative_iff]
339+
340+
@[to_additive]
341+
alias ⟨_, IsMulCommutative.of_setLike_mul_comm⟩ := isMulCommutative_iff_of_setLike
342+
343+
/-- Commutativity of multiplication in commutative subobjects. -/
344+
@[to_additive /-- Commutativity of addition in commutative subobjects. -/ ]
345+
lemma setLike_mul_comm {S M : Type*} [SetLike S M] [Mul M] [MulMemClass S M]
346+
{s : S} [IsMulCommutative s] ⦃a b : M⦄ (ha : a ∈ s) (hb : b ∈ s) :
347+
a * b = b * a :=
348+
isMulCommutative_iff_of_setLike.mp ‹_› a ha b hb

0 commit comments

Comments
 (0)