I tried to prove the following rules algebraically: $90$ degree rotation. $(x,y)\to(-y,x)$:

I got 2 results at the end. However, I can't come up with a rigorous way to eliminate one of them (maybe this can be done using some mathematical definitions?). Furthermore, I wonder if it's possible to incorporate the fact that the rotation is counterclockwise into the proof itself, thus the proof will only give 1 result?

Embed it to a three dimensional plane and use cross product,
$$\begin{bmatrix} x \\ y \\ 0 \end{bmatrix} \times \begin{bmatrix} -y \\ x \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ x^2 + y^2\end{bmatrix}$$
It point upwards, it is clockwise.
$$\begin{bmatrix} x \\ y \\ 0 \end{bmatrix} \times \begin{bmatrix} y \\ -x \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ -(x^2 + y^2)\end{bmatrix}$$
It points downwards, it is anti-clockwise.