Skip to content

Conversation

@cxzhong
Copy link
Contributor

@cxzhong cxzhong commented Dec 8, 2025

fix #40549 Alternative #41173
Now, we only implement hash for finite groups and finite groups. They are well-defined behavior. for general infinite f.p. group, we can not decide word problem. I think setting they are unhashable is better

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Removed example code from the documentation.
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Documentation preview for this PR (built with commit 07001a1; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong cxzhong closed this Dec 8, 2025
@cxzhong cxzhong deleted the fix-free-group branch December 9, 2025 06:30
@cxzhong cxzhong restored the fix-free-group branch December 9, 2025 08:50
Added error handling for as_permutation_group method to support subclasses without limit parameter.
Added a method to return the Cayley graph of Artin groups, requiring elements to be specified due to their infinite nature.
Added a method to return the Cayley graph for braid groups, requiring elements to be specified due to their infinite nature.
@cxzhong cxzhong requested a review from dimpase December 12, 2025 08:49
@cxzhong cxzhong requested a review from user202729 December 15, 2025 16:14
@cxzhong
Copy link
Contributor Author

cxzhong commented Dec 18, 2025

@orlitzky Can you review this part for graph theory

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes incorrect vertex counts in Cayley graphs for finitely presented groups by addressing the word problem - the issue that equal group elements can have different word representations. The solution introduces a __hash__ method based on Tietze words and a specialized cayley_graph method that uses permutation group representations to correctly identify equal elements.

Key changes:

  • Adds __hash__ method to FinitelyPresentedGroupElement based on Tietze representation (with documented limitations)
  • Implements specialized cayley_graph method for FinitelyPresentedGroup that converts to permutation groups for proper element identification
  • Adds cayley_graph methods to BraidGroup and ArtinGroup that delegate to the semigroup implementation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.

File Description
src/sage/groups/finitely_presented.py Adds __hash__ method to group elements and specialized cayley_graph method that uses permutation group conversion to correctly identify equal elements with different word representations
src/sage/groups/braid.py Adds cayley_graph method that delegates to semigroup implementation, appropriate for infinite braid groups
src/sage/groups/artin.py Adds cayley_graph method that delegates to semigroup implementation, appropriate for infinite Artin groups
Comments suppressed due to low confidence (3)

src/sage/groups/artin.py:689

    def as_permutation_group(self):

src/sage/groups/braid.py:2743

    def as_permutation_group(self):

src/sage/groups/finitely_presented.py:188

  • This class implements hash, but does not implement eq.
class FinitelyPresentedGroupElement(FreeGroupElement):

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@orlitzky
Copy link
Contributor

Whoever told you I know graph theory was lying :)

I've lost track of what was going on in #41173 but the discussion does not seem 100% dead yet.

… examples in simplicial_set_examples.py with SymmetricGroup(2)
…amples in simplicial_set_examples.py for clarity
…y and efficiency; update PresentationComplex to use free group generators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cayley graphs of free groups have wrong number of vertices.

2 participants