Complex Extensions, Pythagorean Triples

Pythagorean Triples

Before we look at other complex extensions of Z, let's apply the gaussian integers to a problem that is over 2,000 years old. Characterize the integer solutions for x2 + y2 = z2. These are called pythagorean triples, because they form the sides of a right triangle, following the pythagorean theorem. The smallest solution is 3,4,5, hence a right triangle with sides of lengths 3 and 4 has a hypotenuse of length 5.

If any two variables have a common factor then that factor can be divided out of the equation. It is enough to look for solutions where the three variables are mutually coprime.

Replace x2 + y2 with (x+yi)×(x-yi). Consider the prime factors of x+yi. If an integer prime divides x+yi then x and y have a common factor, which we have just ruled out. Hence all the prime factors of x+yi are complex.

If 1+i divides x+yi then z is even. Yet x and y are odd, to remain coprime to z. When the equation is reduced mod 4 we obtain 1+1 = 0, which is impossible. Thus z is odd, and without loss of generality, we will let y be even.

If some prime s divides both x+yi and x-yi, take the difference and sum to show s divides 2x and 2y. We've already ruled out 1+i, so s cannot divide 2. It must divide both x and y. The same holds for s conjugate, so s times s conjugate, a real number, divides x and y, which contradicts x and y coprime. Therefore x+yi and x-yi are coprime, no factors in common.

Every prime dividing x+yi divides z, and z is squared, so every prime in x+yi is taken to an even power. Gather the primes together into the complex number u+vi, such that x+yi is the square of u+vi, or an associate thereof. The conjugate primes form u-vi, and their square builds x-yi. Square u+vi and equate terms, giving the following.

u > v > 0, u and v coprime, u and v of different parity:
x ← u2-v2
y ← 2uv
z ← u2+v2

Note that u and v are coprime, else their common factor would divide x y and z. They also have different parity, else z is even. We're assuming y is even, and 2uv is even, so we know components correspond. If either u or v is negative, make it positive. This might change y from negative to positive, but we only need positive pythagorean triples, so that's fine. If v > u, swap them, making x positive.

Every coprime pythagorean triple leads to u > v > 0, with u and v coprime, and having opposite parity. Conversely, every u v pair with these properties produces a valid pythagorean triple. Verify this by squaring x y and z, using the formulas above.

Some other s+ti, with s > t > 0, cannot be an associate of u+vi, as both are in the first quadrant. Thus s+ti contains different primes, and when squared, it cannot produce x+yi, or even an associate of x+yi, such as -x-yi. Therefore pythagorean triples and u v pairs correspond 1-1.

As an example, set u = 5 and v = 2, hence x = 21, y = 20, and z = 29. sure enough, 441 + 400 = 841.

If z2 had a coefficient of 7, we'd be in trouble. Primes that are 3 mod 4, like 7, can't be split between x+yi and x-yi, hence there is no solution. A coefficient of 73 is no better. When x and y are divisible by 7, that takes two of the factors away, but there's still a factor of 7. In general, a coefficient on z2 that contains a prime p to an odd power, where p = 3 mod 4, prohibits any solutions in the positive integers.