forbid to be both Finite and Infinite
Currently, one can create
Posets().Finite().Infinite()
and
Posets().Infinite().Finite()
which is not desirable..
:memo: Checklist
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
this triggers a doctest failure in src/sage/groups/cubic_braid.py ; to be investigated
@soehms : should the CubicBraidGroup(6) pass its test suite ? It is infinite, so cannot embed into a matrix group over a finite field.
On vanilla sage:
sage: CubicBraidGroup(6).as_matrix_group(GF(3)(2)).category()
Category of finite infinite groups
and the _test_matrix_group method checks that the matrix embedding is faithful.
should the CubicBraidGroup(6) pass its test suite?
I don't think the fix is correct...? the documentation says
def as_matrix_group(self, root_bur=None, domain=None, characteristic=None, var='t', reduced=False):
r"""
Create an epimorphic image of ``self`` as a matrix group by use of
the burau representation.
epimorphic, not isomorphic. The problem is this line
matrix_group = MatrixGroup(gen_list, category=self.category())
the resulting group does not necessarily be in the same category as self. The correct fix might be change that line to
matrix_group = MatrixGroup(gen_list)
maybe in some cases (domain has characteristic 0?) it is actually deducible that the group is infinite, in which case adding .Infinite() would work (and possibly speed up a few things).
(on the positive side, this change caught a legitimate bug)
looks okay to me. Let's wait for a while to see if @soehms have any comment.
Edit: Looks like https://github.com/sagemath/sage/pull/41183 causes failing tests again. But cubic_braid looks fine.
looks okay to me. Let's wait for a while to see if @soehms have any comment.
I agree with your changes! I've no idea why I put the category=self.category() there (maybe I've copy-pasted it from somewhere else). Many thanks!
you need to fix doctests. thank you.
Now the CI agree this.