(* step 6 *)
(* The set of Pythagorean triples *)

(* Specifications: *)
(* Relative primality and fractions *)
Lemma relp_frac : forall a b c d : Z,
(b <> 0) -> (d <> 0) -> (frac a b) = (frac c d) -> (rel_prime c d) ->
exists m : Z, m <> 0 /\ b = m * d.
Lemma pytha_thm1 : forall a b c : Z, (is_pytha a b c) -> (pytha_set a b c).
Lemma pytha_thm2 : forall a b c : Z, (pytha_set a b c) -> (is_pytha a b c).
Definition pytha_set_even (a b c : Z) :=
exists p : Z, exists q : Z, exists m : Z,
a = m * (q * q - p * p) /\ b = 2 * m * (p * q) /\
c = m * (p * p + q * q) /\ m >= 0 /\ (cond_pq p q).