Skip to content

Commit a49aef0

Browse files
committed
feat: the product of finitely generated monoids is finitely generated (#22932)
From Toric Co-authored-by: Patrick Luo <m3hgu5t4@gmail.com>
1 parent 99717f8 commit a49aef0

File tree

2 files changed

+48
-27
lines changed

2 files changed

+48
-27
lines changed

Mathlib/GroupTheory/Finiteness.lean

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ group.
3131

3232
open Pointwise
3333

34-
variable {M N : Type*} [Monoid M] [AddMonoid N]
34+
variable {M N : Type*} [Monoid M]
3535

3636
section Submonoid
37+
variable [Monoid N] {P : Submonoid M} {Q : Submonoid N}
3738

3839
/-- A submonoid of `M` is finitely generated if it is the closure of a finite subset of `M`. -/
3940
@[to_additive]
@@ -62,52 +63,61 @@ theorem Submonoid.fg_iff_add_fg (P : Submonoid M) : P.FG ↔ P.toAddSubmonoid.FG
6263
(Submonoid.fg_iff _).mpr
6364
⟨Additive.ofMul ⁻¹' T, by simp [← AddSubmonoid.toSubmonoid'_closure, hT], hf⟩⟩
6465

65-
theorem AddSubmonoid.fg_iff_mul_fg (P : AddSubmonoid N) : P.FG ↔ P.toSubmonoid.FG := by
66+
theorem AddSubmonoid.fg_iff_mul_fg {M : Type*} [AddMonoid M] (P : AddSubmonoid M) :
67+
P.FG ↔ P.toSubmonoid.FG := by
6668
convert (Submonoid.fg_iff_add_fg (toSubmonoid P)).symm
6769

70+
/-- The product of finitely generated submonoids is finitely generated. -/
71+
@[to_additive "The product of finitely generated submonoids is finitely generated."]
72+
lemma Submonoid.FG.prod (hP : P.FG) (hQ : Q.FG) : (P.prod Q).FG := by
73+
classical
74+
obtain ⟨bM, hbM⟩ := hP
75+
obtain ⟨bN, hbN⟩ := hQ
76+
refine ⟨bM ×ˢ singleton 1 ∪ singleton 1 ×ˢ bN, ?_⟩
77+
push_cast
78+
simp [Submonoid.closure_union, hbM, hbN]
79+
6880
end Submonoid
6981

7082
section Monoid
7183

72-
variable (M N)
73-
74-
/-- A monoid is finitely generated if it is finitely generated as a submonoid of itself. -/
75-
class Monoid.FG : Prop where
76-
out : (⊤ : Submonoid M).FG
77-
7884
/-- An additive monoid is finitely generated if it is finitely generated as an additive submonoid of
7985
itself. -/
80-
class AddMonoid.FG : Prop where
81-
out : (⊤ : AddSubmonoid N).FG
86+
@[mk_iff]
87+
class AddMonoid.FG (M : Type*) [AddMonoid M] : Prop where
88+
fg_top : (⊤ : AddSubmonoid M).FG
8289

83-
attribute [to_additive] Monoid.FG
84-
85-
variable {M N}
90+
variable (M) in
91+
/-- A monoid is finitely generated if it is finitely generated as a submonoid of itself. -/
92+
@[to_additive]
93+
class Monoid.FG : Prop where
94+
fg_top : (⊤ : Submonoid M).FG
8695

96+
@[to_additive]
8797
theorem Monoid.fg_def : Monoid.FG M ↔ (⊤ : Submonoid M).FG :=
8898
fun h => h.1, fun h => ⟨h⟩⟩
8999

90-
theorem AddMonoid.fg_def : AddMonoid.FG N ↔ (⊤ : AddSubmonoid N).FG :=
91-
fun h => h.1, fun h => ⟨h⟩⟩
92-
93100
/-- An equivalent expression of `Monoid.FG` in terms of `Set.Finite` instead of `Finset`. -/
94101
@[to_additive
95102
"An equivalent expression of `AddMonoid.FG` in terms of `Set.Finite` instead of `Finset`."]
96103
theorem Monoid.fg_iff :
97104
Monoid.FG M ↔ ∃ S : Set M, Submonoid.closure S = (⊤ : Submonoid M) ∧ S.Finite :=
98-
fun h => (Submonoid.fg_iff ⊤).1 h.out, fun h => ⟨(Submonoid.fg_iff ⊤).2 h⟩⟩
105+
fun _ => (Submonoid.fg_iff ⊤).1 FG.fg_top, fun h => ⟨(Submonoid.fg_iff ⊤).2 h⟩⟩
99106

100-
theorem Monoid.fg_iff_add_fg : Monoid.FG M ↔ AddMonoid.FG (Additive M) :=
101-
fun h => ⟨(Submonoid.fg_iff_add_fg ⊤).1 h.out⟩, fun h => ⟨(Submonoid.fg_iff_add_fg ⊤).2 h.out⟩⟩
107+
theorem Monoid.fg_iff_add_fg : Monoid.FG M ↔ AddMonoid.FG (Additive M) where
108+
mp _ := ⟨(Submonoid.fg_iff_add_fg ⊤).1 FG.fg_top⟩
109+
mpr h := ⟨(Submonoid.fg_iff_add_fg ⊤).2 h.fg_top⟩
102110

103-
theorem AddMonoid.fg_iff_mul_fg : AddMonoid.FG N ↔ Monoid.FG (Multiplicative N) :=
104-
fun h => ⟨(AddSubmonoid.fg_iff_mul_fg ⊤).1 h.out⟩, fun h =>
105-
⟨(AddSubmonoid.fg_iff_mul_fg ⊤).2 h.out⟩⟩
111+
theorem AddMonoid.fg_iff_mul_fg {M : Type*} [AddMonoid M] :
112+
AddMonoid.FG M ↔ Monoid.FG (Multiplicative M) where
113+
mp _ := ⟨(AddSubmonoid.fg_iff_mul_fg ⊤).1 FG.fg_top⟩
114+
mpr h := ⟨(AddSubmonoid.fg_iff_mul_fg ⊤).2 h.fg_top⟩
106115

107116
instance AddMonoid.fg_of_monoid_fg [Monoid.FG M] : AddMonoid.FG (Additive M) :=
108117
Monoid.fg_iff_add_fg.1 ‹_›
109118

110-
instance Monoid.fg_of_addMonoid_fg [AddMonoid.FG N] : Monoid.FG (Multiplicative N) :=
119+
instance Monoid.fg_of_addMonoid_fg {M : Type*} [AddMonoid M] [AddMonoid.FG M] :
120+
Monoid.FG (Multiplicative M) :=
111121
AddMonoid.fg_iff_mul_fg.1 ‹_›
112122

113123
@[to_additive]
@@ -139,7 +149,7 @@ theorem Submonoid.FG.map_injective {M' : Type*} [Monoid M'] {P : Submonoid M} (e
139149
@[to_additive (attr := simp)]
140150
theorem Monoid.fg_iff_submonoid_fg (N : Submonoid M) : Monoid.FG N ↔ N.FG := by
141151
conv_rhs => rw [← N.mrange_subtype, MonoidHom.mrange_eq_map]
142-
exact ⟨fun h => h.out.map N.subtype, fun h => ⟨h.map_injective N.subtype Subtype.coe_injective⟩⟩
152+
exact ⟨fun h h.fg_top.map N.subtype, fun h => ⟨h.map_injective N.subtype Subtype.coe_injective⟩⟩
143153

144154
@[to_additive]
145155
theorem Monoid.fg_of_surjective {M' : Type*} [Monoid M'] [Monoid.FG M] (f : M →* M')
@@ -227,11 +237,11 @@ section Group
227237

228238
variable (G H)
229239

230-
/-- A group is finitely generated if it is finitely generated as a submonoid of itself. -/
240+
/-- A group is finitely generated if it is finitely generated as a subgroup of itself. -/
231241
class Group.FG : Prop where
232242
out : (⊤ : Subgroup G).FG
233243

234-
/-- An additive group is finitely generated if it is finitely generated as an additive submonoid of
244+
/-- An additive group is finitely generated if it is finitely generated as an additive subgroup of
235245
itself. -/
236246
class AddGroup.FG : Prop where
237247
out : (⊤ : AddSubgroup H).FG
@@ -388,3 +398,14 @@ instance QuotientGroup.fg [Group.FG G] (N : Subgroup G) [Subgroup.Normal N] : Gr
388398
Group.fg_of_surjective <| QuotientGroup.mk'_surjective N
389399

390400
end QuotientGroup
401+
402+
namespace Prod
403+
variable [Monoid N]
404+
405+
open Monoid in
406+
/-- The product of finitely generated monoids is finitely generated. -/
407+
@[to_additive "The product of finitely generated monoids is finitely generated."]
408+
instance instMonoidFG [FG M] [FG N] : FG (M × N) where
409+
fg_top := by rw [← Submonoid.top_prod_top]; exact .prod ‹FG M›.fg_top ‹FG N›.fg_top
410+
411+
end Prod

Mathlib/RingTheory/FiniteType.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ variable (R M)
456456
type. -/
457457
instance finiteType_of_fg [CommRing R] [h : AddMonoid.FG M] :
458458
FiniteType R R[M] := by
459-
obtain ⟨S, hS⟩ := h.out
459+
obtain ⟨S, hS⟩ := h.fg_top
460460
exact (FiniteType.freeAlgebra R (S : Set M)).of_surjective
461461
(FreeAlgebra.lift R fun s : (S : Set M) => of' R M ↑s)
462462
(freeAlgebra_lift_of_surjective_of_closure hS)

0 commit comments

Comments
 (0)