I have trouble understanding the derivation of the law of velocity addition from the composition of Lorentz transformations. The proof is from Special Relativity by Nicholas Woodhouse:
The author sets up three reference frames $O,O'$ and $O''$, where $O'$ moves with velocity $u$ relative to $O$, $O$ with $v$ relative to $O''$ and $O'$ with $w$ relative to $O''$:
$\begin{pmatrix} ct\\ x \end{pmatrix} = \gamma(u)\begin{pmatrix} 1 & \frac{u}{c} \\ \frac{u}{c} & 1 \end{pmatrix}\begin{pmatrix} ct'\\x' \end{pmatrix}$
$\begin{pmatrix} ct''\\ x'' \end{pmatrix} = \gamma(v)\begin{pmatrix} 1 & \frac{v}{c} \\ \frac{v}{c} & 1 \end{pmatrix}\begin{pmatrix} ct\\x \end{pmatrix}$
$\begin{pmatrix} ct''\\ x'' \end{pmatrix} = \gamma(w)\begin{pmatrix} 1 & \frac{w}{c} \\ \frac{w}{c} & 1 \end{pmatrix}\begin{pmatrix} ct'\\x' \end{pmatrix}$
From there follows that $\gamma (w)\begin{pmatrix} 1 &\frac{w}{c} \\ \frac{w}{c} & 1 \end{pmatrix} = \gamma(u) \gamma(v)\begin{pmatrix} 1 & \frac{v}{c} \\ \frac{v}{c} & 1 \end{pmatrix}\begin{pmatrix} 1 & \frac{u}{c} \\ \frac{u}{c} & 1 \end{pmatrix}$.
The the author states that because of that $\gamma(w)=\gamma(u)\gamma(v)(1+\frac{uv}{c^2}$). How does that follow from the above equation? I can see that it holds if $w=\frac{u+v}{1+\frac{uv}{c^2}}$ which is the law of velocity addition. But isn't that circular reasoning? Couldn't you say for example that $\gamma(w)=\gamma(u)\gamma(v)$ if $w=v+u$?
My question is how can you derive the law of velocity addition from the composition of Lorentz transformations without assuming it a priori? Or am I missing something here?