I was looking at this identity (see below) from Wikipedia, and I don't quite understand how you can add and multiply elements from $S$. Elements of $S$ are sequences of -1's and 1's, so how are arithmetic operations defined? Or am I misunderstanding the notation? Could someone give an example of how this sum is carried out for, let's say, n=4?
\begin{align*} \prod_{k=1}^n \cos \theta_k & = \frac{1}{2^n}\sum_{e\in S} \cos(e_1\theta_1+\cdots+e_n\theta_n) \end{align*} where $S=\{1,-1\}^n$.
Also, is there any deeper meaning to this identity, or is it just a result of algebraic/geometric acrobatics?