(* Contribution to the Coq Library   V6.3 (July 1999)                    *)
(****************************************************************************)
(*                                                                          *)
(*                          Constructive Geometry                           *)
(*                             according to                                 *)
(*                            Jan von Plato                                 *)
(*                                                                          *)
(*                               Coq V5.10                                  *)
(*									    *)
(*			        Gilles Kahn 				    *)
(*				   INRIA                                    *)
(*		              Sophia-Antipolis		 	            *)
(*									    *)
(*                                                                          *)
(* Acknowledgments: This work started in Turin in May 95 with Yves Bertot.  *)
(* Thanks to the Newton Institute for providing an exceptional work         *)
(* environment in Summer 1995 so that I could complete this.                *)
(****************************************************************************)
(****************************************************************************)
(*                              basis.v                                     *)
(*                                                                          *)
(* Basic definitions, axioms, figures                                       *)
(****************************************************************************)
Definition Relation (U : Set) := U -> U -> Prop.
Definition Reflexive (U : Set) (R : Relation U) : Prop := forall x : U, R x x.
Definition Transitive (U : Set) (R : Relation U) : Prop :=
forall x y z : U, R x y -> R y z -> R x z.
Definition Symmetric (U : Set) (R : Relation U) : Prop :=
forall x y : U, R x y -> R y x.
Inductive Equivalence (U : Set) (R : Relation U) : Prop :=
Definition_of_equivalence :
Reflexive U R -> Symmetric U R -> Transitive U R -> Equivalence U R.
Definition Negation (U : Set) (R : Relation U) : Relation U :=
fun x y : U => ~ R x y.
Hint Unfold Negation.
unfold Symmetric, Negation in |- *.
intros U R H' x y H'0; red in |- *; intro H'1; auto.
Qed.
Hint Resolve Sym_imp_NegSym.
Definition Irreflexive (U : Set) (R : Relation U) : Prop :=
forall x : U, ~ R x x.
Definition Separating (U : Set) (R : Relation U) : Prop :=
forall x y z : U, R x y -> R x z \/ R y z.
Inductive Apartness (U : Set) (R : Relation U) : Prop :=
Definition_of_apartness :
Irreflexive U R -> Separating U R -> Apartness U R.
Hint Unfold Reflexive Irreflexive Symmetric Transitive.
Hint Resolve Definition_of_equivalence Definition_of_apartness.
(****************************************************************)
Parameter Point : Set.
Parameter Line : Set.
Parameter DiPt : Point -> Point -> Prop.
Parameter DiLn : Line -> Line -> Prop.
Parameter ConLn : Line -> Line -> Prop.
(****************************************************************)
Hint Resolve apart_dipt apart_diln apart_con.
Hint Resolve Apart_imp_Sym.
Hint Immediate sym_DiPt sym_DiLn sym_ConLn.
Hint Resolve Neg_apart_equiv.
Definition EqPt := Negation Point DiPt.
Definition EqLn := Negation Line DiLn.
Definition Par := Negation Line ConLn.
Hint Resolve equiv_EqPt.
Hint Resolve equiv_EqLn.
Hint Resolve equiv_Par.
Hint Immediate sym_EqPt sym_EqLn sym_Par.
(****************************************************************)
Parameter Apart : Point -> Line -> Prop.
(****************************************************************)
Definition Incident (a : Point) (l : Line) := ~ Apart a l.
Record Segment : Set := Seg
{origin : Point; extremity : Point; Seg_cond : DiPt origin extremity}.
Record Twolines : Set := Twol
{line1 : Line; line2 : Line; Twol_cond : ConLn line1 line2}.
(****************************************************************)
Axiom
line :
forall x : Segment,
{l : Line | Incident (origin x) l /\ Incident (extremity x) l}.
Axiom
point :
forall x : Twolines,
{a : Point | Incident a (line1 x) /\ Incident a (line2 x)}.
(****************************************************************)
Definition ln : Segment -> Line.
Hint Resolve inc_ln1 inc_ln2 inc_pt1 inc_pt2.
(****************************************************************)
Axiom
el_ax :
forall (x : Segment) (l m : Line),
DiLn l m ->
(Apart (origin x) l \/ Apart (extremity x) l) \/
Apart (origin x) m \/ Apart (extremity x) m.
Axiom
cmp_apt_dipt :
forall (a b : Point) (l : Line), Apart a l -> DiPt a b \/ Apart b l.
Axiom
cmp_apt_diln :
forall (a : Point) (l m : Line), Apart a l -> DiLn l m \/ Apart a m.

Axiom cmp_con_diln : forall l m n : Line, ConLn l m -> DiLn m n \/ ConLn l n.