Skip to content

Add a constructive membership test for double cosets#5532

Merged
simonbrandhorst merged 7 commits intooscar-system:masterfrom
ThomasBreuer:TB_double_cosets_decompose
Nov 10, 2025
Merged

Add a constructive membership test for double cosets#5532
simonbrandhorst merged 7 commits intooscar-system:masterfrom
ThomasBreuer:TB_double_cosets_decompose

Conversation

@ThomasBreuer
Copy link
Copy Markdown
Member

  • introduce a new type field right_coset_reps for double cosets, which gets computed on demand, using the same ideas as GAP.Globals.RepresentativesContainedRightCosets but additionally storing the transforming elements
  • introduce decompose for writing a given element in U*g*V in the form u*g*v, with u in U and v in V
  • use the new data also in the nonconstructive membership test with in
  • extend the tests accordingly

(The code still uses GAP.Globals.CanonicalRightCosetElement, which calls different methods for various kinds of group elements.)

- introduce a new type field `right_coset_reps`,
  which gets computed on demand,
  using the same ideas as `GAP.Globals.RepresentativesContainedRightCosets`
  but additionally storing the transforming elements
- introduce `decompose` for writing a given element in `U*g*V`
  in the form `u*g*v`, with `u` in `U` and `v` in `V`
- use the new data also in the nonconstructive membership test with `in`
- extend the tests accordingly

(The code still uses `GAP.Globals.CanonicalRightCosetElement`,
which calls different methods for various kinds of group elements.)
@ThomasBreuer ThomasBreuer added enhancement New feature or request topic: groups release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Nov 7, 2025
@lgoettgens
Copy link
Copy Markdown
Member

Do we already have a function like your new decompose for right cosets? If yes, it would make sense to use the same name and interface here.

@ThomasBreuer
Copy link
Copy Markdown
Member Author

Do we already have a function like your new decompose for right cosets?

For right cosets, it is much simpler: If I have an element x and a right coset U*g then either x/g is the element in U we are looking for, or x is not in the coset.

Copy link
Copy Markdown
Collaborator

@simonbrandhorst simonbrandhorst left a comment

Choose a reason for hiding this comment

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

Thanks a lot. It looks good from my side.
An alternative name to decompose would be something like
is_element_with_data or is_in_with_data, constructive_membership_test. But that would set a general pattern.
So until we have settled once and for good on a name, I would suggest to call the function _decompose for the moment? Then we do not commit on a name yet (decompose is exported) and I can start using it for my purposes.

Comment thread src/Groups/cosets.jl Outdated
Comment thread test/Groups/subgroups_and_cosets.jl Outdated
Comment thread src/Groups/cosets.jl
@simonbrandhorst simonbrandhorst enabled auto-merge (squash) November 8, 2025 11:58
Comment thread src/Groups/cosets.jl
Comment thread src/Groups/cosets.jl Outdated
Comment thread src/Groups/cosets.jl Outdated
Comment thread src/Groups/cosets.jl Outdated
Comment on lines +916 to +918
if !isassigned(C.right_coset_reps)
C.right_coset_reps[] = _right_coset_reps(C)
end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure if Julia can correctly deduce that it has to fetch the value in C.right_coset_reps[] only once afterwards and then not again(in lines 922, 923).

All in all, I'd suggest to use a pattern like this:

Suggested change
if !isassigned(C.right_coset_reps)
C.right_coset_reps[] = _right_coset_reps(C)
end
rcr = _right_coset_reps(C)

and then rename the current _right_coset_reps to, say, compute_right_coset_reps; and the new _right_coset_reps basically does

function _right_coset_reps(C)
  if !isassigned(C.right_coset_reps)
    C.right_coset_reps[] = _right_coset_reps(C)
  end
  return C.right_coset_reps[]
end

@simonbrandhorst simonbrandhorst enabled auto-merge (squash) November 10, 2025 16:51
@simonbrandhorst simonbrandhorst merged commit 0f88248 into oscar-system:master Nov 10, 2025
39 checks passed
@ThomasBreuer ThomasBreuer deleted the TB_double_cosets_decompose branch November 11, 2025 09:57
@lgoettgens lgoettgens changed the title add a constructive membership test for double cosets Add a constructive membership test for double cosets Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: groups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants