[step:Parametrize the primitive Pythagorean triple]
We use the following elementary form of the primitive Pythagorean triple parametrisation.
[claim:Primitive Pythagorean triples have Euclidean parameters]
Let $A,B,C \in \mathbb{N}$ satisfy
\begin{align*}
A^2+B^2=C^2,
\end{align*}
with $\gcd(A,B)=1$ and $B$ even. Then there exist coprime positive integers $m,n \in \mathbb{N}$ with $m>n$ and opposite parity such that
\begin{align*}
A=m^2-n^2,\qquad B=2mn,\qquad C=m^2+n^2.
\end{align*}
[/claim]
[proof]
Since $\gcd(A,B)=1$ and $B$ is even, $A$ is odd. Hence $C^2=A^2+B^2$ is odd, so $C$ is odd. Define positive integers
\begin{align*}
R:=\frac{C+A}{2},\qquad S:=\frac{C-A}{2}.
\end{align*}
Then $R>S>0$ and
\begin{align*}
RS=\frac{(C+A)(C-A)}{4}=\frac{C^2-A^2}{4}=\frac{B^2}{4}.
\end{align*}
We claim that $\gcd(R,S)=1$. If a positive integer $q$ divides both $R$ and $S$, then $q$ divides $R+S=C$ and $R-S=A$. Hence $q$ divides $\gcd(A,C)$. But any common divisor of $A$ and $C$ also divides $C^2-A^2=B^2$, and therefore divides $B$; since $\gcd(A,B)=1$, we get $q=1$.
Since $R$ and $S$ are coprime and their product is the square $(B/2)^2$, unique prime factorisation implies that each is a square. Thus there exist positive integers $m,n \in \mathbb{N}$ such that
\begin{align*}
R=m^2,\qquad S=n^2.
\end{align*}
Then
\begin{align*}
A=R-S=m^2-n^2,\qquad C=R+S=m^2+n^2,\qquad \frac{B^2}{4}=m^2n^2.
\end{align*}
Since $B,m,n$ are positive, the last equality gives $B=2mn$. The relation $\gcd(R,S)=1$ gives $\gcd(m,n)=1$. Finally, $m$ and $n$ have opposite parity, because if they were both odd then $A=m^2-n^2$ would be even, contradicting that $A$ is odd; they cannot both be even because they are coprime.
[/proof]
Applying the claim with $A=x^2$, $B=y^2$, and $C=z$, we obtain coprime positive integers $m,n \in \mathbb{N}$ with $m>n$ and opposite parity such that
\begin{align*}
x^2=m^2-n^2,\qquad y^2=2mn,\qquad z=m^2+n^2.
\end{align*}
[/step]