(***************************************************************************)
(* 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 area_elimination_lemmas.
(********************************)
(** Length ratios eliminations *)
(********************************)
unfold on_line_d in |- *.
intuition.
Qed.
unfold on_line_d in |- *.
intuition.
Qed.
unfold on_line in |- *.
intuition.
Qed.
unfold on_line in |- *.
intuition.
Qed.
Proof with Geometry.
unfold on_line_d in |- *...
intros...
decompose [and] H; clear H...
assert (Col P Q A)...
assert (Col P Q Y)...
assert (Col P A Y); eauto with Geom...
assert (A ** P + P ** Y = A ** Y)...
rewrite <- H7...
rewrite H5...
field...
Qed.
Proof with Geometry.
intros.
assert (on_line_d Y P Q (P**Y/P**Q)).
unfold on_line_d.
unfold on_line in H.
intuition.
field.
Geometry.
apply elim_length_ratio_on_line_d_1;auto.
Qed.
Lemma
invariant_par_on_line_d_1_length_ratio :
forall (A C D P Q Y : Point) (lambda : F),
on_line_d Y P Q lambda -> S A P Q = 0 ->
parallel A Y C D -> parallel A P P Q.
Lemma
invariant_par_on_line_1_length_ratio :
forall (A C D P Q Y : Point),
on_line Y P Q -> S A P Q = 0 ->
parallel A Y C D -> parallel A P P Q.
Lemma
invariant_par_on_line_d_1_length_ratio_2 :
forall (A C D P Q Y : Point) (lambda : F),
on_line_d Y P Q lambda -> S A P Q = 0 -> A<>Y ->
parallel A Y C D -> parallel C D P Q.
Proof with Geometry.
intros.
assert (parallel P Q Y A).
unfold parallel, S4.
replace (S P Q A ) with 0.
ring_simplify.
2:symmetry...
unfold on_line_d in H.
decompose [and] H.
suppose (Col P Y Q)...
suppose (Col P Q A)...
unfold on_line_d in H.
decompose [and] H;clear H.
assert (Col P Q A)...
assert (Col P A Y).
eapply col_trans_1 with (B:=Q)...
assert (Col Q A Y).
eapply col_trans_1 with (B:=P)...
assert (parallel C D A P).
eapply col_par_par with (D:=Y)...
cases_equality P A.
subst P.
eapply col_par_par with (D:=Y)...
eapply col_par_par with (D:=A)...
Qed.

Lemma invariant_par_on_line_1_length_ratio_2 :
forall (A C D P Q Y : Point),
on_line Y P Q -> S A P Q = 0 -> Y<>A ->
parallel A Y C D -> parallel C D P Q.