In my opinion, this obscure lemma is the most beautiful part of the proof. It is surprisingly elegant.

Here is the lemma:

**Lemma: Given that there exist p,q with the following properties:**

(a) gcd(p,q)=1 (gcd = greatest common denominator)

(b) p,q have opposite parities (one is odd, one is even)

(c) p

Then there exists a,b such that:

(a) p = a

(b) q = 3a

(c) gcd(a,b)=1

(a) gcd(p,q)=1 (gcd = greatest common denominator)

(b) p,q have opposite parities (one is odd, one is even)

(c) p

^{2}+ 3q^{2}is a cubeThen there exists a,b such that:

(a) p = a

^{3}- 9ab^{2}(b) q = 3a

^{2}b - 3b^{3}(c) gcd(a,b)=1

(d) a,b have opposite parities

Proof:

(1) Let

**u**. [Since we know that

^{3}= p^{2}+ 3q^{2}**p**is a cube.]

^{2}+ 3q^{2}(2) We know that

**u**is odd since

**p,q**have opposite parities [that is, one is odd, one is even].

(3) We know then that

**u**must be of the form

**a**. [Since any odd factor would also have to have the same form, see here for the lemma regarding odd factors of

^{2}+ 3b^{2}**p**]

^{2}+ 3q^{2}(4) Now,

**(a**

^{2}+ 3b^{2})^{3}= (a^{2}+ 3b^{2})[(a^{2}- 3b^{2})^{2}+ 3(2ab)^{2}]since(a^{2}+ 3b^{2})^{2}= a^{4}+ 6a^{2}b^{2}+ 9b^{4}=

= a^{4}+ 12a^{2}b^{2}- 6a^{2}b^{2}+ 9b^{4}=

(a^{2}- 3b^{2})^{2}+ 3(2ab)^{2}

^{}(5) And,

**(a**

[ a(a[See here for the proof.]

^{2}+ 3b^{2})[(a^{2}- 3b^{2})^{2}+ 3(2ab)^{2}] =[ a(a

^{2}- 3b^{2}) - 3b(2ab)]^{2}+ 3[a(2ab)+b(a^{2}-3b^{2})]^{2}(6) And:

**[ a(a**

= [a

=[a.

^{2}- 3b^{2}) - 3b(2ab)]^{2}+ 3[a(2ab)+b(a^{2}-3b^{2})]^{2}== [a

^{3}- 3ab^{2}- 6ab^{2}]^{2}+ 3(2a^{2}b + a^{2}b - 3b^{3})^{2}==[a

^{3}-9ab^{2}]^{2}+ 3(3a^{2}b - 3b^{3})^{2}(7) Which combined with step (1) gives us:

**p**

^{2}+ 3q^{2 }=**[a**

^{3}-9ab^{2}]^{2}+ 3(3a^{2}b - 3b^{3})^{2}(8) Which means that we could define a,b such that:

p =

**a**.

^{3}-9ab^{2}q =

**3a**.

^{2}b - 3b^{3}gcd(a,b)=1 [since otherwise, any common factor would divide p and q].

(9) We also know that a,b have opposite parities since:

(a) If a,b are both odd, then, p is even since p = odd - odd and q is even since q = odd - odd which is impossible since p,q have opposite parities.

(b) If a,b are both even, then p is even since p = even - even and q is even since q = even - even which is impossible.

QED