(***************************************************************************)
(* 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 advanced_parallel_lemmas.
Require Export geometry_tools.
(*********************************************************************)
(*  Elimination Theorems                                               *)
(*********************************************************************)
(* Area elimination *)
unfold on_line in |- *.
Proof with Geometry.
unfold on_inter_parallel_parallel in |- *.
unfold parallel in |- *.
intros.
assert (S4 G C H D = - S4 C G D H)...
rewrite H1 in H0.
intuition.
Qed.
Proof with Geometry.
intros.
unfold on_line_d in *.
DecompAndAll.
RewriteVar lambda H3...
clear H3.
assert (1 - P ** Y / P ** Q = Y ** Q / P ** Q)...
assert (Y ** P + P ** Q = Y ** Q)...
rewrite <- H1...
assert (P ** Y = - Y ** P)...
rewrite H3; field...
rewrite H1...
replace (S A B Y) with (S Y A B)...
replace (S A B Q) with (S Q A B)...
replace (S A B P) with (S P A B)...
apply l2_9...
Qed.

Theorem elim_area_on_line :
forall A B P Q Y : Point,
on_line Y P Q ->
S A B Y = P ** Y / P ** Q * S A B Q + (1 - P ** Y / P ** Q) * S A B P.