(* Diophantus20.v *)
(****************************)
(* Diophantus' 20th problem *)
(****************************)
Require Export Descent.
Require Export Pythagorean.
(*************************)
(* Some auxiliary lemmas *)
(*************************)

Lemma for_exists_ab : forall u v m n : Z,
v <= u -> u * u = m * m + n * n -> v * v = n * n - m * m -> 1 < u -> 1 < v ->
Zodd v -> Zodd u -> rel_prime u v ->
exists two : Z * Z,
let (a, b) := two in
(u - v = 4 * (a * a) /\ u + v = 2 * (b * b) \/
u - v = 2 * (b * b) /\ u + v = 4 * (a * a)) /\ 0 < a /\ 0 < b.