(***************************************************************************)
(* 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.
Definition a_ratio A O U V ro ru rv :=
~ Col O U V /\
S A U V / S O U V = ro /\
S O A V / S O U V = ru /\
S O U A / S O U V = rv.
Definition is_centroid G A B C :=  a_ratio G A B C (1/(2+1)) (1/(2+1)) (1/(2+1)).
Definition is_orthocenter' H A B C :=
a_ratio H A B C (Py A B C * Py A C B / ((2*2*2*2) * (S A B C * S A B C)))
(Py B A C * Py B C A / ((2*2*2*2) * (S A B C * S A B C)))
(Py C A B * Py C B A / ((2*2*2*2) * (S A B C * S A B C))).
Definition is_orthocenter H A B C :=
a_ratio H A B C
(Py A B C * Py A C B / (Py A B A * Py A C A - Py B A C * Py B A C))
(Py B A C * Py B C A / (Py A B A * Py A C A - Py B A C * Py B A C))
(Py C A B * Py C B A / (Py A B A * Py A C A - Py B A C * Py B A C)).
Definition is_circumcenter' O A B C :=
a_ratio O A B C (Py B C B * Py B A C / ((2*2*2*2*2) * (S A B C * S A B C)))
(Py A C A * Py A B C / ((2*2*2*2*2) * (S A B C * S A B C)))
(Py A B A * Py A C B / ((2*2*2*2*2) * (S A B C * S A B C))).
Definition is_circumcenter O A B C :=
a_ratio O A B C (Py B C B * Py B A C / (2*(Py A B A * Py A C A - Py B A C * Py B A C)))
(Py A C A * Py A B C /(2*(Py A B A * Py A C A - Py B A C * Py B A C)))
(Py A B A * Py A C B / (2*(Py A B A * Py A C A - Py B A C * Py B A C))).

Lemma is_circumcenter_non_zero : forall H A B C,
is_circumcenter H A B C ->
2*(Py A B A * Py A C A - Py B A C * Py B A C) <> 0.