(* Julien Narboux *)
(* Formalization of *)
(* Tarski's axiomatic *)
Require Export  Ch03_between_properties.
Proof with Tarski.
intros.
unfold IFSC in H.
intuition.
cases_equality A C.
treat_equalities...
assert (exists E, Bet A C E /\ C <> E)...
DecompExAnd H6 E.
assert (exists E', Bet A' C' E' /\ Cong C' E' C E)...
DecompExAnd H6 E'.
assert (Cong E D E' D').
eapply five_segments_with_def.
assert (OFSC A C E D A' C' E' D').
unfold OFSC.
intuition.
apply H6.
assumption.
assert (OFSC E C B D E' C' B' D').
unfold OFSC.
intuition;esTarski.
esTarski.
Qed.
Proof with Tarski.
intros.
assert (IFSC A B C A A' B' C' A').
unfold IFSC;intuition.
apply cong_commutativity.
eapply l4_2.
apply H3.
Qed.
Hint Resolve l4_2 l4_3 : Tarski.
(** A generalization of the Cong predicate for three points. *)
Definition Cong_3 := fun A1 A2 A3 B1 B2 B3 =>
Cong A1 A2 B1 B2 /\ Cong A1 A3 B1 B3 /\ Cong A2 A3 B2 B3.
Proof with Tarski.
intros.
assert (exists D',  Bet C' A' D' /\ A' <> D')...
DecompExAnd H1 D'.
assert (exists B',  Bet D' A' B' /\ Cong A' B' A B)...
DecompExAnd H1 B'.
assert (exists C'',  Bet D' B' C'' /\ Cong B' C'' B C)...
DecompExAnd H1 C''.
assert (Bet A' B' C'');Between.
assert (Bet D' A' C'');Between.
assert (Cong A C A' C'').
eapply l2_11.
apply H.
apply H1.
sTarski.
sTarski.
assert (C''=C').
assert (D' <> A').
auto.
eapply construction_unicity.
apply H10.
eauto.
apply cong_symmetry.
apply H9.
sTarski.
sTarski.
exists B'.
unfold Cong_3.
intuition.
subst C'...
subst C''.
sTarski.
Qed.
Hint Resolve l4_5 : Tarski.
Proof with Tarski.
intros.
assert (exists B'', Bet A' B'' C' /\ Cong_3 A B C A' B'' C').
eapply l4_5...
unfold Cong_3 in H0;intuition...
DecompExAnd H1 B''.
assert (Cong_3 A' B'' C' A' B' C').
unfold Cong_3 in *;intuition;esTarski.
assert (IFSC A' B'' C' B'' A' B'' C' B');unfold IFSC;intuition.
unfold Cong_3 in *;intuition...
unfold Cong_3 in *;intuition...
assert (Cong B'' B'' B'' B').
eapply l4_2;eauto.
treat_equalities...
Qed.
Hint Unfold Col.
(** Permutation lemmas for Col *)
Hint Resolve col_permutation_1 col_permutation_2
col_permutation_3 col_permutation_4 col_permutation_5 : sTarski.
Hint Resolve col_permutation_1 col_permutation_2
col_permutation_3 col_permutation_4 col_permutation_5 : Col.
Ltac Col := eauto with Col.
(** Trivial lemmas for Col. *)
Hint Resolve col_trivial_1 col_trivial_2 col_trivial_3 : Tarski.

Lemma l4_13 : forall A B C A' B' C',
Col A B C -> Cong_3 A B C A' B' C' -> Col A' B' C'.