Solution (source code)

= Solution

Write the <symmetry group of a square> as $D_4=\langle r,s\mid r^4=s^2=e,\ srs=r^{-1}\rangle$, with $r$ a counterclockwise quarter-turn and $s$ <reflection> across the horizontal axis. The <conjugacy classes of the symmetry group of a square> are
$$
\boxed{\{e\},\qquad\{r^2\},\qquad\{r,r^3\},\qquad\{s,r^2s\},\qquad\{rs,r^3s\}.}
$$
Here $r^2$ is the half-turn and $r^3$ the clockwise quarter-turn. The two members of the fourth class reflect across the horizontal and vertical axes. Those of the fifth reflect across $y=x$ and $y=-x$. The identity and half-turn are <central elements>, giving singleton classes. The relations $srs=r^3$, $rsr^{-1}=r^2s$, and $r(rs)r^{-1}=r^3s$ show that each displayed pair consists of conjugate elements. More generally, conjugating $r^ks$ by $r$ changes $k$ to $k+2$, and conjugating by $s$ changes $k$ to $-k$; parity is preserved, so the two <reflection> pairs cannot merge.

In a <one-dimensional representation>, the relation $srs=r^{-1}$ forces the image of $r$ to equal its inverse. Thus $r$ and $s$ can be assigned independent signs $\alpha,\beta\in\{1,-1\}$. These four choices give four <irreducible characters>. The ordinary two-dimensional action on the plane gives one more <character>: a <rotation> through $\theta$ has <trace> $2\cos\theta$, and a <reflection> has <trace> zero. Therefore the <character table of the symmetry group of a square> is
$$
\begin{array}{c|rrrrr}
&e&r^2&\{r,r^3\}&\{s,r^2s\}&\{rs,r^3s\}\\\hline
\text{class size}&1&1&2&2&2\\\hline
A_1&1&1&1&1&1\\A_2&1&1&1&-1&-1\\B_1&1&1&-1&1&-1\\B_2&1&1&-1&-1&1\\E&2&-2&0&0&0
\end{array}.
$$
For instance the last row has squared character norm $(4+4)/8=1$, so the planar <representation> is <irreducible>; its inner product with each one-dimensional row is zero. All five rows obey <character orthogonality>. Their squared dimensions sum to $1+1+1+1+4=8$, so they exhaust the <irreducible representations> of this order-eight <group>.