Skip to content

feat(FreeGroup): characterize commutative/cyclic free groups#41988

Open
vlad902 wants to merge 6 commits into
leanprover-community:masterfrom
vlad902:freegroup-comm-cyclic
Open

feat(FreeGroup): characterize commutative/cyclic free groups#41988
vlad902 wants to merge 6 commits into
leanprover-community:masterfrom
vlad902:freegroup-comm-cyclic

Conversation

@vlad902

@vlad902 vlad902 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Characterize cyclic/commutative free groups as being those on ≤ 1 generators. I generalize and move around some instances along the way to avoid new imports.


Open in Gitpod

@github-actions github-actions Bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

PR summary 551b1cb5a7

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ instance (priority := 100) isCyclic_of_subsingleton [Subsingleton G] : IsCyclic G
+ instance [Subsingleton α] : IsCyclic (FreeGroup α) := by
+ instance _root_.FreeAddGroup.instIsAddCyclicOfSubsingleton [Subsingleton α] :
+ not_commute
+ not_isMulCommutative_of_nontrivial
+ subsingleton_iff_isCyclic
+ subsingleton_iff_isEmpty_or_unique
+ subsingleton_iff_isMulCommutative
- instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α
- instance [Unique α] : IsAddCyclic (FreeAddGroup α)
- instance [Unique α] : IsCyclic (FreeGroup α)

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 551b1cb).

  • +9 new declarations
  • −2 removed declarations
+FreeAddGroup.instIsAddCyclicOfSubsingleton
+FreeAddGroup.not_addCommute
+FreeAddGroup.subsingleton_iff_isAddCommutative
+FreeAddGroup.subsingleton_iff_isAddCyclic
-FreeGroup.instIsAddCyclicFreeAddGroupOfUnique
+FreeGroup.instIsCyclicOfSubsingleton
-FreeGroup.instIsCyclicOfUnique
+FreeGroup.not_commute
+FreeGroup.subsingleton_iff_isCyclic
+FreeGroup.subsingleton_iff_isMulCommutative
+subsingleton_iff_isEmpty_or_unique

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 551b1cb5a7
Reference commit 3de5ed81cc

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@vlad902 vlad902 added the WIP Work in progress label Jul 21, 2026
@github-actions github-actions Bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Jul 21, 2026
rw [zpow_sub_one]
exact h_inv _ ih

@[to_additive]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this instance is just moved to an earlier file

vlad902 added 5 commits July 22, 2026 08:00
Characterize cyclic/commutative free groups as being those on ≤ 1
generators. I generalize the Subsingleton => IsCyclic instance along the
way to reduce new imports.
@vlad902
vlad902 force-pushed the freegroup-comm-cyclic branch from c400c5a to 9a6925d Compare July 22, 2026 06:18
mul_left_cancel := fun a {b c} h ↦ by
rw [← inv_mul_cancel_left a b, show a * b = a * c from h, inv_mul_cancel_left]

@[to_additive]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This instance is just moved to an earlier file. I'd argue that since IsCyclic is defined in this file that it's reasonable to also state that the trivial group is cyclic here as well, but if Algebra.Group.Defs is too early, I could rename SpecificGroups.Cyclic.Basic to Cyclic.ZMod and then have SpecificGroups.Cyclic.Basic only import Algebra.Group.Basic with these two instances instead?

@vlad902 vlad902 added t-group-theory Group theory and removed WIP Work in progress labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-group-theory Group theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant