Skip to content

Commit db4bc62

Browse files
feat(FinitelyPresentedGroup): Additivize everything and add ℤ instance (#38311)
We add `to_additive` annotations to the FinitelyPresentedGroup.lean API and show that it works with the `AddGroup.IsFinitelyPresented ℤ` as a test example. Co-pilot and Gemini 3.1 Pro were used to assist in these changes.
1 parent 6643e97 commit db4bc62

2 files changed

Lines changed: 28 additions & 7 deletions

File tree

Mathlib/Algebra/Group/Subgroup/Basic.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ instance (priority := 100) normal_subgroupOf {H N : Subgroup G} [N.Normal] :
846846
(N.subgroupOf H).Normal :=
847847
Subgroup.normal_comap _
848848

849+
@[to_additive]
849850
theorem map_normalClosure (s : Set G) (f : G →* N) (hf : Surjective f) :
850851
(normalClosure s).map f = normalClosure (f '' s) := by
851852
have : Normal (map f (normalClosure s)) := Normal.map inferInstance f hf
@@ -854,6 +855,7 @@ theorem map_normalClosure (s : Set G) (f : G →* N) (hf : Surjective f) :
854855
← Set.image_subset_iff, subset_normalClosure]
855856
· exact normalClosure_le_normal (Set.image_mono subset_normalClosure)
856857

858+
@[to_additive]
857859
theorem comap_normalClosure (s : Set N) (f : G ≃* N) :
858860
normalClosure (f ⁻¹' s) = (normalClosure s).comap f := by
859861
have := f.toEquiv.image_symm_eq_preimage s

Mathlib/GroupTheory/FinitelyPresentedGroup.lean

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,51 +33,70 @@ finitely presented group, finitely generated normal closure
3333

3434
variable {G H α β : Type*} [Group G] [Group H]
3535

36-
/--
37-
`IsNormalClosureFG N` says that the subgroup `N` is the normal closure of a finitely-generated
38-
subgroup.
39-
-/
36+
/-- `IsNormalClosureFG N` says that the subgroup `N` is the normal closure of a finitely-generated
37+
subgroup. -/
38+
@[to_additive /-- `IsNormalClosureFG N` says that the additive subgroup `N` is the normal closure
39+
of an additive finitely-generated subgroup. -/]
4040
def Subgroup.IsNormalClosureFG (N : Subgroup G) : Prop :=
4141
∃ S : Set G, S.Finite ∧ Subgroup.normalClosure S = N
4242

4343
namespace Subgroup.IsNormalClosureFG
4444

4545
/-- Being the normal closure of a finite set is invariant under surjective homomorphism. -/
46+
@[to_additive /-- Being the additive normal closure of a finite set is invariant under
47+
surjective homomorphism. -/]
4648
protected theorem map {N : Subgroup G} (hN : IsNormalClosureFG N)
4749
{f : G →* H} (hf : Function.Surjective f) : (N.map f).IsNormalClosureFG := by
4850
obtain ⟨S, hSfinite, hSclosure⟩ := hN
4951
refine ⟨f '' S, hSfinite.image _, ?_⟩
5052
rw [← hSclosure, Subgroup.map_normalClosure _ _ hf]
5153

5254
/-- The trivial group is the normal closure of a finite set of relations. -/
55+
@[to_additive /-- The trivial additive group is the normal closure of a finite set of relations. -/]
5356
protected theorem bot : IsNormalClosureFG (⊥ : Subgroup G) :=
5457
⟨∅, Finite.of_subsingleton, normalClosure_empty⟩
5558

5659
end Subgroup.IsNormalClosureFG
5760

61+
/-- An additive group is finitely presented if it has a finite generating set such that the kernel
62+
of the induced map from the free additive group on that set is the normal closure
63+
of finitely many relations. -/
64+
class AddGroup.IsFinitelyPresented (G : Type*) [AddGroup G] : Prop where
65+
out : ∃ (n : ℕ) (φ : FreeAddGroup (Fin n) →+ G), Function.Surjective φ ∧ φ.ker.IsNormalClosureFG
66+
5867
/-- A group is finitely presented if it has a finite generating set such that the kernel
5968
of the induced map from the free group on that set is the normal closure of finitely many
6069
relations. -/
61-
@[mk_iff]
70+
@[mk_iff, to_additive existing]
6271
class Group.IsFinitelyPresented (G : Type*) [Group G] : Prop where
6372
out : ∃ (n : ℕ) (φ : FreeGroup (Fin n) →* G), Function.Surjective φ ∧ φ.ker.IsNormalClosureFG
6473

6574
namespace Group.IsFinitelyPresented
6675

6776
/-- Finitely presented groups are closed under isomorphism. -/
77+
@[to_additive /-- Finitely presented additive groups are closed under additive isomorphism. -/
78+
]
6879
theorem equiv (iso : G ≃* H) (h : IsFinitelyPresented G) : IsFinitelyPresented H := by
6980
obtain ⟨n, φ, hφsurj, hNC⟩ := h
7081
refine ⟨n, (iso : G →* H).comp φ, iso.surjective.comp hφsurj, ?_⟩
7182
rwa [MonoidHom.ker_mulEquiv_comp φ iso]
7283

73-
/-- A free group (with a finite number of generators) is finitely presented. -/
74-
instance [Finite α] : Group.IsFinitelyPresented (FreeGroup α) := by
84+
/-- A free group with a finite number of generators is finitely presented. -/
85+
@[to_additive /-- A free additive group with a finite number of generators is finitely presented. -/
86+
]
87+
instance [Finite α] : IsFinitelyPresented (FreeGroup α) := by
7588
have ⟨n, _, f, hf_surj, hf_inj⟩ := Finite.exists_equiv_fin α
7689
refine ⟨n, FreeGroup.map f, FreeGroup.map_surjective hf_surj.surjective, ?_⟩
7790
· rw [(FreeGroup.map f).ker_eq_bot_iff.mpr (FreeGroup.map_injective hf_inj.injective)]
7891
exact Subgroup.IsNormalClosureFG.bot
7992

93+
/-- `Multiplicative ℤ` is finitely presented. -/
8094
instance : IsFinitelyPresented (Multiplicative ℤ) :=
8195
equiv (FreeGroup.mulEquivIntOfUnique : FreeGroup Unit ≃* Multiplicative ℤ) inferInstance
8296

97+
/-- ℤ is finitely presented -/
98+
instance : AddGroup.IsFinitelyPresented ℤ :=
99+
AddGroup.IsFinitelyPresented.equiv
100+
(FreeAddGroup.addEquivIntOfUnique : FreeAddGroup Unit ≃+ ℤ) inferInstance
101+
83102
end Group.IsFinitelyPresented

0 commit comments

Comments
 (0)