(***************************************************************************)
(* 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.
Ltac Geometry := auto with Geom field_hints.
(*******************************************************)
(** Axioms                                                             *)
(*******************************************************)
(** The set of Points *)
Parameter Point : Set.
(** The signed area *)
Parameter S : Point -> Point -> Point -> F.
(** The signed distance *)
Parameter DSeg : Point -> Point -> F.
Infix "**" := DSeg (left associativity, at level 20) : F_scope.
Definition Col (A B C : Point) : Prop := S A B C = 0.
Definition S4 (A B C D : Point) : F := S A B C + S A C D.
Definition parallel (A B C D : Point) : Prop := S4 A C B D = 0.

(* Specifications: *)
Axiom A1b : forall A B : Point, A ** B = 0 <-> A = B.
Axiom A2a : forall (A B : Point) (r : F),
{P : Point | Col A B P /\ A ** P = r * A ** B}.
Axiom  A2b : forall (A B P P' : Point) (r : F),
A <> B ->
Col A B P ->
A ** P = r * A ** B -> Col A B P' -> A ** P' = r * A ** B -> P = P'.
Axiom chasles : forall A B C : Point, Col A B C -> A ** B + B ** C = A ** C.
Axiom A3a : forall A B C : Point, S A B C = S C A B.
Axiom A3b : forall A B C : Point, S A B C = - S B A C.
Axiom A4 : {A : Point &  {B : Point &  {C : Point | ~ Col A B C}}}.
Axiom A5 : forall A B C D : Point, S A B C = S A B D + S A D C + S D B C.
Axiom A6 : forall A B C P : Point,
A <> C -> ~ Col P A C -> Col A B C -> A ** B / A ** C = S P A B / S P A C.