Require Export GeoCoq.Tarski_dev.Ch10_line_reflexivity_2.
Ltac permut :=
match goal with
|H : (Col ?X ?Y ?Z) |- Col ?X ?Y ?Z => assumption
|H : (Col ?X ?Y ?Z) |- Col ?Y ?Z ?X => apply col_permutation_1; assumption
|H : (Col ?X ?Y ?Z) |- Col ?Z ?X ?Y => apply col_permutation_2; assumption
|H : (Col ?X ?Y ?Z) |- Col ?X ?Z ?Y => apply col_permutation_5; assumption
|H : (Col ?X ?Y ?Z) |- Col ?Y ?X ?Z => apply col_permutation_4; assumption
|H : (Col ?X ?Y ?Z) |- Col ?Z ?Y ?X => apply col_permutation_3; assumption
|_ : _ |- _ => idtac
end.
Ltac bet :=
match goal with
|H0 : Bet ?A ?B ?C |- Bet ?A ?B ?C => assumption
|H0 : Bet ?A ?B ?C, H1 : Bet ?B ?C ?D , H : ?B <> ?C |- Bet ?A ?B ?D => apply (outer_transitivity_between _ _ _ _ H0 H1 H)
|H0 : Bet ?A ?B ?C, H1 : Bet ?B ?C ?D , H : ?B <> ?C |- Bet ?A ?C ?D => apply (outer_transitivity_between2 _ _ _ _ H0 H1 H)
|H0 : Bet ?A ?B ?D, H1 : Bet ?B ?C ?D  |- Bet ?A ?B ?C => apply (between_inner_transitivity _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?C, H1 : Bet ?A ?C ?D  |- Bet ?B ?C ?D => apply (between_exchange3 _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?D, H1 : Bet ?B ?C ?D  |- Bet ?A ?C ?D => apply (between_exchange2 _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?C, H1 : Bet ?A ?C ?D  |- Bet ?A ?B ?D => apply (between_exchange4 _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?C |- Bet ?A ?B ?C => assumption
|H0 : Bet ?A ?B ?C, H1 : Bet ?B ?C ?D , H : ?B <> ?C |- Bet ?D ?B ?A => apply between_symmetry; apply (outer_transitivity_between _ _ _ _ H0 H1 H)
|H0 : Bet ?A ?B ?C, H1 : Bet ?B ?C ?D , H : ?B <> ?C |- Bet ?D ?C ?A => apply (outer_transitivity_between2 _ _ _ _ H0 H1 H)
|H0 : Bet ?A ?B ?D, H1 : Bet ?B ?C ?D  |- Bet ?C ?B ?A => apply between_symmetry; apply (between_inner_transitivity _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?C, H1 : Bet ?A ?C ?D  |- Bet ?D ?C ?B => apply between_symmetry; apply (between_exchange3 _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?D, H1 : Bet ?B ?C ?D  |- Bet ?D ?C ?A => apply between_symmetry; apply (between_exchange2 _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?C, H1 : Bet ?A ?C ?D  |- Bet ?D ?B ?A => apply between_symmetry; apply (between_exchange4 _ _ _ _ H0 H1)
|H0 : Bet ?A ?B ?C |- Bet ?C ?B ?A => apply (between_symmetry _ _ _  H0)
|H0 : Bet ?A ?B ?C |- Bet ?C ?B ?A => apply (between_symmetry _ _ _  H0)
|_ : _ |- Bet ?A ?B ?B => apply between_trivial
|_ : _ |- Bet ?A ?A ?B => apply between_trivial2
|_ : _ |- _ => idtac
end.
Ltac cong :=
match goal with
|_ :  Cong ?A ?B ?C ?BD |- Cong ?A ?B ?C ?D => assumption
|_ : _ |- Cong ?A ?B ?A ?B => apply cong_reflexivity
|_ : _ |- Cong ?A ?A ?B ?B => apply cong_trivial_identity
|H0 : Cong ?A ?B ?C ?D |- Cong ?A ?B ?C ?C => assumption
|H0 : Cong ?A ?B ?C ?D |- Cong ?A ?B ?D ?C => apply (cong_right_commutativity _ _ _ _ H0)
|H0 : Cong ?A ?B ?C ?D |- Cong ?B ?A ?D ?C => apply (cong_commutativity _ _ _ _ H0)
|H0 : Cong ?A ?B ?C ?D |- Cong ?B ?A ?C ?D => apply (cong_left_commutativity _ _ _ _ H0)
|H0 : Cong ?A ?B ?C ?D |- Cong ?C ?D ?A ?B => apply (cong_symmetry _ _ _ _ H0)
|H0 : Cong ?A ?B ?C ?D |- Cong ?C ?D ?B ?A => apply (cong_symmetry _ _ _ _ (cong_left_commutativity _ _ _ _ H0))
|H0 : Cong ?A ?B ?C ?D |- Cong ?D ?C ?B ?B => apply (cong_symmetry _ _ _ _ (cong_commutativity _ _ _ _ H0))
|H0 : Cong ?A ?B ?C ?D |- Cong ?D ?C ?A ?B => apply (cong_symmetry _ _ _ _ (cong_right_commutativity _ _ _ _ H0))
|_ : _ |- _ => idtac
end.
Section T11_1.
Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.

(* Specifications: *)
Lemma l11_3 : forall A B C D E F,
CongA A B C D E F ->
exists A', exists C', exists D', exists F',
Out B A' A /\ Out B C C' /\ Out E D' D /\ Out E F F' /\
Cong_3 A' B C' D' E F'.
Lemma l11_aux : forall B A A' A0 E D D' D0,
Out B A A' -> Out E D D' -> Cong B A' E D' ->
Bet B A A0 -> Bet E D D0 -> Cong A A0 E D ->
Cong D D0 B A ->
Cong B A0 E D0 /\ Cong A' A0 D' D0.
Lemma l11_3_bis : forall A B C D E F,
(exists A', exists C', exists D', exists F',
Out B A' A /\ Out B C' C /\ Out E D' D /\ Out E F' F /\
Cong_3 A' B C' D' E F') -> CongA A B C D E F.
Lemma l11_4_1 : forall A B C D E F,
CongA A B C D E F -> A<>B /\ C<>B /\ D<>E /\ F<>E /\
(forall A' C' D' F', Out B A' A /\ Out B C' C /\ Out E D' D /\ Out E F' F /\
Cong B A' E D' /\ Cong B C' E F' -> Cong A' C' D' F').
Lemma l11_4_2 : forall A B C D E F,
(A<>B /\ C<>B /\ D<>E /\ F<>E /\
(forall A' C' D' F', Out B A' A /\ Out B C' C /\ Out E D' D /\ Out E F' F /\
Cong B A' E D' /\ Cong B C' E F' -> Cong A' C' D' F')) ->  CongA A B C D E F.
Lemma conga_refl : forall A B C, A <> B -> C <> B -> CongA A B C A B C.
Lemma conga_sym : forall A B C A' B' C', CongA A B C A' B' C' -> CongA A' B' C' A B C.
Lemma out_conga :
forall A B C A' B' C' A0 C0 A1 C1,
CongA A B C A' B' C' ->
Out B A A0 ->
Out B C C0 ->
Out B' A' A1 ->
Out B' C' C1 ->
CongA A0 B C0 A1 B' C1.
Lemma cong3_diff : forall A B C A' B' C',
A<>B -> Cong_3 A B C A' B' C' -> A' <> B'.
Lemma cong3_diff2: forall A B C A' B' C',
B<>C -> Cong_3 A B C A' B' C' -> B' <> C'.
Lemma cong3_conga : forall A B C A' B' C',
A <> B -> C <> B ->
Cong_3 A B C A' B' C' ->
CongA A B C A' B' C'.
Lemma cong3_conga2 : forall A B C A' B' C' A'' B'' C'',
Cong_3 A B C A' B' C' ->
CongA A B C A'' B'' C'' ->
CongA A' B' C' A'' B'' C''.
Lemma conga_diff1 : forall A B C A' B' C', CongA A B C A' B' C' -> A <> B.
Lemma conga_diff2 : forall A B C A' B' C', CongA A B C A' B' C' -> C <> B.
Lemma conga_diff45 : forall A B C A' B' C', CongA A B C A' B' C' -> A' <> B'.
Lemma conga_diff56 : forall A B C A' B' C', CongA A B C A' B' C' -> C' <> B'.
Lemma conga_trans : forall A B C A' B' C' A'' B'' C'',
CongA A B C A' B' C' -> CongA A' B' C' A'' B'' C'' ->
CongA A B C A'' B'' C''.
Lemma conga_pseudo_refl : forall A B C,
A <> B -> C <> B -> CongA A B C C B A.
Lemma conga_trivial_1 : forall A B C D,
A<>B -> C<>D -> CongA A B A C D C.
Lemma l11_10 : forall A B C D E F A' C' D' F',
CongA A B C D E F -> Out B A' A -> Out B C' C -> Out E D' D -> Out E F' F ->
CongA A' B C' D' E F'.
Lemma out2__conga : forall A B C A' C', Out B A' A -> Out B C' C -> CongA A B C A' B C'.
Lemma l11_13 : forall A B C D E F A' D',
CongA A B C D E F -> Bet A B A' -> A'<> B -> Bet D E D' -> D'<> E -> CongA A' B C D' E F.
Lemma conga_right_comm : forall A B C D E F, CongA A B C D E F -> CongA A B C F E D.
Lemma conga_left_comm : forall A B C D E F, CongA A B C D E F -> CongA C B A D E F.
Lemma conga_comm : forall A B C D E F, CongA A B C D E F -> CongA C B A F E D.
Lemma conga_line : forall A B C A' B' C',
A <> B -> B <> C -> A' <> B' -> B' <> C' -> Bet A B C -> Bet A' B' C' ->
CongA A B C A' B' C'.
Lemma l11_14 : forall A B C A' C',
Bet A B A' -> A <> B -> A' <> B -> Bet C B C' -> B <> C -> B <> C' ->
CongA A B C A' B C'.