Skip to content

Instantly share code, notes, and snippets.

@dharmatech
Last active March 18, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dharmatech/5ac41c4ba0bca75c55ebc8dcaafb05c2 to your computer and use it in GitHub Desktop.
Save dharmatech/5ac41c4ba0bca75c55ebc8dcaafb05c2 to your computer and use it in GitHub Desktop.

Symmetries of a pentagon

Represent each symmetry as a permutation of vertices:

var R0 = new FunctionIntInt((1, 1), (2, 2), (3, 3), (4, 4), (5, 5));
var R1 = new FunctionIntInt((1, 2), (2, 3), (3, 4), (4, 5), (5, 1));
var R2 = new FunctionIntInt((1, 3), (2, 4), (3, 5), (4, 1), (5, 2));
var R3 = new FunctionIntInt((1, 4), (2, 5), (3, 1), (4, 2), (5, 3));
var R4 = new FunctionIntInt((1, 5), (2, 1), (3, 2), (4, 3), (5, 4));
var Ra = new FunctionIntInt((1, 1), (2, 5), (3, 4), (4, 3), (5, 2));
var Rb = new FunctionIntInt((1, 2), (2, 1), (3, 5), (4, 4), (5, 3));
var Rc = new FunctionIntInt((1, 3), (2, 2), (3, 1), (4, 5), (5, 4));
var Rd = new FunctionIntInt((1, 4), (2, 3), (3, 2), (4, 1), (5, 5));
var Re = new FunctionIntInt((1, 5), (2, 4), (3, 3), (4, 2), (5, 1));

Define D_5 to be the set of the group:

var D_5 = new[] { R0, R1, R2, R3, R4, Ra, Rb, Rc, Rd, Re }.ToMathSet();

Let's associate each permutation with a name:

var items = new[] { (R0, "R0"), (R1, "R1"), (R2, "R2"), (R3, "R3"), (R4, "R4"), (Ra, "Ra"), (Rb, "Rb"), (Rc, "Rc"), (Rd, "Rd"), (Re, "Re") };

string lookup(FunctionIntInt f) => items.First(elt => f == elt.Item1).Item2;

Display the colored operation table:

show_operation_table_colored(D_5, (a, b) => a.Compose(b), lookup); WriteLine();

Console output:

Display subgroups and for each subgroup, show cosets:

ShowGroupCosets(D_5, (a, b) => a.Compose(b), lookup);

Console output:

subgroups:
{ R0 }
{ R0 Ra }
{ R0 Rb }
{ R0 Rc }
{ R0 Rd }
{ R0 Re }
{ R0 R1 R2 R3 R4 }
{ R0 R1 R2 R3 R4 Ra Rb Rc Rd Re }


proper subgroups:
{ R0 Ra }
{ R0 Rb }
{ R0 Rc }
{ R0 Rd }
{ R0 Re }
{ R0 R1 R2 R3 R4 }

------------------------------
H = { R0 Ra }   order is 2   index is 5

cosets:
{ R0 Ra }
{ R1 Re }
{ R2 Rd }
{ R3 Rc }
{ R4 Rb }

{ R0 Ra } R0 = { R0 Ra } Ra = { R0 Ra }
{ R0 Ra } R1 = { R0 Ra } Re = { R1 Re }
{ R0 Ra } R2 = { R0 Ra } Rd = { R2 Rd }
{ R0 Ra } R3 = { R0 Ra } Rc = { R3 Rc }
{ R0 Ra } R4 = { R0 Ra } Rb = { R4 Rb }
------------------------------
H = { R0 Rb }   order is 2   index is 5

cosets:
{ R0 Rb }
{ R1 Ra }
{ R2 Re }
{ R3 Rd }
{ R4 Rc }

{ R0 Rb } R0 = { R0 Rb } Rb = { R0 Rb }
{ R0 Rb } R1 = { R0 Rb } Ra = { R1 Ra }
{ R0 Rb } R2 = { R0 Rb } Re = { R2 Re }
{ R0 Rb } R3 = { R0 Rb } Rd = { R3 Rd }
{ R0 Rb } R4 = { R0 Rb } Rc = { R4 Rc }
------------------------------
H = { R0 Rc }   order is 2   index is 5

cosets:
{ R0 Rc }
{ R1 Rb }
{ R2 Ra }
{ R3 Re }
{ R4 Rd }

{ R0 Rc } R0 = { R0 Rc } Rc = { R0 Rc }
{ R0 Rc } R1 = { R0 Rc } Rb = { R1 Rb }
{ R0 Rc } R2 = { R0 Rc } Ra = { R2 Ra }
{ R0 Rc } R3 = { R0 Rc } Re = { R3 Re }
{ R0 Rc } R4 = { R0 Rc } Rd = { R4 Rd }
------------------------------
H = { R0 Rd }   order is 2   index is 5

cosets:
{ R0 Rd }
{ R1 Rc }
{ R2 Rb }
{ R3 Ra }
{ R4 Re }

{ R0 Rd } R0 = { R0 Rd } Rd = { R0 Rd }
{ R0 Rd } R1 = { R0 Rd } Rc = { R1 Rc }
{ R0 Rd } R2 = { R0 Rd } Rb = { R2 Rb }
{ R0 Rd } R3 = { R0 Rd } Ra = { R3 Ra }
{ R0 Rd } R4 = { R0 Rd } Re = { R4 Re }
------------------------------
H = { R0 Re }   order is 2   index is 5

cosets:
{ R0 Re }
{ R1 Rd }
{ R2 Rc }
{ R3 Rb }
{ R4 Ra }

{ R0 Re } R0 = { R0 Re } Re = { R0 Re }
{ R0 Re } R1 = { R0 Re } Rd = { R1 Rd }
{ R0 Re } R2 = { R0 Re } Rc = { R2 Rc }
{ R0 Re } R3 = { R0 Re } Rb = { R3 Rb }
{ R0 Re } R4 = { R0 Re } Ra = { R4 Ra }
------------------------------
H = { R0 R1 R2 R3 R4 }   order is 5   index is 2

cosets:
{ R0 R1 R2 R3 R4 }
{ Ra Rb Rc Rd Re }

{ R0 R1 R2 R3 R4 } R0 = { R0 R1 R2 R3 R4 } R1 = { R0 R1 R2 R3 R4 } R2 = { R0 R1 R2 R3 R4 } R3 = { R0 R1 R2 R3 R4 } R4 = { R0 R1 R2 R3 R4 }
{ R0 R1 R2 R3 R4 } Ra = { R0 R1 R2 R3 R4 } Rb = { R0 R1 R2 R3 R4 } Rc = { R0 R1 R2 R3 R4 } Rd = { R0 R1 R2 R3 R4 } Re = { Ra Rb Rc Rd Re }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment