(***************************************************************************)
(* 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 field_general_properties.
Require Export chou_gao_zhang_axioms.
(* This file contains the lemmas needed by the tactics used as tools for both the development and the decision procedure. *)
(********************************************************)
(* Signed areas                                         *)
(********************************************************)
auto with Geom.
Qed.
auto with Geom.
Qed.
Hint Resolve S_1: Geom.
Proof with try solve [ Geometry | congruence ].
intros...
assert (S A B C = - S B A C)...
assert (S B A C = S C B A)...
Qed.
Hint Resolve S_2: Geom.
Proof with try solve [ Geometry | congruence ].
intros...
assert (S A B C = - S B A C)...
assert (S B A C = S A C B)...
Qed.
Hint Resolve S_3: Geom.
intros.
Geometry.
Qed.
(********************************************************)
(* Signed areas (4)                                     *)
(********************************************************)
Proof with try solve [ Geometry | ring ].
intros...
unfold S4 in |- *...
assert (S A B C = S A B D + S A D C + S D B C)...
assert (S D B C = - S C B D)...
rewrite H0 in H...
assert (S A D C = - S A C D)...
rewrite H1 in H...
clear H0 H1...
rewrite H...
Qed.
Hint Resolve S4_1: Geom.
Proof with try solve [ Geometry | ring ].
unfold S4 in |- *...
intros...
assert (S B D A = S A B D)...
assert (S B C D = - S C B D)...
assert (S4 A B C D = S A B D - S C B D)...
rewrite <- H in H1.
rewrite H0.
unfold S4 in H1.
rewrite H1 in |- *.
ring.
Qed.
Hint Resolve S4_2: Geom.
Proof with try solve [ Geometry | congruence ].
intros...
assert (S4 A B C D = S4 B C D A)...
rewrite H...
Qed.
Hint Resolve S4_3: Geom.
Proof with Geometry.
intros...
Qed.
Hint Resolve S4_4: Geom.
Proof with Geometry.
intros...
unfold S4 in |- *...
assert (S A C D = - S A D C)...
rewrite H.
assert (S A B C = - S A C B)...
rewrite H0.
ring.
Qed.
Hint Resolve S4_5: Geom.
Proof with try solve [ Geometry | congruence ].
intros...
assert (S4 D C B A = S4 A D C B)...
rewrite H...
Qed.
Hint Resolve S4_6: Geom.
Proof with try solve [ Geometry | congruence ].
intros...
assert (S4 A D C B = S4 C B A D)...
rewrite <- H...
Qed.
Hint Resolve S4_7: Geom.
Proof with Geometry.
intros...
assert (S4 A D C B = S4 B A D C)...
rewrite <- H...
Qed.
Hint Resolve S4_8: Geom.
(***************************************************)
(* Simplification lemmas                           *)
(***************************************************)
Hint Resolve zeroegal egalzero: Geom.
(* This lemma depends on the fact the 2<>0 *)

Lemma field_prop_2 : forall a : F, a = - a -> a = 0.