(* Julien Narboux *)
(* Formalization of *)
(* Tarski's axiomatic *)
Require Export Ch02_congruence_properties.
(** Axiom 12 of Givant. *)
Proof with eTarski.
intros.
assert (exists x : Point, Bet A B x /\ Cong B x B B)...
DecompExAnd H x.
assert (B = x).
assert (Cong B B B x)...
congruence.
Qed.
Hint Resolve beetween_trivial : Tarski.
(** Axiom 14 of Givant. *)
Proof with eTarski.
intros.
assert (Bet B C C)...
assert (exists x, Bet B x B /\ Bet C x A)...
DecompExAnd H1 x.
assert (B=x)...
congruence.
Qed.
Hint Resolve between_symmetry : sTarski.
Hint Resolve beetween_trivial beetween_trivial2 : Tarski.
Proof with Tarski.
intros.
assert
(exists x : Point,
Bet B x B /\ Bet A x A).
eapply inner_pasch;eauto.
DecompExAnd H1 x.
assert (A = x)...
assert (B = x)...
rewrite <- H2 in H1.
assumption.
Qed.
Hint Resolve between_egality : Tarski.
(** Inner transitivity 'axiom' for betweenness. *)
Proof with eTarski.
intros.
assert (exists x,Bet B x B /\ Bet C x A)...
DecompExAnd H1 x.
apply between_symmetry.
assert (B=x)...
congruence.
Qed.
Hint Resolve between_exchange3 : Tarski.
Proof with eTarski.
intros.
assert (exists x, Bet A C x /\ Cong C x C D)...
DecompExAnd H2 x.
assert (Bet B C x)...
assert (x=D).
eapply construction_unicity;try apply H1...
subst x...
Qed.
Proof with eTarski.
intros.
cases_equality B C.
subst B...
eapply outer_transitivity_between2.
3:apply H1.
eapply between_inner_transitivity...
assumption.
Qed.
(** Axiom 16 of Givant. *)
Proof with eTarski.
intros.
eapply between_symmetry.
eapply between_exchange2;apply between_symmetry.
2:apply H.
eapply outer_transitivity_between2...
Qed.

Lemma between_exchange4 : forall A B C D,
Bet A B C -> Bet A C D -> Bet A B D.