Symmetry group of hypercube in $\mathbb{R}^4$ Let $ T= \{(x, y, z, w) \in \mathbb{R}^4 \text{ }|\text{ }|x|,\, |y|,\,|z|,\,|w| \le 1\}$ be the hypercube in $\mathbb{R}^4$ of side length $2$ centered at the origin. Identify the symmetry group of $T$.
 A: First of all, it is a worthwhile exercise to identify the set $H$ of hyperfaces $($which are cubes of side length $2)$ and verify that $|H| = 8$.
Choose any hyperface of $T$. This hyperface can be taken to any of the $8$ hyperfaces of $T$, and then transformed via the symmetry group of a cube, which has order $48$. Doing this fixes a symmetry of the entire hypercube, so $|\text{Aut}(T)| = 8(48) = 384$.

In the interests of completeness, we now answer a more a general question, Exercise M.4 from Chapter 6 of Artin's Algebra.

With coordinates $x_1, \dots, x_n$ in $\mathbb{R}^n$ as usual, the set of points defined by the inequalities $-1 \le x_i \le +1$, for $i = 1, \dots, n$, is an $n$-dimensional hypercube $\mathcal{C}_n$. The $1$-dimensional hypercube is a line segment and the $2$-dimensional hypercube is a square. The $4$-dimensional hypercube has eight face cubes, the $3$-dimensional cubes defined by $\{x_i = 1\}$ and by $\{x_i = -1\}$, for $i = 1, 2, 3, 4$, and it has $16$ vertices $(\pm1,\pm1,\pm1,\pm1)$.
Let $G_n$ denote the subgroup of the orthogonal group $O_n$ of elements that send the hypercube to itself, the group of symmetries of $\mathcal{C}_n$, including the orientation-reversing symmetries. Permutations of the coordinates and sign changes are among the elements of $G_n$.

*

*Use the counting formula and induction to determine the order of the group $G_n$.

*Describe $G_n$ explicitly, and identify the stabilizer of the vertex $(1, \dots, 1)$. Check your answer by showing that $G_2$ is isomorphic to the dihedral group $D_4$.


Lemma. Let $A\in O_n$ be an orthogonal matrix $($$AA^\text{T} = A^\text{T} A = I_n$$)$ and $A_1, \dots,A_n$ be the rows of $A$. Then $A\in G_n$ if and only if $A$ sends the set of vertices $(\pm1, \dots,\pm1)$ of the hypercube to itself.
Proof. If $A\in G_n$, then for a fixed choice of signs $\epsilon_1,\dots,\epsilon_n\in\{-1,1\}$, $f(x) = (\epsilon_1,\ldots,\epsilon_n)Ax^\text{T}$ $(x\in\mathcal{C}_n)$, a continuous real function over the compact set $\mathcal{C}_n$, is maximized at some boundary point $($vertex$)$ $v = (\epsilon'_1,\ldots,\epsilon'_n)\in\{-1,1\}^n$. But we know $f$ has maximum $\sum \epsilon_i^2 = n$ attained only when $Ax^\text{T} = (\epsilon_1,\ldots,\epsilon_n)^\text{T}$, so $Av^\text{T} = Ax^\text{T}\implies v=x=(\epsilon_1,\ldots,\epsilon_n)A$. Thus every vertex $(\epsilon_1,\ldots,\epsilon_n)^\text{T}$ of $A$ can be uniquely expressed as $Av^\text{T}$ for some vertex $v$, so by a counting argument each vertex must occur exactly once, and $A$ fixes the set of vertices of $\mathcal{C}_n$.
Conversely, suppose $A$ fixed the set of vertices of $\mathcal{C}_n$. If we label the vertex $v_1,\ldots,v_{2^n}$, then a point $x\in\mathbb{R}^n$ lies in $\mathcal{C}_n$ if and only if it can be written in the form $\lambda_1v_1+\dots+\lambda_{2^n}v_{2^n}$ for some nonnegative weights $\lambda_i$ summing up to $1$. It follows that a point $y\in\mathbb{R}^n$ lies in $A\mathcal{C}_n$ if and only if it can be written in the form $\sum \lambda_i (Av_i^\text{T})$. But the $Av_i^\text{T}$ are simply a permutation of the $v_i$, so $A\mathcal{C}_n = \mathcal{C}_n$, as desired. $\square$
Now take $A\in G_n$ with rows $A_1,\ldots,A_n$. Then $A_i\cdot (\epsilon_1,\ldots,\epsilon_n) = \pm1$ for $\epsilon_i=\pm1$. But then $A_i\cdot(-\epsilon_1,\epsilon_2,\ldots,\epsilon_n)=\pm1$ as well, so subtracting yields $a_{i1} = A_i\cdot(1,0,\ldots,0) \in\{-1,0,1\}$. By symmetry, $A\in\{-1,0,1\}^{n\times n}$. Now if $A_i\in\mathcal{C}_n$, so $-1\le A_i\cdot A_i\le 1$, whence $A_i$ has at most $1$ nonzero term. But it cannot have all zeros $($otherwise $A_i\cdot(1,\ldots,1)$ would vanish$)$, so it must have exactly $1$ term equal to $\pm1$, and everything else equal to $0$. Let this $\pm1$ term be at index $k_i$. Then $k_i\ne k_j$ when $i\ne j$, or else $Ax^\text{T}$ will have equal $i$ and $j$ coordinates for all $x$ $($and we certainly cannot hit all of $\mathcal{C}_n$$)$. It follows that $k_1,\ldots,k_n$ is a permutation of $1,2,\ldots,n$.
Conversely, if $A$ has $\epsilon_i = \pm1$'s at entries $(i,\pi(i))$ $($for a fixed permutation $\pi\in S_n$$)$ and $0$'s elsewhere, then clearly $AA^\text{T} = I_n$ and $A\mathcal{C}_n = \mathcal{C}_n$: $A$ simply flips the sign of the $i$th coordinate by $\epsilon_i$ for every $i$, and afterwards permutes the coordinates according to $j\to\pi(j)$.
1.
By part $(2)$, $|G_n| = n!2^n$ $($$n!$ choices for $\pi$ and then $2$ for each $t_i)$.
We can also do this using induction, as suggested: instead let $G_n$ act on the set of hyperfaces $[-1,1]^{i-1}\times\{\epsilon_i\}\times[-1,1]^{n-i}$, for some $1\le i\le n$ and $\epsilon_i=\pm1$. Then the stabilizer of $[-1,1]^{n-1}\times\{+1\}$ is the subset of $G_n$ fixing the $n$th coordinate, which is isomorphic to $G_{n-1}$ $($in terms of our matrix $A$, we have row $n$ and column $n$ empty except for a $+1$ at $(n,n)$, and the upper left $(n-1)\times(n-1)$ matrix lies in $G_{n-1}$$)$, and the orbit is the set of all $2n$ hyperfaces. So $|G_n| = 2n|G_{n-1}|$, and clearly $|G_1| = 2$, so by induction $|G_n| = 2^n n!$.
2.
Let $P_\pi$ denote the permutation matrix corresponding to a permutation $\pi$ $($$1$'s at $(i,\pi(i))$$)$, and $Z_i$ denote the diagonal matrix with a $-1$ at $(i,i)$ and $+1$'s at the other diagonal entries. By the previous discussion, $A\in G_n$ if and only if $A = P_\pi Z_1^{t_1} \dots Z_n^{t_n}$ for some permutation $\pi\in S_n$ and $t_1,\ldots,t_n\in\{0,1\}$. $($In other words, $G_n$ consists of the matrices that can be obtained from permutation matrices by changing signs.$)$
Then $A(1,\ldots,1)^\text{T} = \left((-1)^{t_1},\ldots,(-1)^{t_n}\right)^\text{T}$, so the stabilizer of $(1,\ldots,1)$ is the set of permutation matrices $P_\pi$.
For $n=2$, $G_n$ is generated by $$\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} \cos\frac\pi2 & -\sin\frac\pi2 \\ \sin\frac\pi2 & \cos\frac\pi2 \end{pmatrix} \text{ and } \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},$$ and thus isomorphic to the dihedral group $D_4$.
$($Indeed, one could have begun this entire question by working out the group explicitly in dimension $2$ to build some intuition. We know that the symmetries of a square from the dihedral group, but here we want the orthogonal matrices that correspond to the symmetries. They are the eight matrices$$\begin{pmatrix} \pm1 & 0 \\ 0 & \pm1 \end{pmatrix}\text{ and }\begin{pmatrix} 0 & \pm1 \\ \pm1 & 0 \end{pmatrix},$$which is, of course, the group $D_4$.$)$
A: Hypercube is dual to the hyperoctahedron, which has 4 diagonals. So, we are allowed to permute these diagonals and we also can flip any diagonal. Thus, obtain the so called hyperoctahedral group or signed symmetric group of degree 4. It is the wreath product of $\mathbb{Z}_2$ (the group of order 2) by $S_4$ (the symmetric group of degree 4). 
