Let
u=u(x,y,z)=3x−2y−2z,
v=v(x,y,z)=−2x+2y+z,
w=w(x,y,z)=−2x+y+2z.
First of all, if (x,y,z)=(5,4,3) is a primitive Pythagorean triplet with x>y>z>0, then, it is easy to check that u2=v2+w2. Further, x2+(2y−2z)2>0⇒9x2>4y2+4z2+8yz⇒3x>2y+2z⇒u(x,y,z)>0.
Similarly, we have 4y>3z⇒4yz−3z2>0⇒4y2+z2+4yz>4x2⇒2y+z>2x⇒v(x,y,z)>0.
Next, (3y−4z)2>0⇒25x2+(3y−4z)2>25x2⇒25x2>16y2+9z2+24yz⇒25x2>(4y+3x)2⇒5x>4y+3z⇒u(x,y,z)>v(x,y,z).
Similarly, we have u(x,y,z)>w(x,y,z). Also, since x>y, it follows that u(x,y,z)>−w(x,y,z). And, y>z implies v(x,y,z)>w(x,y,z). Finally, we notice that if y+z>x then it follows that u(x,y,z)<x. Now, let
f1(x,y,z)=(u,v,w),
g1(x,y,z)=(u,v,−w),
h1(x,y,z)=(u,−w,v).
Then, it is easy to see that f1(f(x,y,z))=g1(g(x,y,z))=h1(h(x,y,z))=(x,y,z). Further, it is easy to check that gcd(u,v,w)=gcd(x,y,z).
Now, we shall prove the result by contradiction. If there are primitive Pythagorean triplets that are not obtained from (5,4,3) by repeated application of f,g and h in some order, then let (a,b,c) be the triplet that cannot be obtained from (5,4,3) with a>b>c>0 and with least possible value for a. So, all the primitive Pythagorean triplets (x,y,z) with a>x>y>z>0 are obtained from (5,4,3) (uniquely). Clearly, we have a>5.
Now, let f1(a,b,c)=(k,l,m). Then, g1(a,b,c)=(k,l,−m) and h1(a,b,c)=(k,−m,l). As noted before, k and l are positive, and k>l,k>m and k>−m. Thus, there is a unique Δ∈{f1,g1,h1} such that Δ(a,b,c)=(r,s,t) with r>s>t>0. Also, from the previous calculations, we have
that a>r. Thus, by the minimality of a, it follows that (r,s,t) is obtained from (5,4,3), in a unique way, by repeated applications of f,g,h in some order. But, now Δ(a,b,c)=(r,s,t) implies that by applying one of f,g and h to (r,s,t) we would get (a,b,c). Therefore, we can obtain (a,b,c) from (5,4,3) by repeated applications of f,g,h in some order. This is a contradiction. Uniqueness follows from the uniqueness of Δ. This completes the solution.