Mathematica

O produto não é comutativo:

Unprotect[{Times, Power}] ; ClearAttributes[Times, Orderless] Protect[Times] ;

Regras para reduzir o comprimento dos monómios :

Clear /@ {x, y, Power} ;

x^(m_ /; m >= 3) ^:= x^Mod[m, 3] y^(m_ /; m >= 2) ^:= y^Mod[m, 2]  x y x    y ^:= y x^2 y x y x ^:= x^2    y  y x^2 y ^:= x y x   x^2    y x^2 ^:= y x y  y x y x^m_ ^:= x^2    y x^(m - 1)  x^m_ y x y    ^:= x^(m - 1) y x^2

Regras para definir inversos

x /: x^(-1) := x^2 y /: y^(-1) := y

Power[x, m_ /; m < 0] := (x^(-1))^Abs[m]

Power[x_ y_, -1] := y^(-1) x^(-1) Power[x_ y_ z_, -1] := z^(-1) y^(-1) x^(-1)

Gerador de monómios

Gen[k_] := Block[{},  S _ 1 = {1, x, y} ;  Do[S _ (n + 1) = Table[(S _ n [[ i ]] #) & /@ S _ n, {i, 1, Length[S _ n]}] // Flatten[#, 1] & // Union, {n, k - 1}] ;  S _ k]

Length[Gen[#]] & /@ Rg[4]

{G = Gen[3]} // TableForm

1 x y x x y x x^2 y x x^2 y x^2 x y x^2 y x y y x y x^2 y

{Gs = Sort[#,    OrderedQ[{StringLength[ToString @ #1],    StringLength[ToString @ #2]}] &] & @ G} // TableForm

1 x y y x x y x^2 x y x y x y x^2 y y x^2 x^2 y x x y x^2

Thread[(a _ # & /@ Rg[12]) -> Gs ] // List // TF

Comutador de G

Der[G_] := Block[{}, Table[G [[ i ]] G [[ j ]] G [[ i ]]^(-1) G [[ j ]]^(-1), {i, Length[G]}, {j, Length[G]}] ]

(derG = Der[Gen[3]] // Flatten // Union) // List // TableForm

1 x^2 y x x y x^2 y

O grupo gerado pelo comutador é normal em G

(H _ 4 = Table[derG [[ i ]] derG [[ j ]], {i, Length[derG]}, {j, Length[derG]}] // Flatten // Union) // List // TableForm

1 x^2 y x x y x^2 y

Classes de Conjugação de G e sua tabela de multiplicação

Ad[G_] := Block[{}, Union /@ Table[G [[ j ]] G [[ i ]] G [[ j ]]^(-1), {i, Length[G]}, {j, Length[G]}]] // Union

Thread[(÷r _ # & /@ Rg[4]) ÷Ù Ad[Gs]] // TableForm

÷r _ 1 == {1}
÷r _ 2 == {x^2 y x, x y x^2, y}
÷r _ 3 == {x, y x, x y, y x y}
÷r _ 4 == {x y x, x^2, y x^2, x^2 y}

Classes = Thread[(Plus @@ # & /@ Ad[Gs]) -> (÷r _ # & /@ Rg[4])] ;

mClasses = ReplacePart[Thread[(Plus @@ # & /@ (m_ Ad[Gs])) -> m (÷r _ # & /@ Rg[4])], Hold[((m_ ? IntegerQ ) + z__) -> m ÷r _ 1 + z], 1, 1] ;

Block[{÷r = Ad[Gs]}, (Table[Plus @@ (Table[÷r [[ i, k ]] ÷r [[ j, n ]], {k, Length[÷r [[ i ]]]}, {n, Length[÷r [[ j ]]]}] // Fl), {i, Length[÷r]}, {j, Length[÷r]}])] /. Classes //. mClasses // TF

÷r _ 1 ÷r _ 2 ÷r _ 3 ÷r _ 4
÷r _ 2 3 ÷r _ 1 + 2 ÷r _ 2 3 ÷r _ 3 3 ÷r _ 4
÷r _ 3 3 ÷r _ 3 4 ÷r _ 4 4 ÷r _ 1 + 4 ÷r _ 2
÷r _ 4 3 ÷r _ 4 4 ÷r _ 1 + 4 ÷r _ 2 4 ÷r _ 3

Converted by Mathematica  (October 16, 2002)