(***************************************************************************)
(* 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 ratios_elimination_lemmas.

(* Specifications: *)
Theorem elim_py_on_parallel_d_middle :
forall (A B W U V Y : Point) (r : F),
on_parallel_d Y W U V r ->
Py A Y B = Py A W B + r* (Py A V B - Py A U B  + 2* Py W U V  )-r*(1-r)*(Py U V U).
Theorem elim_py_on_parallel_d_right :
forall (A B W U V Y : Point) (r : F),
on_parallel_d Y W U V r ->
Py A B Y = Py A B W + r  * (Py A B V - Py A B U).
Theorem elim_py_on_parallel_d_left_right :
forall (B W U V Y : Point) (r : F),
on_parallel_d Y W U V r ->
Py Y B Y = Py W B W + r * r * Py V B V - 2 * r * r * Py V B U + r * r * Py U B U +
2 * r * Py V B W - 2 * r * Py U B W.
Theorem elim_py_on_line_d_right :
forall (A B P Q Y : Point) (f : F),
on_line_d Y P Q f ->
Py A B Y = f * Py A B Q + (1 - f) * Py A B P.
Theorem elim_py_on_line_d_left_right :
forall (A P Q Y : Point) (f : F),
on_line_d Y P Q f -> Py Y A Y = f* (f * Py Q A Q + (1 - f) * Py Q A P) +
(1 - f) * (f * Py P A Q + (1 - f) * Py P A P) .
Lemma elim_py_midpoint_left_right : forall A B C M : Point,
on_line_d M B C (1 / 2) ->
Py M A M = - (1)/(2+2) * (Py B C B - 2* Py A C A - 2 *Py A B A).
Theorem elim_py_on_line_right :
forall A B P Q Y : Point,
on_line Y P Q ->
Py A B Y = P ** Y / P ** Q * Py A B Q + (1 - P ** Y / P ** Q) * Py A B P.