(***************************************************************************)
(* Formalization of the Chou, Gao and Zhang's decision procedure.          *)
(* Julien Narboux (Julien@narboux.fr)                                      *)
(* LIX/INRIA FUTURS 2004-2006                                              *)
(* University of Strasbourg 2008                                           *)
(***************************************************************************)
Require Export pythagoras_difference_lemmas.
Require Export euclidean_constructions_2.
Require Export construction_lemmas_2.
Require Export ratios_elimination_lemmas.
Ltac construct_grid O U V H :=
elim grid_existence;let H:= fresh in (
intros O H; elim H; clear H;intros U H;elim H;clear H;intro V;intros H;decompose [and] H).

Lemma py_elim :  forall O U V, perp O U O V ->
O ** U <> 0 -> O ** V <> 0 ->
forall A B C,
~ Col A O V -> ~ Col B O U ->
Py A B C =
(- (2*2*2)* O ** U * O ** U * S O V A * S O V B +
2*2*2 * O ** U * O ** U * S O V A * S O V C +
2*2*2 * O ** U * O ** U * S O V B * S O V B -
2*2*2 * O ** U * O ** U * S O V B * S O V C -
2*2*2 * O ** V * O ** V * S O U A * S O U B +
2*2*2 * O ** V * O ** V * S O U A * S O U C +
2*2*2 * O ** V * O ** V * S O U B * S O U B -
2*2*2 * O ** V * O ** V * S O U B * S O U C) /
(O ** V * O ** V * O ** U * O ** U).