Decomposition of a projective transformation of $\mathbb{P}^2$ On page 42 of Hartley-Zisserman's Multiple View geometry in Computer Vision, it states that a projective transformation of the plane (which can be represented by a nonsingular matrix $H$) can be decomposed in the form $$ H = H_S H_A H_p = \begin{bmatrix} sR & \mathbf{t} \\ \mathbf{0}^T & 1 \end{bmatrix}\begin{bmatrix} K & \mathbf{0} \\ \mathbf{0}^T & 1\end{bmatrix}\begin{bmatrix} I & \mathbf{0} \\ \mathbf{v}^T & v\end{bmatrix} = \begin{bmatrix}A & \mathbf{t} \\ \mathbf{v}^T & v \end{bmatrix}$$ if $v \neq 0$. Here $s$ is non-zero, $R \in \mathbb{O}(2)$, and $K$ is upper triangular with determinant 1.
It can easily be checked that the left side multiplies to $$\begin{bmatrix} sRK + \mathbf{t} \mathbf{v}^T & v \mathbf{t} \\ \mathbf{v} & v\end{bmatrix}$$ So we essentially just need to show that we can write an arbitrary 2x2 matrix $A$ in the form $A = sRK + tv^T$ where $s,R, K$ are as above.
I don't see how this can be true because if $A - tv^T$ has rank 1 then it wouldn't be possible to write it in the form $sR K$ since $R$ and $K$ are invertible. Otherwise I suppose the QR factorization can help write it in the desired form, but I'm not able to see it.
Also the result states that this decomposition is unique if $s$ is chosen to be positive, I'm not sure how to see that either. If $A = QR$ where $Q$ is orthogonal and $R$ is upper triangular, then we could factor out from either the top row and bottom row for $s$ and we would get $A = sQR$ in the appropriate form with $\det R = 1$ so I'm unable to see why this result holds.
I tried looking in multiple places for this result but every time it seems to be stated without proof citing this source.
 A: It appears to me there is some small typo in the book, since (as you wrote) the top-right entry of $H_SH_AH_P$ is $v\mathbf t$ whereas the top-right entry of the right-hand side is just $\mathbf t$. This can be rectified by either changing the $\mathbf t$ in $H_S$ to $\mathbf t / v$, the $\mathbf t$ on the right hand side to $v \mathbf t$ or by assuming that $v = 1$ since we are working with projective transformations. For the most part this typo does not really affect the decomposition since these changes do not affect the type of the transformations, but for clarity I will write $$H_S = \pmatrix{sR & \frac{1}{v}\mathbf{t} \\ \mathbf{v}^T & 1}.$$
In this case, the left side multiplies to $$
H_SH_AH_P = \pmatrix{sRK + \frac{1}{v}\mathbf{t}\mathbf{v}^T 
 & \mathbf t \\ \mathbf{v}^T & v}
$$
So we have to show we can write an arbitrary non-singular matrix $A$ in the form $sRK + \frac{1}{v}\mathbf{t}\mathbf{v}^T$. As you mentioned, $sRK$ is invertible, so we must show that $A - \frac{1}{v} \mathbf{t}\mathbf{v}^T$ is invertible. Assume to the contrary that $\det(A - \frac{1}{v} \mathbf{t}\mathbf{v}^T) = 0$
Then $$
\det H = \det(v)\det(A - \mathbf{t}v^{-1}\mathbf{v}^t) = 0,
$$
a contradiction. So $A - \frac{1}{v} \mathbf{t}\mathbf{v}^T$ is invertible.
Thus, we have a $QR$-decomposition
$$A - \frac{1}{v}\mathbf{t}\mathbf{v}^T = RK',$$ with $R \in \mathbb{O}^2$ and $K'$ upper triangular. This decomposition is unique up to a factor $\pm 1$ for $R$ and $K'$, since the left hand side is invertible. Now, we can scale $K' = sK$ so that $K$ has determinant $1$ and $A - \frac{1}{v}\mathbf{t}\mathbf{v}^T = sRK$, and by replacing $R$ with $-R$ if necessary we can assume $s > 0$. This will give you the desired decomposition.
About uniqueness, it seems to me that requiring $\det K = 1$ is enough to uniquely determine $H_A$, $H_S$ and $H_P$, but maybe there's something I'm missing here.
