Commutator subgroup

cf. Sage Math docs: Groups


In [30]:
G = SL(2,ZZ)

In [31]:
G


Out[31]:
Special Linear Group of degree 2 over Integer Ring

In [32]:
identity = matrix(ZZ,[[1,0],[0,1]])

In [33]:
G.cayley_table(elements=[identity,-identity])


Out[33]:
*  a b
 +----
a| a b
b| b a

In [34]:
from sage.matrix.operation_table import OperationTable

In [35]:
G=DiCyclicGroup(3)

In [36]:
commutator = lambda x, y: x*y*x^-1*y^-1

In [37]:
T=OperationTable(G,commutator)

In [38]:
T


Out[38]:
.  a b c d e f g h i j k l
 +------------------------
a| a a a a a a a a a a a a
b| a a h d a d h h a h d d
c| a d a a a d d a d d d a
d| a h a a a h h a h h h a
e| a a a a a a a a a a a a
f| a h h d a a d h h d a d
g| a d h d a h a h d a h d
h| a d a a a d d a d d d a
i| a a h d a d h h a h d d
j| a d h d a h a h d a h d
k| a h h d a a d h h d a d
l| a h a a a h h a h h h a

In [39]:
trans = T.translation()

In [40]:
comm = [trans['a'],trans['d'],trans['h']]

In [41]:
comm


Out[41]:
[(), (5,7,6), (5,6,7)]

In [42]:
P=G.cayley_table(elements=comm)

In [43]:
P


Out[43]:
*  a b c
 +------
a| a b c
b| b c a
c| c a b

Finitely Presented Groups

cf. Sage Math documentation, Groups, Finitely Presented Groups in combination with

Joseph J. Rotman. Advanced Modern Algebra (Graduate Studies in Mathematics) 2nd Edition. American Mathematical Society

EY : 20160411 I used the 1st edition of Rotman


In [1]:
F.<a,b,c> = FreeGroup()

In [2]:
G = F/[a^2,b^2,c^2,a*b*c*a*b*c]

In [3]:
G


Out[3]:
Finitely presented group < a, b, c | a^2, b^2, c^2, (a*b*c)^2 >

In [4]:
G.gen(0) * G.gen(1)


Out[4]:
a*b

In [5]:
G([1,2,-1])


Out[5]:
a*b*a^-1

In [6]:
a.parent()


Out[6]:
Free Group on generators {a, b, c}

In [7]:
G.inject_variables()


Defining a, b, c

In [8]:
a.parent()


Out[8]:
Finitely presented group < a, b, c | a^2, b^2, c^2, (a*b*c)^2 >

Notice that, even if they are represented in the same way, the elements of a finitely presented group and the elements of the corresponding free group are not the same thing. However, they can be converted from one parent to the other:


In [9]:
F.<a,b,c> = FreeGroup()

In [10]:
G = F/[a^2,b^2,c^2,a*b*c*a*b*c]

In [11]:
F([1])


Out[11]:
a

In [12]:
G([1])


Out[12]:
a

In [13]:
F([1]) is G([1])


Out[13]:
False

In [14]:
F([1]) == G([1])


Out[14]:
False

In [15]:
G(a*b*c)


Out[15]:
a*b*c

In [16]:
F(G(a*b/c))


Out[16]:
a*b*c^-1

Finitely presented groups are implemented via GAP. You can use the gap() method to access the underlying LibGAP object:


In [17]:
G = FreeGroup(2)

In [18]:
G.inject_variables()


Defining x0, x1

In [19]:
H = G/(x0^2,(x0*x1)^2,x1^2)

In [20]:
H.gap()


Out[20]:
<fp group on the generators [ x0, x1 ]>

This can be useful, for example, to use GAP functions that are not yet wrapped in Sage:


In [22]:
H.gap().LowerCentralSeries()


Out[22]:
[ Group(<fp, no generators known>), Group(<fp, no generators known>) ]

In [23]:
G = FreeGroup(2)

In [24]:
H=G/(G([1,1]),G([2,2,2]),G([1,2,-1,-2])); H


Out[24]:
Finitely presented group < x0, x1 | x0^2, x1^3, x0*x1*x0^-1*x1^-1 >

In [25]:
a = H([1])

In [26]:
a


Out[26]:
x0

In [28]:
a.gap()


Out[28]:
x0

In [45]:
a.gap().Order()


Out[45]:
2

In [46]:
type(_) # note that the above output is not a Sage integer


Out[46]:
<type 'sage.libs.gap.element.GapElement_Integer'>

cf. Rotman, Chapter 5, Groups II Proposition 5.80

generalized quaternion group $\mathbf{Q}_n$, $\forall \, n \geq 3$


In [49]:
def make_Q_n(n):
    assert n >= 3
    F.<a,b> = FreeGroup()
    G = F/[a^(2^(n-1)),a*b*a*b^(-1),a^(2^(n-2))*b^(-2)]
    return G

In [50]:
Q_3 = make_Q_n(3)

In [51]:
Q_3


Out[51]:
Finitely presented group < a, b | a^4, a*b*a*b^-1, a^2*b^-2 >

In [52]:
Q_3.monoid_generators()


Out[52]:
Family (a, b, a^-1, b^-1)
  • dihedral group $D_{2n}$

In [53]:
def make_D_2n(n):
    assert n > 0
    F.<a,b> = FreeGroup()
    G = F/[a^n,b^2,b*a*b*a]
    return G

In [54]:
D_4 = make_D_2n(2)

In [55]:
D_4


Out[55]:
Finitely presented group < a, b | a^2, b^2, (b*a)^2 >

There a large number of modules to explore (by doing the command dir(D_4) or dir() on your group of choice) that I have yet to fully and thoroughly understand: I'd invite you to help me out and add your own explanations and explorations.


In [56]:
D_4.abelian_invariants()


Out[56]:
(2, 2)

In [57]:
D_4.alexander_matrix()


Out[57]:
[    B[1] + B[a]               0]
[              0     B[1] + B[b]]
[B[b] + B[b*a*b]   B[1] + B[b*a]]

In [63]:
D_4.center()


Out[63]:
Group([ a, b ])

In [ ]: