Skip to content
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

Cosets changes #126

Merged
merged 1 commit into from
Jul 21, 2020
Merged

Cosets changes #126

merged 1 commit into from
Jul 21, 2020

Conversation

GDeFranceschi
Copy link
Contributor

I want to merge the branch coset-changes into the master branch before going on with the work in the manual. This branch deals the questions raised in the Issue #118. In particular:

  • Added new function isrightcoset and as_right_coset that says whether a coset is right and turning a coset into a right coset. Same for the left.
  • Added operations between cosets and elements (e.g. x * yH --> (xy) * H and similar ). Now it is also possible to define a coset just multiplying an element by a coset (e.g. x * H --> left_coset(H,x)).
  • Added in the docstrings a line that explains that the underlying GAP objects are all right cosets (the Julia left cosets are "fake").
  • Others? Suggestions?

@codecov
Copy link

codecov bot commented Jul 10, 2020

Codecov Report

Merging #126 into master will increase coverage by 3.22%.
The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
+ Coverage   30.07%   33.29%   +3.22%     
==========================================
  Files          19       19              
  Lines        2820     3205     +385     
==========================================
+ Hits          848     1067     +219     
- Misses       1972     2138     +166     
Impacted Files Coverage Δ
src/Groups/cosets.jl 73.55% <77.77%> (+2.12%) ⬆️
src/Groups/group_constructors.jl 86.84% <0.00%> (-1.73%) ⬇️
src/Groups/libraries/transitivegroups.jl 90.00% <0.00%> (-1.31%) ⬇️
src/Oscar.jl 6.45% <0.00%> (-0.37%) ⬇️
src/Groups/libraries/perfectgroups.jl 100.00% <0.00%> (ø)
src/Groups/libraries/primitivegroups.jl 0.00% <0.00%> (ø)
src/Groups/GAPGroups.jl 80.22% <0.00%> (+1.61%) ⬆️
src/Rings/mpoly.jl 32.60% <0.00%> (+3.25%) ⬆️

src/Groups/cosets.jl Outdated Show resolved Hide resolved
src/Groups/cosets.jl Outdated Show resolved Hide resolved
Return the coset `gH`.
!!! note
Since GAP supports right cosets only, the underlying GAP object of `left_coset(H,g)` is the right coset `H^(g^-1) * g`.
Copy link
Member

Choose a reason for hiding this comment

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

While this describes what the code does, this strikes me as deeply problematic. It means that you have to creates lots of new subgroups by conjugating H around.

My idea would be to represent gH by Hg^{-1}, using that fact that the inversion map induces a bijection between them.

That said, I am actually still sceptical about the whole idea of providing left cosets. Perhaps it's a good idea to do so, but I'd really like to see some concrete applications in order to figure out what the "right" way (or at least a "somewhat useful way") to go about them might be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My idea would be to represent gH by Hg^{-1}, using that fact that the inversion map induces a bijection between them.

This would be much faster during the creation of the coset (I don't have to create the conjugate subgroup), but would it be slower every time I need to access to it?
If lc=gH, and I save it as Hg^-1, every time I type something like rand(lc) or elements(lc), or some intersection involving lc, I need to compute an inverse. A possible syntax for the rand function could be
> function rand(lc::Coset)
> x=rand(lc)
> if isleft(lc) then x=x^-1 end
> return x
> end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is perfectly realizable, maybe with a little care about the fact that the underlying GAP object is not the object I'm interested (but its image under the inverse function), but is it really faster?

Copy link
Member

Choose a reason for hiding this comment

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

Well, that exactly is my point: what is "faster" depends entirely on the use case. But no matter how you implement the left cosets, one thing stays the same: as long as they simply (ab)use GAP's right cosets, it will always be faster if you rewrite your code to use right cosets instead of left cosets.

Anyway: as long as this is an implementation detail is hidden from the user, this is fine. But I would not want to mention it to the user! The user should not have to care about this.

Next thing: GAP doesn't really do much with RightCosets anyway. So we could think about simply not using GAP objects of type RightCoset at all, and simply implement our own two types RightCoset and LeftCoset, which simply wrap a group element g plus a subgroup H. Implementing things like rand or elements then is easy: e.g. rand(H) * g to get a random element. I'll put this idea into another issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems good. Do I try this new type on the same branch? Or do we open a new one?

src/Groups/cosets.jl Outdated Show resolved Hide resolved
@fingolfin fingolfin merged commit 13b26d7 into master Jul 21, 2020
@fingolfin fingolfin deleted the cosets-changes branch July 21, 2020 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants