Dihedral group of order 8

In mathematics, Template:Math (sometimes alternatively denoted by Template:Math) is the dihedral group of degree 4 and order 8. It is the symmetry group of a square.[1][2] A square maintains its appearance under 90° rotations about its center (4-fold rotational symmetry), and under reflections across four lines passing through the center – two lines parallel to the sides and its two diagonals (reflection symmetry).[3]
Symmetries of a square
Consider a square of a certain thickness with the letter "F" written on it to make the different positions distinguishable. In order to describe its symmetry, one can form the set of all those rigid movements of the square that do not make a visible difference (except the "F"); each of these is a symmetry transformation. For instance, when the square is turned 90° clockwise or reflected across its vertical axis, it still looks the same, so these two movements are symmetry transformations.
Every point inside the square which does not lie on any of its four axes of symmetry will be mapped to 8 distinct points by these transformations, collectively called the point's orbit. An octant of the square (the region between one horizontal or vertical axis and one diagonal axis, an isosceles right triangle) is a fundamental domain of the square's surface under these symmetry transformations, containing one point from each possible orbit. One octant is highlighted in blue in the images above, to show how each symmetry transformation maps it onto a distinct octant.
Generating the group
a is the clockwise rotation
and b the horizontal reflection.

With composition as the operation, the set of all those movements forms a group: Applying two symmetry transformations in succession yields a symmetry transformation, so the transformations are closed under composition. The symmetries of the square can be fully described by this group's Cayley table, analogous to a multiplication table but using the group operation instead of multiplication. To draw such a table explicitly, each symmetry must be assigned some symbol. In the following table, each symmetry is represented concretely by a curved arrow (rotation), double-ended arrow (reflection), or dot (identity transformation), corresponding to the images above:
Each entry in this table represents the composition of two symmetries: that is, the symmetry transformation resulting from performing first the symmetry transformation for the column and then performing the symmetry transformation for the row. For instance, a reflection in the diagonal NE–SW direction Template:Nobr followed by a horizontal reflection Template:Nobr is equivalent to a three-quarters-turn rotation anticlockwise Template:Nobr which can be written as an equation Template:Nobr, using the convention that means applying Template:Tmath after Template:Tmath. Thus the table entry for row
and column
is
.
Instead of pictorial symbols, mathematicians more commonly use letters. The juxtaposition of two letters Template:Tmath represents the composition of their respective symmetries Template:Tmath, and an integer superscript represents the composition of the same symmetry multiple times, e.g. Template:Tmath represents Template:Tmath and Template:Tmath represents the inverse of Template:Tmath. The letter Template:Tmath is commonly used for the identity element. The use of this shorthand reduces the number of distinct symbols required to represent group elements.
Any element which can be written as the composition of a particular set of elements is said to be generated by those elements, for example the element Template:Tmath is generated by Template:Tmath and Template:Tmath; any set of elements which generates the whole group is called a generating set of the group. Every dihedral group can be generated from two elements, so only three elements of the group (those two and the identity) need be assigned symbols, and the other elements can be expressed by combining them.
The symmetries of the square can be generated in two basic ways: using one diagonal reflection and one horizontal or vertical reflection, or using one quarter-turn rotation and one reflection. For example, letting the letter Template:Tmath represent a quarter-turn rotation anticlockwise Template:Nobr, letting the letter Template:Tmath represent a vertical reflection Template:Nobr, and letting the letter Template:Tmath represent a diagonal NW–SE reflection Template:Nobr, any pair of these elements generates the group, and the rest of the group elements can be written in terms of these. Concretely, each symmetry could be written as any of the following (the various expressions in each row represent the same symmetry):
Even after choosing a pair of generators, these expressions are not unique, e.g. Template:Tmath. If for example we use the first column above to name the group elements, the Cayley table could be written as:
Two elements Template:Tmath and Template:Tmath are conjugate to each-other if there is an element Template:Tmath such that Template:Tmath. The set of all elements which are pairwise conjugate is called a conjugacy class. These classes are important because two elements which are conjugate to each-other cannot be distinguished using only the group structure. The dihedral group of order 8 has 5 conjugacy classes: Template:Nobr, Template:Nobr, Template:Nobr, Template:Nobr, Template:Nobr.
In mathematics this group is known as the dihedral group of order 8, and is either denoted Dih4, D4 or D8, depending on the convention. This is an example of a non-abelian group: the operation here is not commutative, which can be seen from the table; the table is not symmetrical about the main diagonal.
There are five different groups of order 8. Three of them are abelian: the cyclic group C8 and the direct products of cyclic groups C4×C2 and C2×C2×C2. The other two, the dihedral group of order 8 and the quaternion group, are not.[4]
Permutation representation

The action of a rotation or diagonal reflection on the corners of a square, numbered consecutively, can be obtained by the two permutations (1234) and (13), respectively. As the positions of all four corners uniquely determine the element of the symmetries of the square used to obtain those positions, and so the group of symmetries of a square is isomorphic to the permutation group generated by (1234) and (13). Template:-
Matrix representation
Symmetry transformations of an axis-aligned square centered at the origin are linear transformations, so can be represented by matrices acting on the plane by multiplication on column vectors of coordinates . Specifically, these transformations correspond to signed permutation matrices.
The identity transformation Template:Nobr is represented by the identity matrix . A horizontal reflection Template:Nobr is represented by the matrix which negates the Template:Tmath coordinate, while a vertical reflection Template:Nobr is represented by the matrix which negates the Template:Tmath coordinate. The NW–SE diagonal reflection Template:Nobr is represented by the matrix which exchanges the two coordinates, while the NE–SW diagonal reflection Template:Nobr is represented by its negative Template:Nobr A rotation anticlockwise by a quarter turn Template:Nobr is represented by the matrix Template:Nobr and a rotation by three quarters of a turn Template:Nobr by its negative Template:Nobr Finally, a rotation by a half-turn Template:Nobr, equivalent to a reflection across the center point, is represented by the matrix which negates both coordinates. The group composition operation is represented as matrix multiplication.
Larger signed permutation matrices represent in the same way the hyperoctahedral groups, the groups of symmetries of higher dimensional cubes, octahedra, hypercubes, and cross polytopes.[5]
Subgroups
A subgroup of a group is a subset of the elements which also form a group. Template:Math has three subgroups of order four: one consisting of the four rotations of the square by quarter turns Template:Nobr which is a cyclic group of order 4, and two others generated by pairs of perpendicular reflections Template:Nobr and Template:Nobr each of which is a dihedral group Template:Math (also known as the Klein four-group). Each of the four reflections generates a cyclic subgroup of order 2 Template:Nobr Template:Nobr Template:Nobr Template:Nobr. One final cyclic subgroup of order 2 consists of the rotations by half-turns Template:Nobr
For every subgroup Template:Math in Template:Math, the group can be split into a collection of disjoint subsets of the same size (cardinality) as Template:Math, called cosets. There are both left cosets, of the form and right cosets, sets of the form Template:Nobr For example, the subgroup Template:Nobr has four left cosets, Template:Bi and four right cosets, Template:Bi
Normal subgroups
A subgroup is called normal if it contains all of the conjugates of its elements. Both of the groups of rotations, as well as the dihedral groups of order 4, are normal subgroups. The four subgroups generated by a single reflection are not normal.
For a normal subgroup, the left and right cosets coincide, and the cosets themselves form a quotient group.
This version of the Cayley table shows one of these normal subgroups, shown with a red background. In this table r means rotations, and f means flips. Because this subgroup is normal, the left coset is the same as the right coset.
Group table of D4 e r1 r2 r3 fv fh fd fc e e r1 r2 r3 fv fh fd fc r1 r1 r2 r3 e fc fd fv fh r2 r2 r3 e r1 fh fv fc fd r3 r3 e r1 r2 fd fc fh fv fv fv fd fh fc e r2 r1 r3 fh fh fc fv fd r2 e r3 r1 fd fd fh fc fv r3 r1 e r2 fc fc fv fd fh r1 r3 r2 e The elements e, r1, r2, and r3 form a subgroup, highlighted in Template:Color box red (upper left region). A left and right coset of this subgroup is highlighted in Template:Color box green (in the last row) and Template:Color box yellow (last column), respectively.