# Dihedral group of order 8

In mathematics, D$_4$ (sometimes alternatively denoted by D$_8$) is the dihedral group of degree 4 and order 8. It is the symmetry group of a square.

## Symmetries of a square

As an example, we consider a glass square of a certain thickness with a letter "F" written on it to make the different positions distinguishable. In order to describe its symmetry, we form the set of all those rigid movements of the square that do not make a visible difference (except the "F"). For instance, if an object turned 90° clockwise still looks the same, the movement is one element of the set, for instance a. We could also flip it around a vertical axis so that its bottom surface becomes its top surface, while the left edge becomes the right edge. Again, after performing this movement, the glass square looks the same, so this is also an element of our set and we call it b. The movement that does nothing is denoted by e.
Given two such movements x and y, it is possible to define the composition x ∘ y as above: first the movement y is performed, followed by the movement x. The result will leave the slab looking like before.
The set of all those movements, with composition as the operation, forms a group. This group is the most concise description of the square's symmetry.

### Generating the group

Applying two symmetry transformations in succession yields a symmetry transformation. For instance a ∘ a, also written as a$^2$, is a 180° degree turn. a$^3$ is a 270° clockwise rotation (or a 90° counter-clockwise rotation). We also see that b$^2$ = e and also a$^4$ = e. A horizontal flip followed by a rotation, a ∘ b is the same as b ∘ a$^3$. Also, a$^2$ ∘ b is a vertical flip and is equal to b ∘ a$^2$.
The two elements a and b generate the group, because all of the group's elements can be written as products of powers of a and b.
This group of order 8 has the following Cayley table:
| ∘ | e | b | a | a$^2$ | a$^3$ | ab | a$^2$b | a$^3$b |
| e | e | b | a | a$^2$ | a$^3$ | ab | a$^2$b | a$^3$b |
| b | b | e | a$^3$b | a$^2$b | ab | a$^3$ | a$^2$ | a |
| a | a | ab | a$^2$ | a$^3$ | e | a$^2$b | a$^3$b | b |
| a$^2$ | a$^2$ | a$^2$b | a$^3$ | e | a | a$^3$b | b | ab |
| a$^3$ | a$^3$ | a$^3$b | e | a | a$^2$ | b | ab | a$^2$b |
| ab | ab | a | b | a$^3$b | a$^2$b | e | a$^3$ | a$^2$ |
| a$^2$b | a$^2$b | a$^2$ | ab | b | a$^3$b | a | e | a$^3$ |
| a$^3$b | a$^3$b | a$^3$ | a$^2$b | ab | b | a$^2$ | a | e |
For any two elements in the group, the table records what their composition is. Here we wrote "a$^3$b" as a shorthand for a$^3$ ∘ b. This group has 5 conjugacy classes, they are $\{e\},\{a\},\{b,ba^{2}\},\{ba,ba^{3}\},{\text{ and }}\{a,a^{3}\}$.
In mathematics this group is known as the dihedral group of order 8, and is either denoted Dih$_4$, D$_4$ or D$_8$, 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 C$_8$ and the direct products of cyclic groups C$_4$×C$_2$ and C$_2$×C$_2$×C$_2$. The other two, the dihedral group of order 8 and the quaternion group, are not.

### Normal subgroups

This version of the Cayley table shows one of the 4 proper non-trivial normal subgroups, shown with a red background. In this table r means rotations, and f means flips. Because the subgroup is normal, the left coset is the same as the right coset.
    Group table of D$_4$ e r$_1$ r$_2$ r$_3$ f$_v$f$_h$f$_d$f$_c$ e e r$_1$ r$_2$ r$_3$f$_v$f$_h$f$_d$ f$_c$ r$_1$ r$_1$ r$_2$ r$_3$ ef$_c$f$_d$f$_v$ f$_h$ r$_2$ r$_2$ r$_3$ e r$_1$f$_h$f$_v$f$_c$ f$_d$ r$_3$ r$_3$ e r$_1$ r$_2$f$_d$f$_c$f$_h$ f$_v$ f$_v$ f$_v$f$_d$f$_h$f$_c$er$_2$r$_1$r$_3$ f$_h$ f$_h$f$_c$f$_v$f$_d$r$_2$er$_3$r$_1$ f$_d$ f$_d$f$_h$f$_c$f$_v$r$_3$r$_1$er$_2$ f$_c$ f$_c$ f$_v$ f$_d$ f$_h$r$_1$r$_3$r$_2$e The elements e, r$_1$, r$_2$, and r$_3$ form a subgroup, highlighted in red (upper left region). A left and right coset of this subgroup is highlighted in green (in the last row) and yellow (last column), respectively.