(* Julien Narboux *)
(* Formalization of *)
(* Tarski's axiomatic *)
Require Export Ch05_between_transitivity_le.
(** The predicate out P A B informally means that P is on the line A B outside the segment A B. *)
Definition out := fun P A B => A<>P /\ B<>P /\ (Bet P A B \/ Bet P B A).
Proof with Tarski.
intros.
unfold iff;split;intro.
unfold out;repeat split;auto.
eapply l5_2;eauto;sTarski.
unfold out in H3.
decompose [and] H3.
elim H7;intro;Between.
Qed.
Proof with Tarski.
intros.
assert (exists C, Bet A P C /\ P<>C)...
DecompExAnd H0 C.
assert (Bet B P C <-> out P A B).
eapply l6_2;unfold out in H;intuition.
repeat split.
unfold out in H;intuition.
unfold out in H;intuition.
exists C;repeat split;eauto.
intuition.
Qed.
Proof with Tarski.
intros.
unfold out;repeat split.
intuition.
intuition.
decompose [and] H.
DecompExAnd H3 C.
eapply l5_2;try apply H4;sTarski.
Qed.
Proof with Tarski.
intros.
unfold out in H.
decompose [and] H;clear H.
split.
unfold Col;intuition.
intuition.
assert (A = P).
eTarski.
intuition.
assert (B = P).
assert (Bet B P A);Between.
eTarski.
intuition.
Qed.
Proof with Tarski.
intros.
unfold out.
intuition.
subst A.
assert (Bet P P B)...
subst B.
assert (Bet A P P)...
unfold Col in H0;intuition.
Qed.
(** out reflexivity. *)
(** out symmetry. *)
(** out transitivity. *)
Proof with Tarski.
unfold out.
intros.
decompose [and] H1;clear H1.
decompose [and] H3;clear H3.
assert (Cong A X A Y).
eapply cong_transitivity with (C:=B) (D:=C);sTarski.
(* *)
intuition.
(* *)
eapply l4_19;try apply H6;auto.
eapply l4_3.
apply between_symmetry.
apply H6.
apply between_symmetry.
apply H8.
Tarski.
esTarski.
(* *)
assert (Bet A X Y);Between.
eapply between_cong.
apply H10.
assumption.
(* *)
assert (Bet A Y X);Between.
symmetry.
eapply between_cong.
apply H10.
sTarski.
(* *)
assert (Bet A X Y \/ Bet A Y X).
eapply l5_1.
2:apply H6.
auto.
auto.
elim H10;intro.
(* *)
eapply between_cong;eauto.
symmetry;eapply between_cong;eauto;sTarski.
Qed.
Proof with Tarski.
intros.
unfold out.
assert (exists X : Point, (Bet A R X \/ Bet A X R) /\ Cong A X B C).
eapply (segment_construction_2 R A).
auto.
DecompExAnd H1 X.
exists X.
intuition;treat_equalities...
Qed.
Proof with Tarski.
intros.
unfold le in H0.
DecompExAnd H0 Y.
assert (P<>Y).
unfold not;intro.
(* *)
treat_equalities.
unfold out in H;intuition.
(* *)
assert (Y=A).
eapply l6_11_unicity.
5:apply H.
5:apply H3.
unfold out in H.
intuition.
intuition.
unfold out in *;intuition.
Tarski.
subst Y...
Qed.

Lemma l6_13_2 : forall P A B,
out P A B -> Bet P A B -> le P A P B.