(***************************************************************************)
(* 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 geometry_tools.
Proof with try solve [ ring | congruence ].
intros.
assert (- -a=-0).
rewrite H...
assert (- -a=a)...
assert (-0=0)...
Qed.
Hint Resolve field_prop1 : Geom.
(** Some propositions about Col *)
Proof with uniformize_signed_areas;Geometry.
unfold Col in |- *.
intros...
Qed.
Proof with uniformize_signed_areas;Geometry.
unfold Col in |- *.
intros...
Qed.
Proof with uniformize_signed_areas;Geometry.
unfold Col in |- *.
intros...
Qed.
Proof with uniformize_signed_areas;Geometry.
unfold Col in |- *.
intros...
Qed.
Proof with uniformize_signed_areas;Geometry.
unfold Col in |- *.
intros...
Qed.
Hint Resolve col_1 col_2 col_3 col_4 col_5: Geom.
(** Proposition about equality and nullity of geometric quantities *)
intros.
assert (A ** B = 0 <-> A = B).
apply A1b.
intuition.
Qed.
Hint Resolve noteqnotzero: Geom.
Proof with try solve [ Geometry | congruence ].
intros.
unfold Col.
rewrite H...
Qed.
unfold Col in |- *.
intros.
intuition.
assert (T := egalcol A B C H0).
auto.
Qed.
intros.
assert (~ Col A B C -> ~ Col B C A).
intuition.
assert (~ Col B C A).
auto.
eapply notcolnotegal_1.
apply H1.
Qed.
intros.
assert (~ Col A B C -> ~ Col A C B).
intuition.
assert (~ Col A C B).
auto.
eapply notcolnotegal_1.
apply H1.
Qed.
Hint Resolve notcolnotegal_1 notcolnotegal_2 notcolnotegal_3: Geom.
Hint Resolve notparallelnotegal_1 notparallelnotegal_2 : Geom.
(** Some usefull lemmas about ratios of signed distances *)
Proof with Geometry.
intros.
uniformize_dir_seg.
field...
Qed.
Hint Resolve dirseg_1: Geom.
Proof with Geometry.
intros.
uniformize_dir_seg.
rewrite H.
auto.
Qed.
Hint Resolve dirseg_2: Geom.
(* Theorem dirseg_1 : (A,B,C,D:Point) C<>D -> -(A**B/C**D) = B**A /C**D. Proof with Geometry. Intros. Replace A**B with -B**A. Field. Symmetry. Qed.  Theorem dirseg_2 : (A,B,C,D:Point) C<>D -> -(A**B/C**D) = A**B /D**C. Proof with Geometry. Intros. Replace C**D with -D**C. Field. Symmetry. Qed.   Hints Resolve dirseg_1 dirseg_2 : Geom. *)
Proof with Geometry.
intros.
uniformize_dir_seg.
field...
Qed.

Theorem dirseg_4 :
forall A B C D : Point, C ** D <> 0 -> A ** B / C ** D = - (A ** B / D ** C).