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

(* Specifications: *)
Lemma multiple4_2: forall u v : Z,
Zodd v -> Zodd u -> v <= u -> rel_prime u v -> 1 < u -> 1 < v ->
exists two : Z * Z,
let (s, w) := two in
(u - v = 4 * s /\ u + v = 2 * w \/
u - v = 2 * w /\ u + v = 4 * s) /\ 0 < s /\ 0 < w /\ rel_prime s w.
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.