Ticket #14791: trac_14791-review-ts.patch

File trac_14791-review-ts.patch, 14.8 KB (added by tscrim, 8 years ago)
  • sage/groups/finitely_presented.py

    # HG changeset patch
    # User Travis Scrimshaw <tscrim at ucdavis.edu>
    # Date 1378230149 25200
    # Node ID 6367db73940102489b922cec8c42d7f1fc44850b
    # Parent 951d0079daa9b5c6758250921b9a61362877a523
    #14791: review patch.
    
    diff --git a/sage/groups/finitely_presented.py b/sage/groups/finitely_presented.py
    a b  
    22Finitely Presented Groups
    33
    44Finitely presented groups are constructed as quotients of
    5 :mod:`~sage.groups.free_group` ::
     5:mod:`~sage.groups.free_group`::
    66
    77    sage: F.<a,b,c> = FreeGroup()
    88    sage: G = F / [a^2, b^2, c^2, a*b*c*a*b*c]
    obtained by modding out the commutator s 
    100100    ...
    101101    ValueError: the values do not satisfy all relations of the group
    102102
    103 
    104 .. warning::
     103.. WARNING::
    105104
    106105    Some methods are not guaranteed to finish since the word problem
    107106    for finitely presented groups is, in general, undecidable. In
    obtained by modding out the commutator s 
    110109
    111110REFERENCES:
    112111
    113 - http://en.wikipedia.org/wiki/Presentation_of_a_group
     112- :wikipedia:`Presentation_of_a_group`
    114113
    115 - http://en.wikipedia.org/wiki/Word_problem_for_groups
     114- :wikipedia:`Word_problem_for_groups`
    116115
    117116AUTHOR:
    118117
    class FinitelyPresentedGroupElement(Free 
    204203
    205204    def __reduce__(self):
    206205        """
     206        Used in pickling.
     207
    207208        TESTS::
    208209
    209210            sage: F.<a,b> = FreeGroup()
    class FinitelyPresentedGroupElement(Free 
    310311            sage: H.simplified()
    311312            Finitely presented group < a |  >
    312313
    313         `b` can be eliminated using the relation `a=b`. Any values
    314         that you plug into a word must satisfy this relation::
     314        The generator `b` can be eliminated using the relation `a=b`. Any
     315        values that you plug into a word must satisfy this relation::
    315316
    316317            sage: A, B = H.gens()
    317318            sage: w = A^2 * B
    def wrap_FpGroup(libgap_fpgroup): 
    341342
    342343    This function changes the comparison method of
    343344    ``libgap_free_group`` to comparison by Python ``id``. If you want
    344     to put the LibGAP free group into a container (set, dict) then you
     345    to put the LibGAP free group into a container ``(set, dict)`` then you
    345346    should understand the implications of
    346347    :meth:`~sage.libs.gap.element.GapElement._set_compare_by_id`. To
    347348    be safe, it is recommended that you just work with the resulting
    def wrap_FpGroup(libgap_fpgroup): 
    383384
    384385class FinitelyPresentedGroup(UniqueRepresentation, Group, ParentLibGAP):
    385386    """
    386     A class that wraps GAP's Finitely Presented Groups
     387    A class that wraps GAP's Finitely Presented Groups.
    387388
    388     .. warning::
     389    .. WARNING::
    389390
    390391        You should use
    391392        :meth:`~sage.groups.free_group.FreeGroup_class.quotient` to
    class FinitelyPresentedGroup(UniqueRepre 
    423424
    424425    def __init__(self, free_group, relations):
    425426        """
    426         The Python constructor
     427        The Python constructor.
    427428
    428429        TESTS::
    429430
    class FinitelyPresentedGroup(UniqueRepre 
    452453
    453454    def __reduce__(self):
    454455        """
     456        Used in pickling.
     457
    455458        TESTS::
    456459
    457460            sage: F = FreeGroup(4)
    class FinitelyPresentedGroup(UniqueRepre 
    550553
    551554        OUTPUT:
    552555
    553         The relations as a touple of elements of :meth:`free_group`.
     556        The relations as a tuple of elements of :meth:`free_group`.
    554557
    555558        EXAMPLES::
    556559
    class FinitelyPresentedGroup(UniqueRepre 
    568571    @cached_method
    569572    def cardinality(self, limit=4096000):
    570573        """
    571         Compute the size of self.
     574        Compute the cardinality of ``self``.
    572575
    573576        INPUT:
    574577
    class FinitelyPresentedGroup(UniqueRepre 
    674677
    675678    def _element_constructor_(self, *args, **kwds):
    676679        """
     680        Construct an element of ``self``.
     681
    677682        TESTS::
    678683
    679684            sage: G.<a,b> = FreeGroup()
    class FinitelyPresentedGroup(UniqueRepre 
    698703
    699704    @cached_method
    700705    def abelian_invariants(self):
    701         """
    702         Return the abelian invariants of self.
     706        r"""
     707        Return the abelian invariants of ``self``.
    703708
    704         The abelian invariants are given by a list of integers $i_1 \dots i_j$, such that the
    705         abelianization of the group is isomorphic to $\mathbb{Z}/(i_1) \\times \dots \\times
    706         \mathbb{Z}/(i_j)$.
     709        The abelian invariants are given by a list of integers
     710        `(i_1, \ldots, i_j)`, such that the abelianization of the group is
     711        isomorphic to `\ZZ / (i_1) \times \cdots \times \ZZ / (i_j)`.
    707712
    708713        EXAMPLES::
    709714
    class FinitelyPresentedGroup(UniqueRepre 
    716721
    717722        ALGORITHM:
    718723
    719             Uses GAP.
     724        Uses GAP.
    720725        """
    721726        invariants = self.gap().AbelianInvariants()
    722727        return tuple( i.sage() for i in invariants )
    723728
    724729    def simplification_isomorphism(self):
    725730        """
    726         Return an isomorphism from self to a finitely presented group with a (hopefully) simpler
    727         presentation.
     731        Return an isomorphism from ``self`` to a finitely presented group with
     732        a (hopefully) simpler presentation.
    728733
    729734        EXAMPLES::
    730735
    class FinitelyPresentedGroup(UniqueRepre 
    753758
    754759        ALGORITM:
    755760
    756             Uses GAP.
     761        Uses GAP.
    757762        """
    758763        I = self.gap().IsomorphismSimplifiedFpGroup()
    759764        domain = self
    class FinitelyPresentedGroup(UniqueRepre 
    768773        OUTPUT:
    769774
    770775        A new finitely presented group. Use
    771         :meth:simplification_isomorphism` if you want to know the
     776        :meth:`simplification_isomorphism` if you want to know the
    772777        isomorphism.
    773778
    774779        EXAMPLES::
  • sage/groups/finitely_presented_named.py

    diff --git a/sage/groups/finitely_presented_named.py b/sage/groups/finitely_presented_named.py
    a b  
    1 """
     1r"""
    22Named Finitely Presented Groups
    33
    44Construct groups of small order and "named" groups as quotients of free groups. These
    from entries in [THOMAS-WOODS]_. 
    99
    1010Groups available as finite presentations:   
    1111
    12 -- Cyclic group, $C_n$ of order $n$
    13     - :func:`groups.presentation.Cyclic <sage.groups.finitely_presented_named.CyclicPresentation>`
     12- Cyclic group, `C_n` of order `n` --
     13  :func:`groups.presentation.Cyclic <sage.groups.finitely_presented_named.CyclicPresentation>`
    1414
    15 -- Dicyclic group, nonabelian groups of order $4n$ with a unique element of order 2
    16     - :func:`groups.presentation.DiCyclic <sage.groups.finitely_presented_named.DiCyclicPresentation>`
     15- Dicyclic group, nonabelian groups of order `4n` with a unique element of
     16  order 2 --
     17  :func:`groups.presentation.DiCyclic <sage.groups.finitely_presented_named.DiCyclicPresentation>`
    1718
    18 -- Dihedral group, $D_n$ of order $2n$
    19     - :func:`groups.presentation.Dihedral <sage.groups.finitely_presented_named.DihedralPresentation>`
     19- Dihedral group, `D_n` of order `2n` --
     20  :func:`groups.presentation.Dihedral <sage.groups.finitely_presented_named.DihedralPresentation>`
    2021
    21 -- Klein four group, `C_2 \\times C_2`
    22     - :func:`groups.presentation.KleinFour <sage.groups.finitely_presented_named.KleinFourPresentation>`
     22- Klein four group, `C_2 \times C_2` --
     23  :func:`groups.presentation.KleinFour <sage.groups.finitely_presented_named.KleinFourPresentation>`
    2324
    2425AUTHORS:
    2526
    EXAMPLES:: 
    3031    sage: groups.presentation.Cyclic(4)
    3132    Finitely presented group < a | a^4 >
    3233
    33 You can also import the desired functions.::
     34You can also import the desired functions::
    3435
    3536    sage: from sage.groups.finitely_presented_named import CyclicPresentation
    3637    sage: CyclicPresentation(4)
    from sage.groups.free_group import FreeG 
    4849from sage.groups.finitely_presented import FinitelyPresentedGroup
    4950
    5051def CyclicPresentation(n):
    51     """
     52    r"""
    5253    Build cyclic group of order `n` as a finitely presented group.
    5354
    5455    INPUT:
    def CyclicPresentation(n): 
    8283    return FinitelyPresentedGroup( F, rls )
    8384
    8485def DihedralPresentation(n):
    85     """
    86     Build the Dihedral group of order $2n$ as a finitely presented group.
     86    r"""
     87    Build the Dihedral group of order `2n` as a finitely presented group.
    8788   
    8889    INPUT:
    8990
    def DihedralPresentation(n): 
    119120    return FinitelyPresentedGroup( F, rls )
    120121
    121122def DiCyclicPresentation(n):
    122     """
    123     Build the dicyclic group of order $4n$, for `n\geq 2`, as a finitely presented group.
     123    r"""
     124    Build the dicyclic group of order `4n`, for `n \geq 2`, as a finitely
     125    presented group.
    124126   
    125127    INPUT:
    126128
    127     - ``n`` -- Possitive integer, 2 or greater, determining the order of the group (`4n`).
     129    - ``n`` -- positive integer, 2 or greater, determining the order of
     130      the group (`4n`).
    128131   
    129132    OUTPUT:
    130133
    def DiCyclicPresentation(n): 
    132135
    133136    .. MATH::
    134137
    135         < a, x\mid a^{2n}=1, x^{2}=a^{n}, x^{-1}ax=a^{-1} >
     138        \langle a, x \mid a^{2n}=1, x^{2}=a^{n}, x^{-1}ax=a^{-1} \rangle
    136139
    137     .. note::
     140    .. NOTE::
     141
    138142        This group is also available as a permutation group via
    139143        :class:`groups.permutation.DiCyclic <sage.groups.perm_gps.permgroup_named.DiCyclicGroup>`.
    140144
    def DiCyclicPresentation(n): 
    167171    return FinitelyPresentedGroup(F, rls)
    168172
    169173def KleinFourPresentation():
    170     """
     174    r"""
    171175    Build the Klein group of order `4` as a finitely presented group.
    172176
    173177    OUTPUT:
    174178
    175     Klein four group (`C_2 \\times C_2`) as a finitely presented group.
     179    Klein four group (`C_2 \times C_2`) as a finitely presented group.
    176180
    177181    EXAMPLES::
    178182
  • sage/groups/groups_catalog.py

    diff --git a/sage/groups/groups_catalog.py b/sage/groups/groups_catalog.py
    a b Let ``<tab>`` indicate pressing the tab  
    1010``groups.matrix.<tab>`` to access various groups implemented as sets of matrices.
    1111
    1212- Permutation Groups  (``groups.permutation.<tab>``)
    13     - :class:`groups.permutation.Symmetric <sage.groups.perm_gps.permgroup_named.SymmetricGroup>`
    14     - :class:`groups.permutation.Alternating <sage.groups.perm_gps.permgroup_named.AlternatingGroup>`
    15     - :class:`groups.permutation.KleinFour <sage.groups.perm_gps.permgroup_named.KleinFourGroup>`
    16     - :class:`groups.permutation.Quaternion <sage.groups.perm_gps.permgroup_named.QuaternionGroup>`
    17     - :class:`groups.permutation.Cyclic <sage.groups.perm_gps.permgroup_named.CyclicPermutationGroup>`
    18     - :class:`groups.permutation.Dihedral <sage.groups.perm_gps.permgroup_named.DihedralGroup>`
    19     - :class:`groups.permutation.DiCyclic <sage.groups.perm_gps.permgroup_named.DiCyclicGroup>`
    20     - :class:`groups.permutation.Mathieu <sage.groups.perm_gps.permgroup_named.MathieuGroup>`
    21     - :class:`groups.permutation.Suzuki <sage.groups.perm_gps.permgroup_named.SuzukiGroup>`
    22     - :class:`groups.permutation.PGL <sage.groups.perm_gps.permgroup_named.PGL>`
    23     - :class:`groups.permutation.PSL <sage.groups.perm_gps.permgroup_named.PSL>`
    24     - :class:`groups.permutation.PSp <sage.groups.perm_gps.permgroup_named.PSp>`
    25     - :class:`groups.permutation.PSU <sage.groups.perm_gps.permgroup_named.PSU>`
    26     - :class:`groups.permutation.PGU <sage.groups.perm_gps.permgroup_named.PGU>`
    27     - :class:`groups.permutation.Transitive <sage.groups.perm_gps.permgroup_named.TransitiveGroup>`
    28     - :class:`groups.permutation.RubiksCube <sage.groups.perm_gps.cubegroup.CubeGroup>`
     13
     14  - :class:`groups.permutation.Symmetric <sage.groups.perm_gps.permgroup_named.SymmetricGroup>`
     15  - :class:`groups.permutation.Alternating <sage.groups.perm_gps.permgroup_named.AlternatingGroup>`
     16  - :class:`groups.permutation.KleinFour <sage.groups.perm_gps.permgroup_named.KleinFourGroup>`
     17  - :class:`groups.permutation.Quaternion <sage.groups.perm_gps.permgroup_named.QuaternionGroup>`
     18  - :class:`groups.permutation.Cyclic <sage.groups.perm_gps.permgroup_named.CyclicPermutationGroup>`
     19  - :class:`groups.permutation.Dihedral <sage.groups.perm_gps.permgroup_named.DihedralGroup>`
     20  - :class:`groups.permutation.DiCyclic <sage.groups.perm_gps.permgroup_named.DiCyclicGroup>`
     21  - :class:`groups.permutation.Mathieu <sage.groups.perm_gps.permgroup_named.MathieuGroup>`
     22  - :class:`groups.permutation.Suzuki <sage.groups.perm_gps.permgroup_named.SuzukiGroup>`
     23  - :class:`groups.permutation.PGL <sage.groups.perm_gps.permgroup_named.PGL>`
     24  - :class:`groups.permutation.PSL <sage.groups.perm_gps.permgroup_named.PSL>`
     25  - :class:`groups.permutation.PSp <sage.groups.perm_gps.permgroup_named.PSp>`
     26  - :class:`groups.permutation.PSU <sage.groups.perm_gps.permgroup_named.PSU>`
     27  - :class:`groups.permutation.PGU <sage.groups.perm_gps.permgroup_named.PGU>`
     28  - :class:`groups.permutation.Transitive <sage.groups.perm_gps.permgroup_named.TransitiveGroup>`
     29  - :class:`groups.permutation.RubiksCube <sage.groups.perm_gps.cubegroup.CubeGroup>`
    2930
    3031- Matrix Groups (``groups.matrix.<tab>``)
    31     - :func:`groups.matrix.QuaternionGF3 <sage.groups.misc_gps.misc_groups.QuaternionMatrixGroupGF3>`
    32     - :func:`groups.matrix.GL <sage.groups.matrix_gps.general_linear.GL>`
    33     - :func:`groups.matrix.SL <sage.groups.matrix_gps.special_linear.SL>`
    34     - :func:`groups.matrix.Sp <sage.groups.matrix_gps.symplectic.Sp>`
    35     - :func:`groups.matrix.GU <sage.groups.matrix_gps.unitary.GU>`
    36     - :func:`groups.matrix.SU <sage.groups.matrix_gps.unitary.SU>`
    37     - :func:`groups.matrix.GO <sage.groups.matrix_gps.orthogonal.GO>`
    38     - :func:`groups.matrix.SO <sage.groups.matrix_gps.orthogonal.SO>`
     32
     33  - :func:`groups.matrix.QuaternionGF3 <sage.groups.misc_gps.misc_groups.QuaternionMatrixGroupGF3>`
     34  - :func:`groups.matrix.GL <sage.groups.matrix_gps.general_linear.GL>`
     35  - :func:`groups.matrix.SL <sage.groups.matrix_gps.special_linear.SL>`
     36  - :func:`groups.matrix.Sp <sage.groups.matrix_gps.symplectic.Sp>`
     37  - :func:`groups.matrix.GU <sage.groups.matrix_gps.unitary.GU>`
     38  - :func:`groups.matrix.SU <sage.groups.matrix_gps.unitary.SU>`
     39  - :func:`groups.matrix.GO <sage.groups.matrix_gps.orthogonal.GO>`
     40  - :func:`groups.matrix.SO <sage.groups.matrix_gps.orthogonal.SO>`
    3941
    4042- Finitely Presented Groups (``groups.presentation.<tab>``)
    41     - :func:`groups.presentation.Cyclic <sage.groups.finitely_presented_named.CyclicPresentation>`
    42     - :func:`groups.presentation.Dihedral <sage.groups.finitely_presented_named.DihedralPresentation>`
    43     - :func:`groups.presentation.DiCyclic <sage.groups.finitely_presented_named.DiCyclicPresentation>`
    44     - :func:`groups.presentation.KleinFour <sage.groups.finitely_presented_named.KleinFourPresentation>`
     43
     44  - :func:`groups.presentation.Cyclic <sage.groups.finitely_presented_named.CyclicPresentation>`
     45  - :func:`groups.presentation.Dihedral <sage.groups.finitely_presented_named.DihedralPresentation>`
     46  - :func:`groups.presentation.DiCyclic <sage.groups.finitely_presented_named.DiCyclicPresentation>`
     47  - :func:`groups.presentation.KleinFour <sage.groups.finitely_presented_named.KleinFourPresentation>`
    4548
    4649- Miscellaneous Groups (``groups.misc.<tab>``)
    4750"""