Clear and convenient notation for choice of signs $(\pm 1)$ in an expression We often encounter an arbitrary choice of signs in solutions of equations and other things. For example, the orthogonal group $O(2)$ can be written as a double cover
$$
O(2)=SO(2)\cup \begin{bmatrix} 1&0\\0&-1 \end{bmatrix}SO(2).
$$
So, when we want to write done the general form of a matrix in $O(2),$ we need to write
$$
\begin{bmatrix} 1&0\\0&-1 \end{bmatrix}^{j}\begin{bmatrix} \cos \theta&-\sin \theta\\\sin \theta&\cos \theta \end{bmatrix},
$$
where $j=0,1.$
It is often very awkward to use the right notation for this choice of sign. For example, if we use a simplier notation
$$
\begin{bmatrix} 1&0\\0&\pm 1 \end{bmatrix}\begin{bmatrix} \cos \theta&-\sin \theta\\\sin \theta&\cos \theta \end{bmatrix},
$$
then we will run into trouble when we are trying to prove, for example, $O(2)$ is closed under multiplication, since if we write done two elements of $O(2)$ of the form
$$
\begin{bmatrix} 1&0\\0&\pm 1 \end{bmatrix}\begin{bmatrix} \cos \theta&-\sin \theta\\\sin \theta&\cos \theta \end{bmatrix},\begin{bmatrix} 1&0\\0&\pm 1 \end{bmatrix}\begin{bmatrix} \cos \theta'&-\sin \theta'\\\sin \theta'&\cos \theta' \end{bmatrix},
$$
we are assuming that  the two elements take the same sign, and therefore they do not represent an arbitrary choice of two elements, which is annoying.
If we instead just do separate calculations for each sign, then we are essentially doing the same thing several times, so this is not a good option as well.
What is the best way to manage signs like this?
I put done the group theory tag because that's where many questions about signs arise.

To give a "general" answer, we can combine both the comments of mine and Cameron to first note that we can keep $(-1)^n$ and $(-1)^m$ for this particular case.
Of course, along the way, we would use the "closure" property like $(-1)^n \cdot (-1)^m = (-1)^{m+n}$ and the fact that $(-1)^2 = 1$.
In general, when working with $k$-th roots of unity, you could assume them as $\omega^{n}$ and $\omega^{m}$, where $\omega = \exp\left(\dfrac{2\pi\iota}{k}\right)$ is a primitive $k$-th root of unity.
