-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(Group Theory/Presentation): define group presentations #41936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
homeowmorphism
wants to merge
24
commits into
leanprover-community:master
Choose a base branch
from
homeowmorphism:Group.Presentation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b48a9df
add presentation as structure
homeowmorphism 9dc97a8
changed definition
homeowmorphism fc6363e
removed abundant docstrings and converted dosctring-less theorems int…
homeowmorphism a180169
transport `rw`, quantify over `Set` for `Group.FG` bridge
homeowmorphism 5a49e3f
doc: polish Group.Presentation docstrings, make presentedGroupEquiv_o…
homeowmorphism 6eb8cdb
change `Presentation` def to `rel: Set`
homeowmorphism a9c9b3c
changed `Group.FG` iff to `Fin n`
homeowmorphism 07f73f4
edited docstrings + quantifier for `isFinitelyPresented` and `isFinit…
homeowmorphism 03127dc
first commit
homeowmorphism 5d03604
fix docstrings
homeowmorphism 350aa6e
i would not trust an LLM with "never"
homeowmorphism 9db2274
rewrite implementation docstrings
homeowmorphism 9d87611
Merge branch 'master' into Group.Generators
homeowmorphism 9f2cacf
add presentation as structure
homeowmorphism 99322ea
changed definition
homeowmorphism 7de8123
removed abundant docstrings and converted dosctring-less theorems int…
homeowmorphism d0c9664
transport `rw`, quantify over `Set` for `Group.FG` bridge
homeowmorphism 4f7bf61
doc: polish Group.Presentation docstrings, make presentedGroupEquiv_o…
homeowmorphism 6107696
change `Presentation` def to `rel: Set`
homeowmorphism f74d4a4
changed `Group.FG` iff to `Fin n`
homeowmorphism 19b11c6
edited docstrings + quantifier for `isFinitelyPresented` and `isFinit…
homeowmorphism b065821
Refactor `Group.Generators`
homeowmorphism e81ec6c
Merge branch 'Group.Presentation' of github.com:homeowmorphism/mathli…
homeowmorphism de415c5
remove design-report scratch files
homeowmorphism File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,199 @@ | ||
| /- | ||
| Copyright (c) 2026 Hang Lu Su, Valerio Proietti. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Hang Lu Su, Valerio Proietti | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.GroupTheory.FinitelyPresentedGroup | ||
|
|
||
| /-! | ||
| # Group presentations as data | ||
|
|
||
| `Group.Presentation` packages a chosen presentation of a given group `G`: | ||
| a generating family together with relators (words `r`, each read as `r = 1`) whose | ||
| generated normal subgroup is exactly the kernel of `FreeGroup.lift val : FreeGroup α →* G`. | ||
| This the complementary to `PresentedGroup rels`, which constructs the group presented by a set of | ||
| generators and relations. | ||
|
|
||
| ## Main definitions | ||
|
|
||
| * `Group.Generators G α`: a family `val : α → G`, indexed by `α`, with `FreeGroup.lift val` | ||
| surjective. | ||
| * `Group.Presentation G α ρ`: a presentation `⟨α | rel⟩` of `G`, extending `Group.Generators G α` | ||
|
|
||
| ## Main results | ||
|
|
||
| * `Group.Generators.fg` and `Group.fg_iff_nonempty_finite_generators`: a finite generating family | ||
| witnesses `Group.FG`, and conversely. | ||
| * `Group.Presentation.isFinitelyPresented` and | ||
| `Group.isFinitelyPresented_iff_nonempty_finite_presentation`: a finite presentation witnesses | ||
| `Group.IsFinitelyPresented`, and conversely. | ||
|
|
||
| ## Design notes | ||
|
|
||
| * Finiteness is expressed by instance arguments rather than bundled fields: a generating family is | ||
| finite when `[Finite α]`, a presentation when `[Finite α] [Finite ρ]`. | ||
| * This file is multiplicative only: `PresentedGroup` has no additive counterpart and there is no | ||
| `to_additive`-generated `AddGroup.Presentation` so far. | ||
|
|
||
| ## References | ||
|
|
||
| * [D. F. Holt, S. Rees, C. E. Röver, *Groups, Languages and Automata*][HoltReesRover2017], §1 | ||
|
|
||
| ## Tags | ||
|
|
||
| group presentation, generators and relations | ||
| -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| variable {G α ρ : Type*} [Group G] | ||
|
|
||
| /-- The generators of a group are given by a generating family indexed by `α` such that the induced | ||
| homomorphism `FreeGroup.lift val : FreeGroup α →* G` is surjective. -/ | ||
| structure Group.Generators (G : Type*) [Group G] (α : Type*) where | ||
| /-- Identify the generating family `α` with elements of `G` via index set `val`. -/ | ||
| val : α → G | ||
| /-- The induced map from the free group over the identified elements of `G` via `val`, | ||
| `FreeGroup.lift val` is surjective onto `G`. -/ | ||
| lift_surjective : Function.Surjective (FreeGroup.lift val) | ||
|
|
||
| namespace Group.Generators | ||
|
|
||
| variable (P : Group.Generators G α) | ||
|
|
||
| /-- The generators of a group generate the whole group under subgroup closure. -/ | ||
| theorem closure_range_val_eq_top : Subgroup.closure (Set.range P.val) = ⊤ := by | ||
| rw [← FreeGroup.range_lift_eq_closure, MonoidHom.range_eq_top] | ||
| exact P.lift_surjective | ||
|
|
||
| /-- Builds a generating set using the index set `val` and a hypothesis that the subgroup closure is | ||
| the whole group. -/ | ||
| def ofClosureEqTop (val : α → G) (h : Subgroup.closure (Set.range val) = ⊤) : | ||
| Group.Generators G α where | ||
| val := val | ||
| lift_surjective := by rw [← MonoidHom.range_eq_top, FreeGroup.range_lift_eq_closure]; exact h | ||
|
|
||
| /-- The index set built by the generating set `ofClosureEqTop` using `val` is itself. -/ | ||
| @[simp] | ||
| theorem val_ofClosureEqTop (val : α → G) (h : Subgroup.closure (Set.range val) = ⊤) : | ||
| (ofClosureEqTop val h).val = val := rfl | ||
|
|
||
| /-- `G` as a generating set generates itself via taking `val` as the identity map. -/ | ||
| def self (G : Type*) [Group G] : Group.Generators G G := | ||
| ofClosureEqTop id (by rw [Set.range_id]; exact Subgroup.closure_univ) | ||
|
homeowmorphism marked this conversation as resolved.
Outdated
|
||
|
|
||
| /-- The index set `val` given by taking `G` as the generating family for `G` is given by | ||
| the identity map. -/ | ||
| @[simp] | ||
| theorem val_self : (self G).val = id := rfl | ||
|
|
||
| /-- If G is generated by a finite generating set `α`, then `G` is finitely generated. -/ | ||
| theorem fg [Finite α] (P : Group.Generators G α) : Group.FG G := | ||
| Group.fg_of_surjective P.lift_surjective | ||
|
|
||
| end Group.Generators | ||
|
|
||
| /-- A group is finitely generated if and only if it admits a finite generating set. -/ | ||
| theorem Group.fg_iff_nonempty_finite_generators : | ||
| Group.FG G ↔ ∃ (α : Type) (_ : Finite α), Nonempty (Group.Generators G α) := by | ||
|
homeowmorphism marked this conversation as resolved.
Outdated
|
||
| rw [Group.fg_iff_exists_freeGroup_hom_surjective_finite] | ||
| constructor | ||
| · rintro ⟨α, hα, φ, hφ⟩ | ||
| obtain ⟨v, rfl⟩ := FreeGroup.lift.surjective φ | ||
| exact ⟨α, hα, ⟨v, hφ⟩⟩ | ||
| · rintro ⟨α, hα, ⟨P⟩⟩ | ||
| exact ⟨α, hα, FreeGroup.lift P.val, P.lift_surjective⟩ | ||
|
|
||
| /-- A group presentation is given by a generating family (`val : α → G`) | ||
| and a family of relators (`rel : ρ → FreeGroup α`) such that the kernel of the free group over | ||
| the generators `FreeGroup.lift val` is given by the normal closure of the relations. -/ | ||
| structure Group.Presentation (G : Type*) [Group G] (α ρ : Type*) | ||
| extends Group.Generators G α where | ||
| /-- The family of relators, as words in the free group; each `rel r` is read as `rel r = 1` | ||
| in the sense that it is meant to map to the kernel in `G`. -/ | ||
| rel : ρ → FreeGroup α | ||
| /-- The relators are exactly the defining relations: the normal subgroup they generate is the | ||
| full kernel of `FreeGroup.lift val`, so no relation holds in `G` beyond their consequences. -/ | ||
| ker_eq_normalClosure : | ||
| (FreeGroup.lift val).ker = Subgroup.normalClosure (Set.range rel) | ||
|
|
||
| namespace Group.Presentation | ||
|
|
||
| variable (P : Group.Presentation G α ρ) | ||
|
|
||
| /-- The canonical surjection from free group on the generators of the presentation to `G`. -/ | ||
| def lift : FreeGroup α →* G := FreeGroup.lift P.val | ||
|
|
||
| /-- The set of relators of the presentation, as words in the free group. This is written because | ||
| `PresentedGroup` takes a set of relations as `Set (FreeGroup α)`. -/ | ||
| def relSet : Set (FreeGroup α) := Set.range P.rel | ||
|
|
||
| /-- The canonical map `lift : FreeGroup α →* G` induced by the presentation is surjective. | ||
| This is a restatement of the surjective statement on the generators, hence the `'`. -/ | ||
| theorem lift_surjective' : Function.Surjective P.lift := P.lift_surjective | ||
|
|
||
| /-- The induced map `lift` sends the free-group generator `FreeGroup.of a` to the corresponding | ||
| generator `val a` of `G`. -/ | ||
| @[simp] | ||
| theorem lift_of (a : α) : P.lift (FreeGroup.of a) = P.val a := FreeGroup.lift_apply_of | ||
|
|
||
| /-- The range of `lift : FreeGroup α →* G` is all of `G`. -/ | ||
| @[simp] | ||
| theorem range_lift_eq_top : P.lift.range = ⊤ := | ||
| MonoidHom.range_eq_top.mpr P.lift_surjective' | ||
|
|
||
| /-- Each relator `rel r` belongs to the relator set `relSet`. -/ | ||
| theorem rel_mem_relSet (r : ρ) : P.rel r ∈ P.relSet := ⟨r, rfl⟩ | ||
|
|
||
| /-- The relator set of a presentation with finitely many relators is finite. -/ | ||
| theorem relSet_finite [Finite ρ] : P.relSet.Finite := Set.finite_range P.rel | ||
|
|
||
| /-- Instance form of `relSet_finite`: typeclass search cannot unfold `relSet` to `Set.range rel`, | ||
| so the `Finite ↥(Set.range _)` instance does not apply to `↥relSet` on its own. -/ | ||
| instance [Finite ρ] : Finite P.relSet := P.relSet_finite.to_subtype | ||
|
|
||
| /-- The kernel of `lift` is the normal closure of the relator set `relSet`: the presentation's | ||
| defining condition `ker_eq_normalClosure`, restated in terms of `lift` and `relSet`. -/ | ||
| theorem ker_lift : P.lift.ker = Subgroup.normalClosure P.relSet := P.ker_eq_normalClosure | ||
|
|
||
| /-- A relator `r ∈ relSet` maps to the identity in `G` through the canonical surjection from the | ||
| free group. -/ | ||
| theorem lift_eq_one_of_mem_relSet {r : FreeGroup α} (hr : r ∈ P.relSet) : P.lift r = 1 := | ||
| MonoidHom.mem_ker.mp (by rw [P.ker_lift]; exact Subgroup.subset_normalClosure hr) | ||
|
|
||
| /-- Every relator `rel r` of the presentation maps to the identity in `G` through | ||
| the canonical surjection from the free group. -/ | ||
| theorem lift_rel (r : ρ) : P.lift (P.rel r) = 1 := | ||
| P.lift_eq_one_of_mem_relSet (P.rel_mem_relSet r) | ||
|
|
||
| /-- The `G` with presentation `P` is isomorphic to the `PresentedGroup` given by `P.relSet`. -/ | ||
| noncomputable def presentedGroupEquiv : PresentedGroup P.relSet ≃* G := | ||
| (QuotientGroup.quotientMulEquivOfEq P.ker_lift.symm).trans | ||
| (QuotientGroup.quotientKerEquivOfSurjective P.lift P.lift_surjective') | ||
|
|
||
| /-- `PresentedGroup.of a` corresponds to the generator `val a` of `G`. -/ | ||
| @[simp] | ||
| theorem presentedGroupEquiv_of (a : α) : | ||
| P.presentedGroupEquiv (PresentedGroup.of a) = P.val a := P.lift_of a | ||
|
|
||
| /-- A finite presentation is finitely presented. -/ | ||
| theorem isFinitelyPresented [Finite α] [Finite ρ] (P : Group.Presentation G α ρ) : | ||
| Group.IsFinitelyPresented G := IsFinitelyPresented.equiv P.presentedGroupEquiv | ||
|
|
||
| end Group.Presentation | ||
|
|
||
| /-- A group is finitely presented if and only if it admits a `Group.Presentation` | ||
| with finitely many generators and finitely many relators. -/ | ||
| theorem Group.isFinitelyPresented_iff_nonempty_finite_presentation : | ||
| Group.IsFinitelyPresented G ↔ | ||
| ∃ (α ρ : Type) (_ : Finite α) (_ : Finite ρ), Nonempty (Group.Presentation G α ρ) := by | ||
|
homeowmorphism marked this conversation as resolved.
Outdated
|
||
| refine ⟨fun h => ?_, fun ⟨_, _, _, _, ⟨P⟩⟩ => P.isFinitelyPresented⟩ | ||
|
homeowmorphism marked this conversation as resolved.
Outdated
|
||
| obtain ⟨n, φ, hφ, s, hs, hsφ⟩ := h.out | ||
| obtain ⟨v, rfl⟩ := FreeGroup.lift.surjective φ | ||
| exact ⟨Fin n, s, inferInstance, hs.to_subtype, | ||
| ⟨{ val := v | ||
| lift_surjective := hφ | ||
| rel := Subtype.val | ||
| ker_eq_normalClosure := by rw [Subtype.range_val]; exact hsφ.symm }⟩⟩ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.