% egison -l lib/math/algebra/symmetric-group.egi
> s3
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
> cyclicSubgroups s3
[[[1, 2, 3]], [[1, 3, 2], [1, 2, 3]], [[2, 1, 3], [1, 2, 3]], [[2, 3, 1], [3, 1, 2], [1, 2, 3]], [[3, 2, 1], [1, 2, 3]]]
> isNormalSubgroup [[1, 2, 3]] s3
True
> isNormalSubgroup [[1, 3, 2], [1, 2, 3]] s3
False
> isNormalSubgroup [[2, 3, 1], [3, 1, 2], [1, 2, 3]] s3
True
> commutatorSubgroup s3
[[1, 2, 3], [2, 3, 1], [3, 1, 2]]
> commutatorSubgroup (commutatorSubgroup s3)
[[1, 2, 3]]
> G.id 3
[1, 2, 3]
> G.id 4
[1, 2, 3, 4]
> G.* [1, 2, 3] [2, 3, 1]
[2, 3, 1]
> G.* [2, 3, 1] [3, 1, 2]
[1, 2, 3]
> G.* [3, 1, 2] [2, 3, 1]
[1, 2, 3]
> G.reverse [2, 1, 3, 4]
[2, 1, 3, 4]
> G.reverse [4, 1, 2, 3]
[2, 3, 4, 1]
> G.toCycles [3, 1, 2, 4]
[[1, 3, 2]]
> G.toCycles [2, 1, 4, 3]
[[1, 2], [3, 4]]
> symmetricGroup 3
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
> symmetricGroup 4
[[1, 2, 3, 4], [1, 2, 4, 3], [1, 3, 2, 4], [2, 1, 3, 4], [1, 3, 4, 2], [1, 4, 2, 3], [2, 1, 4, 3], [2, 3, 1, 4], [3, 1, 2, 4], [1, 4, 3, 2], [2, 3, 4, 1], [2, 4, 1, 3], [3, 1, 4, 2], [3, 2, 1, 4], [4, 1, 2, 3], [2, 4, 3, 1], [3, 2, 4, 1], [3, 4, 1, 2], [4, 1, 3, 2], [4, 2, 1, 3], [3, 4, 2, 1], [4, 2, 3, 1], [4, 3, 1, 2], [4, 3, 2, 1]]
s3
is the symmetric group with 3 symobols.
s4
is the symmetric group with 4 symobols.
s5
is the symmetric group with 5 symobols.
a3
is the alternating group of s3
.
a4
is the alternating group of s4
.
a5
is the alternating group of s5
.
v4
is Klein four-group.
> v4
[[1, 2, 3, 4], [4, 3, 2, 1], [2, 1, 4, 3], [3, 4, 1, 2]]
> isNormalSubgroup a3 s3
True
> isNormalSubgroup [[2, 1, 3], [1, 2, 3]] s3
False
> isNormalSubgroup a4 v4
True
> genCyclicGroup [2, 1, 3]
[[2, 1, 3], [1, 2, 3]]
> genCyclicGroup [2, 3, 1]
[[2, 3, 1], [3, 1, 2], [1, 2, 3]]
> cyclicSubgroups s3
[[[1, 2, 3]],
[[1, 3, 2], [1, 2, 3]],
[[2, 1, 3], [1, 2, 3]],
[[2, 3, 1], [3, 1, 2], [1, 2, 3]],
[[3, 2, 1], [1, 2, 3]]]
> map G.toCycles (generators s4)
[[],
[[3, 4]],
[[2, 3]],
[[1, 2]],
[[2, 3, 4]],
[[1, 2], [3, 4]],
[[1, 2, 3]],
[[2, 4]],
[[1, 2, 3, 4]],
[[1, 2, 4, 3]],
[[1, 3]],
[[1, 2, 4]],
[[1, 3, 4]],
[[1, 3], [2, 4]],
[[1, 3, 2, 4]],
[[1, 4]],
[[1, 4], [2, 3]]]
> genGroup [[1, 3, 4, 2], [2, 1, 4, 3]]
[[3, 1, 2, 4], [1, 3, 4, 2], [4, 1, 3, 2], [1, 4, 2, 3], [2, 1, 4, 3], [1, 2, 3, 4], [2, 3, 1, 4], [3, 2, 4, 1], [4, 3, 2, 1], [3, 4, 1, 2], [2, 4, 3, 1], [4, 2, 1, 3]]
> G.product v4 [[2, 3, 1, 4], [1, 4, 2, 3], [4, 1, 3, 2], [3, 2, 4, 1]]
[[2, 3, 1, 4], [1, 4, 2, 3], [3, 2, 4, 1], [4, 1, 3, 2]]
> G.** v4 [[1, 3, 4, 2], [1, 4, 2, 3], [1, 2, 3, 4]]
[[1, 3, 4, 2], [1, 4, 2, 3], [4, 2, 1, 3], [1, 2, 3, 4], [4, 1, 3, 2], [2, 4, 3, 1], [4, 3, 2, 1], [2, 3, 1, 4], [3, 1, 2, 4], [2, 1, 4, 3], [3, 2, 4, 1], [3, 4, 1, 2]]
-- error
> G.// a4 v4
[[1, 3, 4, 2], [1, 4, 2, 3], [1, 2, 3, 4]]
> commutator [3, 1, 2, 4] [2, 3, 1, 4]
[1, 2, 3, 4]
> commutator [3, 1, 2, 4] [4, 1, 2, 3]
[1, 4, 2, 3]
> commutatorSubgroup s3
[[1, 2, 3], [2, 3, 1], [3, 1, 2]]
> isAbelianGroup (genCyclicGroup [4, 1, 2, 3])
True
> isAbelianGroup s4
False
> isPerfectGroup a4
False
> isPerfectGroup a5
True
This work is licensed under a Creative Commons Attribution 4.0 International License.