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}.

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'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F')))))))) *)
    ex_and H3 A'.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    ex_and H4 C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F')))))))) *)
    ex_and H3 D'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F')))))))) *)
    ex_and H4 F'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
    exists D'.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F'))))) *)
    exists F'.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
    repeat split;finish.
(* Goal: @Cong Tn B C' E F' *)
      apply cong_left_commutativity.
(* Goal: @Cong Tn B A' D' E *)
(* Goal: @Cong Tn B C' E F' *)
      eapply l2_11 with A D;finish.
(* Goal: @Cong Tn B C' E F' *)
    apply cong_left_commutativity.
(* Goal: @Cong Tn C' B E F' *)
    eapply l2_11; eBetween; Cong.
Qed.

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.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert (A <> B).
      unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong B A0 E D0).
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      apply l2_11 with A D;finish.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Out Tn B P1 P2 *)
      apply H7.
    unfold Out in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    induction H9; induction H11.
      assert(Bet B A' A0 \/ Bet B A0 A').
        eauto using l5_1.

      induction H12.
        assert(Bet E D' D0).
          eapply cong_preserves_bet.
            2: apply H1.
            apply H12.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          unfold Out.
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @SuppA Tn A B C A B B' *)
            assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
          eapply l5_1.
            2:apply H9.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        eapply l4_3  with B E;finish.
      assert(Bet E D0 D').
        eapply cong_preserves_bet.
(* Goal: @Out Tn B P1 P2 *)
          2: apply H7.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Out.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          assert_diffs;auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          assert_diffs;auto.
        eapply l5_1.
          2:apply H3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l4_3 with B E;finish.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
      eapply l4_3.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        3:apply cong_commutativity.
(* Goal: @Out Tn B P1 P2 *)
        3:apply H7.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        eapply between_exchange4.
          apply H11.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        eapply cong_preserves_bet.
          2: apply H1.
(* Goal: @Out Tn B P1 P2 *)
          2: apply H7.
          eapply between_exchange4.
            apply H11.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Out.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          assert_diffs;auto.
        eapply l5_1.
          2:apply H9.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      finish.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
      eapply l4_3.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        3:apply cong_commutativity.
(* Goal: @Out Tn B P1 P2 *)
        3:apply H7.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        eapply cong_preserves_bet.
          2:apply cong_symmetry.
          2:apply H1.
          2:apply cong_symmetry.
(* Goal: @Out Tn B P1 P2 *)
          2:apply H7.
          eapply between_exchange4.
            apply H9.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Out.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          assert_diffs;auto.
        eauto using l5_1.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        eapply between_exchange4.
          apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      finish.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
    eapply l4_3.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      3:apply cong_commutativity.
(* Goal: @Out Tn B P1 P2 *)
      3:apply H7.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
      eapply between_exchange4.
        apply H11.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
      eapply between_exchange4.
        apply H9.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    finish.
Qed.

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.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: not (@Per Tn A B C) *)
    ex_and H A'.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    ex_and H0 C'.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    ex_and H D'.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    ex_and H0 F'.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    prolong B A A0 E D.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    prolong B C C0 E F.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    prolong E D D0 B A.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    prolong E F F0 B C.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    assert(HH0:=H0).
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    assert(HH1:=H1).
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    assert(HH2:=H2).
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert(HH:=H).
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    unfold Out in HH.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    unfold Out in HH0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    unfold Out in HH1.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    unfold Out in HH2.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    repeat split;try assumption.
(* Goal: @CongA Tn D E F A B C *)
    repeat split;try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D' E' F' C B A')) *)
    exists A0.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' F0) (and (@Cong Tn C' F0 B C) (and (@Bet Tn B A A0) (and (@Cong Tn A A0 B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 F0 A0 F'))))))))) *)
    exists C0.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
    exists D0.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B C) (and (@Bet Tn B A D') (and (@Cong Tn A D' B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 C'0 D' F'))))))))))) *)
    exists F0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    repeat split; try (assumption).
(* Goal: @Cong Tn A0 C0 D0 F0 *)
    unfold Cong_3 in H3.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Cong Tn A0 C0 D0 F0 *)
    assert(Cong B A0 E D0 /\ Cong A' A0 D' D0).
      eapply l11_aux with A D;finish.
(* Goal: @Cong Tn A0 C0 D0 F0 *)
    assert(Cong B C0 E F0 /\ Cong C' C0 F' F0).
      eapply l11_aux with C F;finish.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert (Cong_3 B A' A0 E D' D0)
      by (repeat split;finish).
    assert (Cong_3 B C' C0 E F' F0)
      by (repeat split;finish).
(* Goal: @Cong Tn A0 C0 D0 F0 *)
    assert (Cong C0 A' F0 D').
      apply l4_16 with B C' E F';
        unfold FSC;repeat split;finish;ColR.
    apply l4_16 with B A' E D';
    unfold FSC;repeat split;finish;ColR.
Qed.

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').
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert (HH:=H).
    apply l11_3 in HH.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
    clear H3.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    ex_and HH A0.
(* Goal: and (not (@eq (@Tpoint Tn) A' B')) (and (not (@eq (@Tpoint Tn) C' B')) (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (@ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B A) (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B C) (and (@Bet Tn B A D') (and (@Cong Tn A D' B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))))))) *)
    ex_and H4 C0.
    ex_and H10 D0.
(* Goal: and (not (@eq (@Tpoint Tn) A' B')) (and (not (@eq (@Tpoint Tn) C' B')) (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (@ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B A) (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B C) (and (@Bet Tn B A D') (and (@Cong Tn A D' B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))))))) *)
    ex_and H4 F0.
    unfold Cong_3 in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert (Out B A' A0).
      eapply l6_7.
        apply H3.
      apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Out E D' D0).
      eapply l6_7.
        apply H6.
      apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong A' A0 D' D0).
      eapply out_cong_cong.
        apply H16.
        apply H17.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A' C' C' A' *)
      Cong.
    assert (Cong A' C0 D' F0).
      eapply (l4_16 B A0 A' C0 E D0 D' F0).
        unfold FSC.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
          assert_cols;Col.
(* Goal: @Cong Tn A' C' C' A' *)
          Cong.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A' C' C' A' *)
          Cong.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst A0.
      unfold Out in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      absurde.
    assert (Out B C' C0).
      eapply l6_7.
        apply H5.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Out E F' F0).
      eapply l6_7.
(* Goal: @Out Tn B P1 P2 *)
        apply H7.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong C' C0 F' F0).
      eapply out_cong_cong.
        3:apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
    eapply (l4_16 B C0 C' A' E F0 F' D').
      unfold FSC.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Col Tn B A C *)
        apply out_col.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A' C' C' A' *)
        Cong.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A' C' C' A' *)
      Cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    subst C0.
    unfold Out in H10.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    absurde.
Qed.



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.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A B C *)
    apply l11_3_bis.
    prolong B A A' E D.
    prolong B C C' E F.
    prolong E D D' B A.
    prolong E F F' B C.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
    exists D'.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F'))))) *)
    exists F'.
    assert(Cong A' B D' E).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
     {
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
(* Goal: @Cong Tn B A' D' E *)
(* Goal: @Cong Tn B C' E F' *)
      eapply l2_11 with A D;finish.
     }
    assert (Cong B C' E F').
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11 with C F;finish.
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
    assert_diffs;repeat split;finish.
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
    apply H3;repeat split;finish.
Qed.

Lemma conga_refl : forall A B C, A <> B -> C <> B -> CongA A B C A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A B C *)
    apply l11_3_bis.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
    exists C.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
    exists C.
    repeat split; finish.
Qed.

Lemma conga_sym : forall A B C A' B' C', CongA A B C A' B' C' -> CongA A' B' C' A B C.
Proof.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn D' E' F' A' B' C' *)
    ex_and H3 A0.
(* Goal: and (not (@eq (@Tpoint Tn) A' B')) (and (not (@eq (@Tpoint Tn) C' B')) (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (@ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B A) (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B C) (and (@Bet Tn B A D') (and (@Cong Tn A D' B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))))))) *)
    ex_and H4 C0.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
    ex_and H3 D0.
(* Goal: and (not (@eq (@Tpoint Tn) A' B')) (and (not (@eq (@Tpoint Tn) C' B')) (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (@ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B A) (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B C) (and (@Bet Tn B A D') (and (@Cong Tn A D' B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))))))) *)
    ex_and H4 F0.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
    exists D0.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B C) (and (@Bet Tn B A D') (and (@Cong Tn A D' B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 C'0 D' F'))))))))))) *)
    exists F0.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D' E' F' C B A')) *)
    exists A0.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' F0) (and (@Cong Tn C' F0 B C) (and (@Bet Tn B A A0) (and (@Cong Tn A A0 B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 F0 A0 F'))))))))) *)
    exists C0.
    repeat split; finish.
Qed.

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.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A0 B C0 A1 B' C1 *)
    apply l11_4_1 in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A0 B C0 A1 B' C1 *)
    apply l11_4_2.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @CongA Tn D E F A B C *)
    repeat split;try assumption.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Out Tn B P1 P2 *)
    apply H7.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
    repeat split;finish.
      eapply l6_7 with A0;finish.
      eapply l6_7 with C0;finish.
      eapply l6_7 with A1;finish.
      eapply l6_7 with C1;finish.
Qed.

Lemma cong3_diff : forall A B C A' B' C',
 A<>B -> Cong_3 A B C A' B' C' -> A' <> B'.
Proof.
(* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Cong_3 Tn A B C A' B' C'), not (@eq (@Tpoint Tn) B' C') *)
unfold Cong_3 in *.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
auto.
Qed.

Lemma cong3_diff2: forall A B C A' B' C',
 B<>C -> Cong_3 A B C A' B' C' -> B' <> C'.
Proof.
(* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Cong_3 Tn A B C A' B' C'), not (@eq (@Tpoint Tn) B' C') *)
unfold Cong_3 in *.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
auto.
Qed.

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'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A' B' C' *)
    assert (A' <> B') by (eauto using cong3_diff).
(* Goal: @CongA Tn A B C A' B' C' *)
    assert (B' <> C') by (eauto using cong3_diff2).
(* Goal: @CongA Tn A B C A' B' C' *)
    apply (l11_3_bis A B C A' B' C').
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A. exists C. exists A'. exists C'.
    intuition finish.
Qed.

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''.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C0.
(* Goal: @CongA Tn A' B' C' A'' B'' C'' *)
    ex_and H4 A2.
(* Goal: @CongA Tn A' B' C' A'' B'' C'' *)
    ex_and H5 C2.
(* Goal: @CongA Tn A' B' C' A'' B'' C'' *)
    unfold Cong_3 in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: and (not (@eq (@Tpoint Tn) A' B')) (and (not (@eq (@Tpoint Tn) C' B')) (and (not (@eq (@Tpoint Tn) A'' B'')) (and (not (@eq (@Tpoint Tn) C'' B'')) (@ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))))))) *)
    repeat split;try solve [auto].
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))) *)
    prolong B' A' A1 B'' A''.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))) *)
    prolong B' C' C1 B'' C''.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))) *)
    exists A1.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C'0 D' F'))))))))))) *)
    exists C1.
(* Goal: @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C1) (and (@Cong Tn C' C1 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C1 D' F')))))))))) *)
    exists A2.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C1) (and (@Cong Tn C' C1 B'' C'') (and (@Bet Tn B'' A'' A2) (and (@Cong Tn A'' A2 B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C1 A2 F'))))))))) *)
    exists C2.
(* Goal: @CongA Tn D E F A B C *)
    repeat split;try assumption.
      eapply cong_transitivity with B A;finish.
      eapply cong_transitivity with B C;finish.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    assert (Cong A A0 A' A1).
      eapply cong_transitivity with B'' A'';finish.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert(Cong B A0 B' A1).
      eapply l2_11 with A A';finish.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    assert (Cong C C0 C' C1).
      eapply cong_transitivity with B'' C'';finish.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert(Cong B C0 B' C1).
      eapply l2_11 with C C';finish.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    assert(FSC B A A0 C B' A' A1 C').
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
      unfold FSC;assert_cols;repeat split;finish.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    assert(Cong A0 C A1 C').
(* Goal: @Cong Tn A0 C A1 C' *)
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      eauto using l4_16.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
(* Goal: @Cong Tn C1 A1 C2 A2 *)
    assert(Cong C0 A0 C1 A1).
(* Goal: @Cong Tn C0 A0 C1 A1 *)
(* Goal: @Cong Tn C1 A1 C2 A2 *)
      eapply (l4_16 B C C0 A0 B' C' C1 A1).
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
        unfold FSC;assert_cols;repeat split;finish.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Cong Tn A' C' C' A' *)
    apply cong_transitivity with A0 C0; Cong.
Qed.

Lemma conga_diff1 : forall A B C A' B' C', CongA A B C A' B' C' -> A <> B.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_diff2 : forall A B C A' B' C', CongA A B C A' B' C' -> C <> B.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_diff45 : forall A B C A' B' C', CongA A B C A' B' C' -> A' <> B'.
Proof.
(* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @CongA Tn A B C A' B' C'), not (@eq (@Tpoint Tn) C' B') *)
  intros A B C A' B' C' H.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (conga_diff1 A' B' C' A B C); apply conga_sym; auto.
Qed.

Lemma conga_diff56 : forall A B C A' B' C', CongA A B C A' B' C' -> C' <> B'.
Proof.
(* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @CongA Tn A B C A' B' C'), not (@eq (@Tpoint Tn) C' B') *)
  intros A B C A' B' C' H.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (conga_diff2 A' B' C' A B C); apply conga_sym; auto.
Qed.

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''.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert (HH:=H).
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A1.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C1.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert(A'' <> B'' /\ C'' <> B'').
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
      unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      split; assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(CongA A1 B' C1 A'' B'' C'')
      by (apply out_conga with A' C' A'' C'';finish).
    assert (CongA A0 B C0 A' B' C')
      by (apply out_conga with A C A' C';finish).
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert (Cong B A0 B' A1).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
      {
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      apply l2_11 with A A';finish.
      }
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert (Cong B C0 B' C1).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
      {
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11 with C C';finish.
      }
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert (Cong A0 C0 A1 C1).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    {
(* Goal: @Cong Tn A0 C0 A1 C1 *)
      apply (l11_4_1) in H24.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Cong Tn A0 C0 A1 C1 *)
      apply H30.
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
      repeat split;finish.
    }
    assert (Cong_3 A0 B C0 A1 B' C1)
      by (repeat split;finish).
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    apply cong3_symmetry in H28.
    assert( CongA A0 B C0 A'' B'' C'')
      by (eauto using cong3_conga2).
    eapply out_conga with A0 C0 A'' C'';finish.
Qed.

Lemma conga_pseudo_refl : forall A B C,
 A <> B -> C <> B -> CongA A B C C B A.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))))) *)
    prolong B A A' B C.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))))) *)
    prolong B C C' B A.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))))) *)
    prolong B A A'' B C.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))))) *)
    prolong B C C'' B A.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))) *)
    exists C''.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C C'') (and (@Cong Tn C C'' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' C'' F'))))))))) *)
    exists A''.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @Cong Tn A' C' C'' A'' *)
    assert (A' = A'') by (eauto using (construction_uniqueness B A)).
(* Goal: @Cong Tn A' C' C'' A'' *)
    subst A''.
(* Goal: @Cong Tn A' C' C'' A' *)
    assert (C' = C'') by (eauto using (construction_uniqueness B C)).
(* Goal: @Cong Tn A' C' C'' A' *)
    subst C''.
(* Goal: @Cong Tn A' C' C' A' *)
    Cong.
Qed.

Lemma conga_trivial_1 : forall A B C D,
  A<>B -> C<>D -> CongA A B A C D C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A C') (and (@Cong Tn A C' D C) (and (@Bet Tn D C D') (and (@Cong Tn C D' B A) (and (@Bet Tn D C F') (and (@Cong Tn C F' B A) (@Cong Tn A' C' D' F')))))))))))) *)
    prolong B A A' D C.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A C') (and (@Cong Tn A C' D C) (and (@Bet Tn D C D') (and (@Cong Tn C D' B A) (and (@Bet Tn D C F') (and (@Cong Tn C F' B A) (@Cong Tn A' C' D' F')))))))))))) *)
    prolong D C C' B A.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn B A A') (and (@Cong Tn A A' D C) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (and (@Bet Tn D C C') (and (@Cong Tn C C' B A) (@Cong Tn A' A' C' C')))))))) *)
    repeat split;finish.
Qed.

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'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A' B C' D' E F' *)
    apply (out_conga A B C D E F); auto using l6_6.
Qed.

Lemma out2__conga : forall A B C A' C', Out B A' A -> Out B C' C -> CongA A B C A' B C'.
Proof.
(* Goal: forall (A B C A' C' : @Tpoint Tn) (_ : @Out Tn B A' A) (_ : @Out Tn B C' C), @CongA Tn A B C A' B C' *)
  intros A B C A' C' HAOut HCOut.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  apply l11_10 with A C A C;finish.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply conga_refl;auto.
Qed.

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.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H7 A''.
    ex_and H8 C''.
    ex_and H7 D''.
    ex_and H8 F''.
    prolong B A' A0 E D'.
    prolong E D' D0 B A'.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D' E' F' C B A')) *)
    exists A0.
(* Goal: @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))) *)
    exists C''.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
    exists D0.
    exists F''.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
    apply (five_segment_with_def A'' B A0 C'' D'' E D0 F'').
      unfold OFSC.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        eapply outer_transitivity_between2.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
          eapply outer_transitivity_between.
(* Goal: False *)
            apply H0.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        eapply outer_transitivity_between2.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H11.
          eapply outer_transitivity_between.
(* Goal: False *)
            apply H2.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C' E F' *)
        apply cong_left_commutativity.
        eapply l2_11.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H11.
(* Goal: @Cong Tn A' C' C' A' *)
          Cong.
(* Goal: @Cong Tn A' C' C' A' *)
        Cong.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        eapply l2_11.
          apply H16.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H18.
          apply cong_symmetry.
(* Goal: @Cong Tn A' C' C' A' *)
          Cong.
(* Goal: @Cong Tn A' C' C' A' *)
        Cong.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11 with C F;finish.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    assert_diffs;auto.
Qed.

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.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C F E D *)
    apply conga_trans with D E F.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
    apply H.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply conga_pseudo_refl;auto.
Qed.

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.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F C B A *)
    apply conga_trans with A B C.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C C B A *)
    apply conga_pseudo_refl.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_comm : forall A B C D E F, CongA A B C D E F -> CongA C B A F E D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C D E F *)
    apply conga_left_comm.
(* Goal: @CongA Tn A B C D E F *)
    apply conga_right_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

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'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    prolong B C C0 B' C'.
    prolong B' C' C1 B C.
    prolong B A A0 B' A'.
    prolong B' A' A1 B A.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D' E' F' C B A')) *)
    exists A0.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' F0) (and (@Cong Tn C' F0 B C) (and (@Bet Tn B A A0) (and (@Cong Tn A A0 B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 F0 A0 F'))))))))) *)
    exists C0.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))) *)
    exists A1.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C'0 D' F'))))))))))) *)
    exists C1.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
    apply (l2_11 A0 B C0 A1 B' C1).
      eapply outer_transitivity_between2.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H11.
        eapply outer_transitivity_between.
          apply H3.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      eapply outer_transitivity_between2.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H13.
        eapply outer_transitivity_between.
(* Goal: False *)
          apply H4.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H11.
        apply H13.
(* Goal: @Cong Tn B C' E F' *)
        apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
    apply cong_right_commutativity.
    eapply l2_11.
(* Goal: @Out Tn B P1 P2 *)
      apply H7.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
      apply H9.
      apply cong_symmetry.
(* Goal: @Cong Tn B C' E F' *)
      apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
    apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.


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'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    assert (CongA A' B C  C' B A).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    {
      apply l11_13 with A C;finish.
      apply conga_pseudo_refl;finish.
    }
      apply l11_13 with A' A;finish.
(* Goal: @CongA Tn A B C D E F *)
      apply conga_right_comm.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
Qed.

End T11_1.

Section T11_2.

Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.

Lemma l11_16 : forall A B C A' B' C',
 Per A B C    -> A <> B  -> C <> B ->
 Per A' B' C' -> A'<> B' -> C'<> B'->
 CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    prolong B C C0 B' C'.
    prolong B' C' C1 B C.
    prolong B A A0 B' A'.
    prolong B' A' A1 B A.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D' E' F' C B A')) *)
    exists A0.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' F0) (and (@Cong Tn C' F0 B C) (and (@Bet Tn B A A0) (and (@Cong Tn A A0 B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 F0 A0 F'))))))))) *)
    exists C0.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A'0) (and (@Cong Tn A' A'0 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A'0 C'0 D' F')))))))))))) *)
    exists A1.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C'0 D' F'))))))))))) *)
    exists C1.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
    apply (l10_12 A0 B C0 A1 B' C1).
      eapply (per_col _ _ C).
        intro;subst.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
        eapply (per_col _ _ A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
          apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      eapply (per_col _ _ C').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
        eapply (per_col _ _ A').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
          apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H9.
        apply H11.
(* Goal: @Cong Tn B C' E F' *)
        apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
    apply cong_right_commutativity.
    eapply l2_11.
      apply H5.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @Out Tn B P1 P2 *)
      apply H7.
      apply cong_symmetry.
(* Goal: @Cong Tn B C' E F' *)
      apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
    apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.


Lemma l11_17 : forall A B C A' B' C',
  Per A B C -> CongA A B C A' B' C' -> Per A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A1.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C1.
    assert (Per A0 B C0).
      eapply (per_col _ _ C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
        eapply (per_col _ _ A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
          apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Per A1 B' C1).
      eapply l8_10.
        apply H13.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        eapply l2_11.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: False *)
          apply H4.
          apply H8.
(* Goal: @Cong Tn B C' E F' *)
          apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11.
        apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H10.
(* Goal: @Cong Tn B C' E F' *)
        apply cong_left_commutativity.
        apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply (per_col _ _ C1).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C1.
      apply between_identity in H10.
      subst C'.
      absurde.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
      apply l8_2.
      eapply (per_col _ _ A1).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst A1.
        apply between_identity in H8.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
        subst A'.
        absurde.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; left.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    right; left.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
    apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_18_1 : forall A B C D,
  Bet C B D -> B <> C -> B <> D -> A <> B -> Per A B C -> CongA A B C A B D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert (Per A B D).
      eapply per_col.
(* Goal: False *)
        apply H0.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; right.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    eapply l11_16; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    auto.
Qed.

Lemma l11_18_2 : forall A B C D,
  Bet C B D -> CongA A B C A B D -> Per A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A1.
    ex_and H5 D0.
    assert( A0 = A1).
      eapply construction_uniqueness.
(* Goal: False *)
        2: apply H4.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
        apply H5.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    subst A1.
    assert(Per A0 B C0).
      unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
      exists D0.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        eapply outer_transitivity_between2.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H6.
          eapply outer_transitivity_between.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
            apply H.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        eapply l2_11.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H6.
          apply H10.
(* Goal: @Cong Tn B C' E F' *)
          apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply (per_col _ _ C0).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C0.
      apply between_identity in H6.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
      absurde.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
      apply l8_2.
      eapply (per_col _ _ A0).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst A0.
        apply between_identity in H8.
        subst A.
        absurde.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; left.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    right; left.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
    apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma cong3_preserves_out : forall A B C A' B' C',
  Out A B C -> Cong_3 A B C A' B' C' -> Out A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    unfold Out in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HH:=H0).
    unfold Cong_3 in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
      subst A'.
      apply cong_identity in H0.
      subst A.
      absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
      subst A'.
      apply cong_identity in H3.
      subst A.
      absurde.
(* Goal: @InAngle Tn P A B C *)
    induction H2.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
      eapply l4_6.
        2:apply HH.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
    eapply l4_6.
(* Goal: False *)
      apply H2.
(* Goal: @Cong_3 Tn A B C A' B' C' *)
    unfold Cong_3.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_21_a : forall A B C A' B' C', Out B A C -> CongA A B C A' B' C' -> Out B' A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A1.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C1.
    assert (Out B A0 C0).
      unfold Out.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst A0.
        apply between_identity in H4.
        subst A.
        absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C0.
        apply between_identity in H6.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
        subst C.
        absurde.
      unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      induction H14.
        eapply l5_1.
(* Goal: False *)
          2: apply H4.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        eapply between_exchange4.
          apply H14.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l5_1.
        3: apply H6.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      eapply between_exchange4.
        apply H14.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Out B' A1 C1).
      eapply cong3_preserves_out.
        apply H13.
(* Goal: @Cong_3 Tn A B C A' B' C' *)
      unfold Cong_3.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        eapply l2_11.
(* Goal: False *)
          apply H4.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H8.
          apply cong_symmetry.
(* Goal: @Cong Tn B C' E F' *)
          apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        assumption; apply H8.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        eapply l2_11.
          apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H10.
          apply cong_symmetry.
(* Goal: @Cong Tn B C' E F' *)
          apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply l6_7.
      apply l6_6.
      eapply l6_7.
        apply H14.
      eapply l6_7.
        apply l6_6.
        apply H14.
      unfold Out.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst A1.
        unfold Out in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply l6_7.
      apply H14.
    unfold Out.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C1.
      unfold Out in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      absurde.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_21_b : forall A B C A' B' C',
 Out B A C -> Out B' A' C' -> CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    prolong A B A0 A B.
    prolong C B C0 B C.
    prolong A' B' A1 A' B'.
    prolong C' B' C1 B' C'.
    eapply l11_13.
      eapply conga_line.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        5: apply between_symmetry.
        5: apply H3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        5: apply between_symmetry.
(* Goal: @Out Tn B P1 P2 *)
        5: apply H7.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C0.
        apply cong_symmetry in H4.
        apply cong_identity in H4.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
        subst C.
        unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
        subst C.
        unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C1.
        apply cong_symmetry in H8.
        apply cong_identity in H8.
        subst C'.
        unfold Out in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        unfold Out in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
      unfold Out in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
      unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      induction H12.
        eapply between_inner_transitivity.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H3.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply outer_transitivity_between.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H3.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
      unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      unfold Out in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      induction H10.
        eapply between_inner_transitivity.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply outer_transitivity_between.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @Out Tn B P1 P2 *)
        apply H7.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    unfold Out in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_cop__or_out_ts : forall A B C C', Coplanar A B C C' -> CongA A B C A B C' ->
  Out B C C' \/ TS A B C C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A1.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C1.
    assert (A0=A1).
      eapply construction_uniqueness.
        3:apply H5.
(* Goal: False *)
        2:apply H4.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    subst A1.
    induction (eq_dec_points C0 C1).
      subst C1.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
      unfold Out.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
      eapply l5_3.
        apply H6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
    assert(exists M, Midpoint M C0 C1).
      apply midpoint_existence.
    ex_and H14 M.
    assert(Cong B C0 B C1).
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11.
        apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H10.
        apply cong_symmetry.
(* Goal: @Cong Tn B C' E F' *)
        apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Per A0 M C0).
      unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C'0 D' F'))))))))))) *)
      exists C1.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Per B M C0).
      unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C'0 D' F'))))))))))) *)
      exists C1.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Per A0 M C1).
      unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' F0) (and (@Cong Tn C' F0 B C) (and (@Bet Tn B A A0) (and (@Cong Tn A A0 B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 F0 A0 F'))))))))) *)
      exists C0.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Per B M C1).
      unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' F0) (and (@Cong Tn C' F0 B C) (and (@Bet Tn B A A0) (and (@Cong Tn A A0 B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 F0 A0 F'))))))))) *)
      exists C0.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (B <> A0).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst A0.
      apply between_identity in H8.
      subst A.
      absurde.
    assert (Cong A C0 A C1).
      eapply (l4_2 B A A0 C0 B A A0 C1).
      unfold IFSC.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
        apply cong_reflexivity.
      apply cong_reflexivity.
    assert (Per A M C0).
      unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' A1) (and (@Cong Tn A' A1 B'' A'') (and (@Bet Tn B' C' C'0) (and (@Cong Tn C' C'0 B'' C'') (and (@Bet Tn B'' A'' D') (and (@Cong Tn A'' D' B' A') (and (@Bet Tn B'' C'' F') (and (@Cong Tn C'' F' B' C') (@Cong Tn A1 C'0 D' F'))))))))))) *)
      exists C1.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Per A M C1).
      unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B' A' D0) (and (@Cong Tn A' D0 B A) (and (@Bet Tn B' C' F0) (and (@Cong Tn C' F0 B C) (and (@Bet Tn B A A0) (and (@Cong Tn A A0 B' A') (and (@Bet Tn B C F') (and (@Cong Tn C F' B' C') (@Cong Tn D0 F0 A0 F'))))))))) *)
      exists C0.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Col B A M).
      apply cop_per2__col with C0.
        apply coplanar_perm_12, col_cop__cop with C1; Col.
        apply coplanar_perm_12, col_cop__cop with C'; Col.
        apply coplanar_perm_5, col_cop__cop with C; Col; Cop.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst M.
        apply is_midpoint_id in H15.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    (************)
    induction(eq_dec_points B M).
      subst M.
      assert(~Col A B C).
        eapply per_not_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        eapply per_col.
          2:apply H23.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C1.
          apply l7_2 in H15.
          apply is_midpoint_id in H15.
          subst C0.
          absurde.
        assert(Bet C B C1).
          eapply between_exchange3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
            apply between_symmetry.
            apply H6.
          apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(~Col A B C').
        eapply per_not_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        eapply per_col.
          2:apply H23.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C1.
          apply l7_2 in H15.
          apply is_midpoint_id in H15.
          subst C0.
          absurde.
        assert(Bet C' B C0).
          eapply between_exchange3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
            apply between_symmetry.
            apply H10.
          apply midpoint_bet.
          apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; left.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
      unfold TS.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: False *)
        Col.
(* Goal: False *)
        Col.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: False *)
        Col.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
      eapply between_exchange3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H10.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
      eapply between_exchange3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H6.
      apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    (***********)
    assert(TS B M C0 C1).
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
      unfold TS.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply per_not_col in H17.
          apply H17.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C0.
        apply is_midpoint_id in H15.
        subst C1.
        absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply per_not_col in H19.
          apply H19.
(* Goal: False *)
          Col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C1.
        apply l7_2 in H15.
        apply is_midpoint_id in H15.
        subst C0.
        absurde.
      exists M.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
        apply col_trivial_3.
      apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply (col_two_sides _ _ A) in H26.
      apply invert_two_sides in H26.
      (*************************)
      assert(TS A B C C1).
        eapply l9_5.
          apply H26.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
          apply col_trivial_3.
        unfold Out.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C0.
          apply cong_symmetry in H14.
          apply cong_identity in H14.
          subst C1.
          absurde.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l9_2.
      eapply l9_5.
        apply l9_2.
        apply H27.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
        apply col_trivial_3.
      unfold Out.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C1.
        apply cong_identity in H14.
        subst C0.
        absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        apply cong_identity in H7.
        subst C0.
        absurde.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: False *)
      Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    auto.
Qed.


Lemma cong2_conga_cong : forall A B C A' B' C',
 CongA A B C A' B' C' -> Cong A B A' B' -> Cong B C B' C' ->
 Cong A C A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H5 A0.
    ex_and H6 C0.
    ex_and H5 A1.
    ex_and H6 C1.
    assert(Cong A C0 A' C1).
      eapply (l4_2 B A A0 C0 B' A' A1 C1).
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
        eapply l2_11.
          apply H5.
          apply H9.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply cong_transitivity.
          apply H6.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        apply cong_symmetry.
        eapply cong_transitivity.
(* Goal: False *)
          2: apply H0.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        eapply cong_transitivity.
          apply H6.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        apply cong_symmetry.
        eapply cong_transitivity.
(* Goal: False *)
          2: apply H0.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply cong_transitivity.
        eapply l2_11.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
          apply H11.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply cong_transitivity.
          apply H8.
        apply cong_symmetry.
        eapply cong_transitivity.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_reflexivity.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
    eapply (l4_2 B C C0 A B' C' C1 A').
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
      eapply l2_11.
(* Goal: @Out Tn B P1 P2 *)
        apply H7.
        apply H11.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply cong_transitivity.
        apply H8.
      eapply cong_transitivity.
        apply cong_symmetry.
(* Goal: False *)
        apply H1.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      eapply cong_transitivity.
        apply H8.
      eapply cong_transitivity.
        apply cong_symmetry.
(* Goal: False *)
        apply H1.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.


Lemma angle_construction_1 : forall A B C A' B' P,
 ~ Col A B C -> ~ Col A' B' P ->
 exists C', CongA A B C A' B' C' /\ OS A' B' C' P.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert (exists C0, Col B A C0 /\ Perp B A C C0).
      eapply l8_18_existence.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H1 C0.
    induction(eq_dec_points B C0).
      subst C0.
      assert (exists  C', Per C' B' A' /\ Cong C' B' C B /\ OS A' B' C' P).
        apply ex_per_cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
          subst A'.
(* Goal: False *)
          apply H0.
          apply col_trivial_1.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply col_trivial_2.
          apply col_trivial_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and  H3 C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
      exists C'.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply l11_16.
          apply perp_perp_in in H2.
          apply perp_in_comm in H2.
          apply perp_in_per in H2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst A.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply col_trivial_1.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply col_trivial_2.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
          apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
          subst A'.
(* Goal: False *)
          apply H0.
          apply col_trivial_1.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        apply cong_symmetry in H4.
        apply cong_identity in H4.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
        subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        apply col_trivial_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    (*********** B <> C0 ***********)
    induction (out_dec B A C0).
      assert (exists C0', Out B' A' C0' /\ Cong B' C0' B C0).
        eapply segment_construction_3.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
          subst A'.
(* Goal: False *)
          apply H0.
          apply col_trivial_1.
        assert (Perp_at C0 C0 C B C0).
          eapply perp_perp_in.
          apply perp_sym.
          eapply perp_col.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
            apply perp_right_comm.
(* Goal: False *)
            apply H2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H5 C0'.
      assert (exists C' , Per C' C0' B' /\ Cong C' C0' C C0 /\ OS B' C0' C' P).
        apply ex_per_cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C0'.
          unfold Out in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C0.
          unfold Perp in H2.
(* Goal: and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) P B)) (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn C X A) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P)))))) *)
          ex_and H2 X.
          unfold Perp_at in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          absurde.
          apply col_trivial_2.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        apply H0.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
        eapply (col_transitivity_1 _ C0').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C0'.
          unfold Out in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          absurde.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn B A C *)
        apply out_col.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H7 C'.
      assert (Cong_3 C0 B C C0' B' C').
(* Goal: @Cong_3 Tn A B C A' B' C' *)
        unfold Cong_3.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply (l10_12 _ C0).
          assert(Perp  B C0 C C0 ).
            eapply perp_col.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
              intro.
              subst C0.
              apply perp_distinct in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
              spliter.
              absurde.
(* Goal: False *)
              apply H2.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply perp_left_comm in H10.
          apply perp_perp_in in H10.
          apply perp_in_per.
          apply perp_in_comm.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
          apply l8_2.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
      exists C'.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply (l11_10 C0 _ _ C0').
(* Goal: @CongA Tn B C A B' C' A' *)
          apply cong3_conga.
            3: apply H10.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst C0.
            absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply col_trivial_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply col_trivial_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        apply l8_8 in H7.
        subst C0'.
        unfold Out in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
(* Goal: @OS Tn F D G G0 *)
      apply invert_one_side.
      eapply col_one_side.
        3: apply H9.
(* Goal: @Col Tn B A C *)
        apply out_col.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
      subst A'.
(* Goal: False *)
      apply H0.
      apply col_trivial_1.
    (*********************)
    apply not_out_bet in H4.
      prolong A' B' C0' B C0.
      assert (exists C' , Per C' C0' B' /\ Cong C' C0' C C0 /\ OS B' C0' C' P).
        apply ex_per_cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C0'.
          apply cong_symmetry in H6.
          apply cong_identity in H6.
          subst C0.
          absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C0.
          apply perp_distinct in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          absurde.
          apply col_trivial_2.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        apply H0.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
        eapply col_transitivity_1.
(* Goal: @Out Tn B P1 P2 *)
          2:apply H7.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C0'.
          apply cong_symmetry in H6.
          apply cong_identity in H6.
          subst C0.
          absurde.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H7 C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
      exists C'.
(* Goal: @LtA Tn A B P A B C *)
      split.
        assert (Cong_3 C0 B C C0' B' C').
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
            apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
            apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
          eapply (l10_12 _ C0 _ _ C0').
            assert(Perp  B C0 C C0 ).
              eapply perp_col.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
                intro.
                subst C0.
                apply perp_distinct in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
                spliter.
                absurde.
(* Goal: False *)
                apply H2.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            apply perp_left_comm in H10.
            apply perp_perp_in in H10.
            apply perp_in_per.
            apply perp_in_sym.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
            apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply l11_13.
(* Goal: @CongA Tn B C A B' C' A' *)
          apply cong3_conga.
            3: apply H10.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply col_trivial_2.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst A.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply col_trivial_1.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
        subst A'.
(* Goal: False *)
        apply H0.
        apply col_trivial_1.
(* Goal: @OS Tn F D G G0 *)
      apply invert_one_side.
      eapply col_one_side.
        3: apply H9.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
      subst A'.
(* Goal: False *)
      apply H0.
      apply col_trivial_1.
(* Goal: @Col Tn A B C *)
    apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma angle_construction_2 : forall A B C A' B' P,
 A <> B -> A <> C -> B <> C -> A' <> B' -> ~ Col A' B' P ->
 exists C', CongA A B C A' B' C' /\ (OS A' B' C' P \/ Col A' B' C').
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Lt Tn B C B A *)
    induction (col_dec A B C).
      induction (out_dec B A C).
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
        exists A'.
(* Goal: @LtA Tn A B P A B C *)
        split.
          assert(CongA A B A A B C).
            eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
              apply conga_refl.
                3: apply H5.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
              2: apply H5.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
          assert (CongA A B A A' B' A').
            apply conga_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
          eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
            apply conga_sym.
(* Goal: @Out Tn B P1 P2 *)
            apply H7.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
        apply col_trivial_3.
      apply not_out_bet in H5.
        prolong A' B' C' A'  B'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
        exists C'.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @CongA Tn D E F A B C *)
          eapply conga_line; try assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst C'.
            apply cong_symmetry in H7.
            apply cong_identity in H7.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
            subst A'.
            absurde.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(exists C' , CongA A B C A' B' C' /\ OS A' B' C' P).
      apply angle_construction_1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H5 C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    left.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma ex_conga_ts : forall A B C A' B' P,
    ~ Col A B C -> ~ Col A' B' P ->
    exists C' : Tpoint, CongA A B C A' B' C' /\ TS A' B' C' P.
Proof.
(* Goal: forall (A B C A' B' P : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn A' B' P)), @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@TS Tn A' B' C' P)) *)
  intros A B C A' B' P HNCol HNCol'.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@TS Tn A' B' C' P)) *)
  assert (HP' : exists P', Midpoint A' P P') by (apply symmetric_point_construction).
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@TS Tn A' B' C' P)) *)
  destruct HP' as [P' HMid].
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@TS Tn A' B' C' P)) *)
  assert (~ Col A' B' P').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { intro HCol.
(* Goal: False *)
    apply HNCol'.
(* Goal: @Col Tn A' B' P *)
    assert (Col A' P P') by (apply midpoint_col; auto).
(* Goal: False *)
    apply (col3 A' P'); Col.
(* Goal: False *)
    intro; treat_equalities; Col.
  }
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@TS Tn A' B' C' P)) *)
  assert (HC' : exists C', CongA A B C A' B' C' /\ OS A' B' C' P').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (angle_construction_1 A B C A' B' P'); auto.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@TS Tn A' B' C' P)) *)
  destruct HC' as [C' [HConga HOne]].
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
  exists C'.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  split; auto.
(* Goal: @TS Tn A' B' C' P *)
  apply (l9_8_2 A' B' P'); Side.
(* Goal: False *)
  split; Col; split; Col.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
  exists A'.
(* Goal: False *)
  split; Col.
(* Goal: @Bet Tn P' A' P *)
  destruct HMid; Between.
Qed.


Lemma l11_15 : forall A B C D E P, ~ Col A B C -> ~ Col D E P ->
 exists F, CongA A B C D E F /\ OS E D F P /\
          (forall F1 F2, ((CongA A B C D E F1 /\ OS E D F1 P) /\
                          (CongA A B C D E F2 /\ OS E D F2 P)) -> Out E F1 F2).
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(exists F, CongA A B C D E F /\  OS D E F P)
      by (apply angle_construction_1; assumption).
    ex_and H1 F.
(* Goal: @LeA Tn E G F E G D *)
    exists F.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @OS Tn F D G G0 *)
      apply invert_one_side.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(Out E F1 F2 \/ TS D E F1 F2).
      apply conga_cop__or_out_ts.
(* Goal: False *)
      apply coplanar_trans_1 with P; Cop; Col.
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H3.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H7.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(OS E D F1 F2).
      eapply one_side_transitivity.
        apply H6.
      apply one_side_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply l9_9_bis in H8.
    apply invert_two_sides in H7.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma l11_19 : forall A B P1 P2,
  Per A B P1 -> Per A B P2 -> OS A B P1 P2 ->
  Out B P1 P2.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Out Tn B P1 P2 *)
    induction (col_dec A B P1).
(* Goal: @Out Tn B P1 P2 *)
(* Goal: @Out Tn B P1 P2 *)
      induction (l8_9 A B P1 H H2).
(* Goal: False *)
        subst.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        unfold OS in *.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        decompose [ex and] H1.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        unfold TS in *.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        intuition.
(* Goal: False *)
      subst.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      unfold OS in *.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      decompose [ex and] H1.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      unfold TS in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: False *)
      assert (Col B A B) by Col.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      intuition.
(* Goal: @Out Tn B P1 P2 *)
    induction (col_dec A B P2).
(* Goal: @Out Tn B P1 P2 *)
(* Goal: @Out Tn B P1 P2 *)
      induction (l8_9 A B P2 H0 ).
(* Goal: False *)
        subst.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        unfold OS in *.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        decompose [ex and] H1.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        unfold TS in *.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        intuition.
(* Goal: False *)
        subst.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        unfold OS in *.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        decompose [ex and] H1.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        unfold TS in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: False *)
        assert (Col B A B) by Col.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
        intuition.
(* Goal: False *)
      Col.
(* Goal: @Out Tn B P1 P2 *)
    assert (T:=l11_15 A B P1 A B P2 H2 H3).
(* Goal: @Out Tn B P1 P2 *)
    decompose [ex and] T.
(* Goal: @Out Tn B P1 P2 *)
    apply H7.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: False *)
          intro;subst;Col.
(* Goal: False *)
        intro;subst;Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply invert_one_side;auto.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      apply l11_16;try assumption.
(* Goal: False *)
        intro;subst;Col.
(* Goal: False *)
        intro;subst;Col.
(* Goal: False *)
        intro;subst;Col.
(* Goal: False *)
      intro;subst;Col.
(* Goal: @OS Tn B A P2 P2 *)
    apply one_side_reflexivity.
(* Goal: False *)
    Col.
Qed.

Lemma l11_22_bet :
 forall A B C P A' B' C' P',
  Bet A B C ->
  TS P' B' A' C' ->
  CongA A B P A' B' P' /\ CongA P B C  P' B' C' ->
  Bet A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    prolong A' B' C'' B C.
    assert(CongA C B P C'' B' P').
      eapply l11_13.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        2:apply H.
(* Goal: False *)
        apply H1.
        unfold CongA in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Cong Tn A' C' C'' A' *)
      subst C''.
      apply cong_symmetry in H4.
      apply cong_identity in H4.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
      unfold CongA in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      absurde.
    assert (CongA C'' B' P' C' B' P').
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H5.
(* Goal: @CongA Tn A B C A' B C *)
      apply conga_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Out B' C' C'' \/ TS P' B' C' C'').
      apply conga_cop__or_out_ts.
      apply coplanar_perm_2, col_cop__cop with A'; Col; Cop.
      apply ts_distincts in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @CongA Tn A B C A' B C *)
      apply conga_comm.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H7.
      unfold Out in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      induction H9.
        eapply between_inner_transitivity.
          apply H3.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply outer_transitivity_between.
        apply H3.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    induction (col_dec C' B' P').
      unfold TS in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      apply False_ind.
(* Goal: @Out Tn B P1 P2 *)
      apply H7.
      apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (B' <> P').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst P'.
      apply H8.
      apply col_trivial_2.
    assert (TS B' P' A' C'').
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
      unfold TS.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        unfold TS in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        apply H0.
        apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        unfold TS in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        apply H11.
        apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
      exists B'.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (OS B' P' C' C'').
      eapply l9_8_1.
        apply l9_2.
(* Goal: @TS Tn B P A C *)
        apply invert_two_sides.
(* Goal: False *)
        apply H0.
      apply l9_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply l9_9_bis in H11.
    apply invert_two_sides in H7.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma l11_22a :
 forall A B C P A' B' C' P',
 TS B P A C /\ TS B' P' A' C' /\
 CongA A B P A' B' P' /\ CongA P B C  P' B' C' ->
 CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert (A <> B /\ A' <> B' /\ P <> B /\ P' <> B' /\ C <> B /\ C' <> B').
      unfold CongA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
    assert(A <> C /\ A' <> C').
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      unfold TS in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      ex_and H12 T.
      ex_and H10 T'.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
        subst C.
        apply between_identity in H13.
        subst T.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C'.
      apply between_identity in H14.
      subst T'.
(* Goal: @Out Tn O B C *)
      contradiction.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(exists A'', Out B' A' A'' /\ Cong B' A'' B A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      eapply segment_construction_3; auto.
    ex_and H11 A''.
    unfold TS in H.
    assert (~ Col A B P).
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H15 T.
    induction (eq_dec_points B T).
      subst T.
      assert(Bet A' B' C').
        eapply l11_22_bet.
          apply H16.
(* Goal: @TS Tn B P A C *)
          apply invert_two_sides.
(* Goal: False *)
          apply H0.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: False *)
          apply H1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply conga_line.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction(bet_dec P B T).
      assert(exists T'', Col B' P' T'' /\ (Out B' P' T'' <-> Out B P T) /\ Cong B' T'' B T).
        prolong P' B' T'' B T.
        exists T''.
(* Goal: @LtA Tn A B P A B C *)
        split.
          unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
          right; right.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            assert(Bet P' B' T'' /\ Out B' P' T'').
(* Goal: @CongA Tn D E F A B C *)
              split; assumption.
            apply (not_bet_and_out _ _  _)in H22.
(* Goal: @Out Tn O B C *)
            contradiction.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          assert(Bet P B T /\ Out B P T).
(* Goal: @CongA Tn D E F A B C *)
            split; assumption.
          apply (not_bet_and_out _ _  _)in H22.
(* Goal: @Out Tn O B C *)
          contradiction.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H19 T''.
      destruct H20.
      assert (B' <> T'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst T''.
        apply cong_symmetry in H21.
        apply cong_identity in H21.
(* Goal: @Out Tn O B C *)
        contradiction.
      assert(exists C'', Bet A'' T'' C'' /\ Cong T'' C'' T C).
        prolong A'' T'' C'' T C.
(* Goal: @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))) *)
        exists C''.
(* Goal: @CongA Tn D E F A B C *)
        split; assumption.
      ex_and H24 C''.
      assert(CongA A B T A' B' T'').
(* Goal: @CongA Tn A B C A' B C *)
        apply conga_comm.
        eapply l11_13.
(* Goal: @CongA Tn A B C A' B C *)
          apply conga_comm.
(* Goal: False *)
          apply H1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          eapply out_to_bet.
(* Goal: @Col Tn A B C *)
            apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @LtA Tn A B P A B C *)
            split.
              apply H22.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(CongA A B T A'' B'  T'').
        eapply l11_10.
          apply H26.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(Cong A T A'' T'').
        assert(HH:= l11_4_1 A B T A'' B' T'' H27).
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        apply H32.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Cong Tn A' C' C'' A'' *)
          subst A''.
          absurde.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Cong A C A'' C'').
        eapply l2_11.
          apply H16.
          apply H24.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Cong C B C'' B').
        eapply (five_segment).
          5:apply H16.
          5: apply H24.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst T.
        apply H13.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA A B C A'' B' C'').
(* Goal: @CongA Tn B C A B' C' A' *)
        apply cong3_conga.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA C B T  C'' B' T'').
(* Goal: @CongA Tn B C A B' C' A' *)
        apply cong3_conga.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert (CongA P B C P' B' C'').
        eapply l11_13.
(* Goal: @CongA Tn A B C A' B C *)
          apply conga_comm.
          apply H32.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          eapply out_to_bet.
(* Goal: @Col Tn A B C *)
            eapply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @LtA Tn A B P A B C *)
            split.
              apply H22.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA P' B' C' P' B' C'').
        eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
(* Goal: False *)
          apply H2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out B' C' C'' \/ TS P' B' C' C'').
        apply conga_cop__or_out_ts.
        assert (HH := H0); destruct HH as [HNCol].
(* Goal: False *)
        apply coplanar_trans_1 with A'; Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
          Cop.
(* Goal: False *)
        assert_diffs; apply coplanar_perm_19, col_cop__cop with A''; Col.
        exists T''.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: False *)
        split; Col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      induction H35.
        eapply l11_10.
          apply H31.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(TS B' P' A'' C').
        apply l9_2.
        eapply l9_5.
          eapply l9_2.
          eapply l9_5.
(* Goal: False *)
            apply H0.
            apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply col_trivial_1.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      apply invert_two_sides in H35.
      apply l9_2 in H35.
      assert(OS B' P'  A'' C'').
        unfold OS.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
        exists C'.
(* Goal: @CongA Tn D E F A B C *)
        split; assumption.
      assert (TS B' P' A''  C'').
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
        unfold TS.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          unfold TS in H0.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@TS Tn A' B' C' P)) *)
          assert (~ Col A' B' P').
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          apply H39.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
          apply col_permutation_2.
          eapply (col_transitivity_1 _ A'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
(* Goal: @Cong Tn A' C' C'' A'' *)
            subst A''.
            unfold Out in H11.
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
            absurde.
(* Goal: @Col Tn A B C *)
            apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply out_col in H11.
          apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          unfold TS in H35.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          apply H35.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        exists T''.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
          apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l9_9 in H38.
(* Goal: @Out Tn O B C *)
      contradiction.
    apply not_bet_out in H18.
      assert(exists T'', Col B' P' T'' /\ (Out B' P' T'' <-> Out B P T) /\ Cong B' T'' B T).
        assert (exists T'', Out B' P' T'' /\ Cong B' T'' B T).
          apply segment_construction_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        ex_and H19 T''.
        exists T''.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply out_col in H19.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H19 T''.
      destruct H20.
      assert (B' <> T'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst T''.
        apply cong_symmetry in H21.
        apply cong_identity in H21.
(* Goal: @Out Tn O B C *)
        contradiction.
      assert(exists C'', Bet A'' T'' C'' /\ Cong T'' C'' T C).
        prolong A'' T'' C'' T C.
(* Goal: @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' B C) (and (@Bet Tn B C C') (and (@Cong Tn C C' B A) (and (@Bet Tn B C D') (and (@Cong Tn C D' B A) (and (@Bet Tn B A F') (and (@Cong Tn A F' B C) (@Cong Tn A' C' D' F')))))))))) *)
        exists C''.
(* Goal: @CongA Tn D E F A B C *)
        split; assumption.
      ex_and H24 C''.
      assert(CongA A B T A' B' T'').
        eapply l11_10.
(* Goal: False *)
          apply H1.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        apply l6_6.
        apply H22.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA A B T A'' B'  T'').
        eapply l11_10.
          apply H26.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(Cong A T A'' T'').
        assert(HH:= l11_4_1 A B T A'' B' T'' H27).
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        apply H32.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Cong Tn A' C' C'' A'' *)
          subst A''.
          absurde.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Cong A C A'' C'').
        eapply l2_11.
          apply H16.
          apply H24.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Cong C B C'' B').
        eapply (five_segment).
          5:apply H16.
          5: apply H24.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H13.
        subst T.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA A B C A'' B' C'').
(* Goal: @CongA Tn B C A B' C' A' *)
        apply cong3_conga.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA C B T  C'' B' T'').
(* Goal: @CongA Tn B C A B' C' A' *)
        apply cong3_conga.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l11_10.
        apply H31.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out B' C' C'' \/ TS P' B' C' C'').
        apply conga_cop__or_out_ts.
        assert (HH := H0); destruct HH as [HNCol].
(* Goal: False *)
        apply coplanar_trans_1 with A'; Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
          Cop.
(* Goal: False *)
        assert_diffs; apply coplanar_perm_19, col_cop__cop with A''; Col.
        exists T''.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: False *)
        split; Col.
(* Goal: @CongA Tn A B C A' B C *)
        apply conga_comm.
        eapply conga_trans.
(* Goal: @CongA Tn A B C A' B C *)
          apply conga_comm.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
(* Goal: False *)
          apply H2.
        eapply l11_10.
          apply H32.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Cong Tn A' C' C'' A' *)
          subst C''.
          apply cong_identity in H30.
(* Goal: @Out Tn O B C *)
          contradiction.
        apply H22.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      induction H33.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(TS B' P' A'' C').
        apply l9_2.
        eapply l9_5.
          eapply l9_2.
          eapply l9_5.
(* Goal: False *)
            apply H0.
            apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply col_trivial_1.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(OS B' P'  A'' C'').
        unfold OS.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
        exists C'.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply invert_two_sides in H33.
        apply l9_2 in H33.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert (TS B' P' A''  C'').
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
        unfold TS.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          unfold TS in H34.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          apply H34.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          unfold TS in H33.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          apply H37.
          apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        exists T''.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
          apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l9_9 in H36.
(* Goal: @Out Tn O B C *)
      contradiction.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
    apply col_permutation_3.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_22b :
 forall A B C P A' B' C' P',
 OS B P A C /\ OS B' P' A' C' /\
 CongA A B P A' B' P' /\ CongA P B C  P' B' C' ->
 CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    prolong A B D A B.
    prolong A' B' D' A' B'.
    assert(CongA D B P D' B' P').
      eapply l11_13.
(* Goal: False *)
        apply H1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst D.
        apply cong_symmetry in H4.
        apply cong_identity in H4.
        subst A.
        unfold CongA in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst D'.
      apply cong_symmetry in H6.
      apply cong_identity in H6.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
      subst A'.
      unfold CongA in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      absurde.
    assert (CongA D B C D' B' C').
      eapply (l11_22a _ _ _ P _ _ _ P').
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply l9_2.
        eapply l9_8_2.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          2: apply H.
        unfold OS in H.
        ex_and H T.
        unfold TS in H.
        unfold TS in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
          apply col_permutation_2.
          eapply (col_transitivity_1 _ D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst D.
            unfold CongA in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
            absurde.
(* Goal: @Col Tn A B C *)
            apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
          right; right.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
        exists B.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply l9_2.
        eapply l9_8_2.
(* Goal: False *)
          2: apply H0.
        unfold OS in H0.
        ex_and H0 T'.
        unfold TS in H0.
        unfold TS in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
          apply H0.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
          apply col_permutation_2.
          eapply (col_transitivity_1 _ D').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst D'.
            unfold CongA in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
            absurde.
(* Goal: @Col Tn A B C *)
            apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
          right; right.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
        exists B'.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      split; assumption.
    eapply l11_13.
      apply H8.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst A.
      unfold CongA in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      absurde.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
    subst A'.
    unfold CongA in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    absurde.
Qed.

Lemma l11_22 :
 forall A B C P A' B' C' P',
 ((TS B P A C /\ TS B' P' A' C')\/
  (OS B P A C /\ OS B' P' A' C')) /\
  CongA A B P A' B' P' /\ CongA P B C  P' B' C' ->
 CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A' B' C' *)
    induction H.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      eapply (l11_22a _ _ _ P _ _ _ P');tauto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    eapply (l11_22b _ _ _ P _ _ _ P');tauto.
Qed.

Lemma l11_24 :
 forall P A B C,
  InAngle P A B C -> InAngle P C B A.
Proof.
(* Goal: forall (P A B C : @Tpoint Tn) (_ : @InAngle Tn P A B C), @InAngle Tn P C B A *)
    unfold InAngle.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) P B)) (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn C X A) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P)))))) *)
    ex_and H2 X.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @Orth Tn A B C V U *)
    exists X.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma out_in_angle :
 forall A B C P,
  Out B A C -> Out B P A ->
  InAngle P A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: forall (P A B C : @Tpoint Tn) (_ : @InAngle Tn P A B C), @InAngle Tn P C B A *)
    unfold InAngle.
    unfold Out in H.
    unfold Out in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @InAngle Tn P A B C *)
    induction H4; induction H2.
      assert(exists X, Midpoint X A C).
        eapply midpoint_existence.
      ex_and H5 X.
(* Goal: @Orth Tn A B C V U *)
      exists X.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        subst X.
        apply midpoint_bet in H6.
        assert (A = B).
          eapply between_equality.
            apply H6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
      induction (eq_dec_points P A).
        subst P.
        eapply between_inner_transitivity.
(* Goal: False *)
          apply H4.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet P A C).
        eapply between_exchange3.
(* Goal: False *)
          apply H2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet P A X).
        eapply between_inner_transitivity.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply outer_transitivity_between.
(* Goal: False *)
        apply H2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      assert(exists X, Midpoint X A C).
        eapply midpoint_existence.
      ex_and H5 X.
(* Goal: @Orth Tn A B C V U *)
      exists X.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        subst X.
        apply midpoint_bet in H6.
        assert (A = B).
          eapply between_equality.
            apply H6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet B C P \/ Bet B P C).
        eapply l5_1.
(* Goal: False *)
          2: apply H4.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @TS Tn P B A C *)
      induction H5.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
        assert(Bet B X C).
          eapply between_exchange2.
(* Goal: False *)
            apply H4.
          apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply between_exchange4.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet B A X).
        eapply between_inner_transitivity.
(* Goal: False *)
          apply H4.
        apply  midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l5_1.
(* Goal: @Out Tn B P1 P2 *)
        2:apply H7.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      assert(Bet B P C \/ Bet B C P).
        eapply l5_3.
(* Goal: False *)
          apply H2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @TS Tn P B A C *)
      induction H5.
        assert(exists X, Midpoint X A C).
          eapply midpoint_existence.
        ex_and H6 X.
(* Goal: @Orth Tn A B C V U *)
        exists X.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
          subst X.
          apply midpoint_bet in H7.
          apply between_symmetry in H7.
          assert (C = B).
            eapply between_equality.
(* Goal: @Out Tn B P1 P2 *)
              apply H7.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Out Tn O B C *)
          contradiction.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
        assert(Bet B C X).
          eapply between_inner_transitivity.
(* Goal: False *)
            apply H4.
          apply midpoint_bet.
          apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply between_exchange4.
          apply H5.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(exists X, Midpoint X A C).
        eapply midpoint_existence.
      ex_and H6 X.
(* Goal: @Orth Tn A B C V U *)
      exists X.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        subst X.
        apply midpoint_bet in H7.
        apply between_symmetry in H7.
        assert (C = B).
          eapply between_equality.
(* Goal: @Out Tn B P1 P2 *)
            apply H7.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert (Bet B C X).
        eapply between_inner_transitivity.
(* Goal: False *)
          apply H4.
        apply midpoint_bet.
        eapply l7_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l5_1.
        2:apply H6.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(exists X, Midpoint X A C).
      eapply midpoint_existence.
    ex_and H5 X.
(* Goal: @Orth Tn A B C V U *)
    exists X.
(* Goal: @LtA Tn A B P A B C *)
    split.
      apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
      subst X.
      apply midpoint_bet in H6.
      apply between_symmetry in H6.
      assert (C = B).
        eapply between_equality.
          apply H6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn O B C *)
      contradiction.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    left.
    assert(Bet B X A).
      eapply between_exchange2.
(* Goal: False *)
        apply H4.
      apply midpoint_bet.
      apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply between_exchange4.
      apply H5.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.


Lemma col_in_angle :
 forall A B C P,
  A <> B -> C <> B -> P <> B ->
  Out B A P \/ Out B C P ->
  InAngle P A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @InAngle Tn P A B C *)
    induction H2.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      exists A.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
        apply between_trivial.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
    exists C.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
      apply between_trivial.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.


Lemma out321__inangle :
 forall A B C P,
  C <> B -> Out B A P ->
  InAngle P A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply col_in_angle; auto.
Qed.


Lemma inangle1123 :
 forall A B C,
  A <> B -> C <> B ->
  InAngle A A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out321__inangle; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_trivial; auto.
Qed.


Lemma out341__inangle :
 forall A B C P,
  A <> B -> Out B C P ->
  InAngle P A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply col_in_angle; auto.
Qed.


Lemma inangle3123 :
 forall A B C,
  A <> B -> C <> B ->
  InAngle C A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out341__inangle; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_trivial; auto.
Qed.


Lemma in_angle_two_sides :
 forall A B C P,
  ~ Col B A P -> ~ Col B C P ->
  InAngle P A B C ->
  TS P B A C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @TS Tn P B A C *)
    unfold InAngle in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @TS Tn P B A C *)
    ex_and H4 X.
(* Goal: @TS Tn P B A C *)
    induction H5.
(* Goal: False *)
      subst X.
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
      unfold TS.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        apply H0.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
        apply col_trivial_3.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
      apply H0.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Orth Tn A B C V U *)
    exists X.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply out_col in H5.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma in_angle_out :
 forall A B C P,
  Out B A C ->
  InAngle P A B C ->
  Out B A P.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
    unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H3 X.
(* Goal: @Lt Tn B C B A *)
    induction H4.
(* Goal: False *)
      subst X.
      assert( Bet A B C /\ Out B A C).
(* Goal: @CongA Tn D E F A B C *)
        split; assumption.
      apply not_bet_and_out in H4.
(* Goal: @Out Tn O B C *)
      contradiction.
    unfold Out in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    induction H8; induction H6.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
      assert(Bet B A X).
        eapply between_inner_transitivity.
          apply H8.
        apply H3.
      eapply between_exchange4.
        apply H9.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
      assert(Bet B A X).
        eapply between_inner_transitivity.
          apply H8.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l5_3.
        apply H9.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
      assert(Bet B X A).
        eapply between_exchange2.
          apply H8.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l5_1.
        2: apply H9.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
    assert(Bet B X A).
      eapply between_exchange2.
        apply H8.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply between_exchange4.
      apply H6.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma col_in_angle_out :
 forall A B C P,
  Col B A P ->
  ~ Bet A B C ->
  InAngle P A B C ->
  Out B A P.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @TS Tn P B A C *)
    unfold InAngle in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @TS Tn P B A C *)
    ex_and H4 X.
(* Goal: @TS Tn P B A C *)
    induction H5.
(* Goal: False *)
      subst X.
(* Goal: @Out Tn O B C *)
      contradiction.
    induction (eq_dec_points A X).
(* Goal: False *)
      subst X.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply not_bet_out in H0.
      assert(Out B A P /\ Out B C P).
        eapply out2_bet_out.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply H5.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Col B A X).
      eapply col_transitivity_1.
        2: apply col_permutation_5.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        2: apply H.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply out_col in H5.
      apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply col_transitivity_2.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
      2: apply col_permutation_3.
(* Goal: @Out Tn B P1 P2 *)
      2:apply H7.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    right; right.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
    apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_25_aux : forall P A B C A',
 InAngle P A B C ->
 ~ Bet A B C ->
 Out B A' A ->
 InAngle P A' B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    unfold Out in H1.
    unfold InAngle in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    repeat  split ; try assumption.
    induction H3.
      ex_and H6 X.
      assert(exists T, Bet A' T C /\ Bet X T B).
        eapply inner_pasch.
          apply H3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H8 T.
      exists T.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
      induction H7.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
(* Goal: @Out Tn O B C *)
        contradiction.
      unfold Out in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst T.
(* Goal: False *)
        apply H0.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        eapply outer_transitivity_between.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H8.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      induction H11.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
        eapply between_exchange4.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l5_3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H9.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H6 X.
    induction H7.
(* Goal: False *)
      subst X.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert(exists T, Bet A' T C /\ Bet B X T).
      eapply outer_pasch.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H8 T.
    exists T.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
    unfold Out in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst T.
      apply between_identity in H9.
(* Goal: False *)
      subst X.
      absurde.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H11.
      eapply l5_1.
        2: apply H9.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
    eapply between_exchange4.
      apply H11.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_25 : forall P A B C A' C' P',
 InAngle P A B C ->
 Out B A' A ->
 Out B C' C ->
 Out B P' P ->
 InAngle P' A' B C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    induction (bet_dec A B C).
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        unfold Out in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        unfold Out in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        unfold Out in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply bet_out_out_bet.
          apply H3.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @eq (@Tpoint Tn) B B *)
      reflexivity.
    assert(InAngle P A' B C).
      eapply l11_25_aux.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(InAngle P A' B C').
(* Goal: @InAngle Tn Q C B A *)
      apply l11_24.
      eapply l11_25_aux.
(* Goal: @InAngle Tn Q C B A *)
        apply l11_24.
(* Goal: False *)
        apply H4.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        eapply bet_out_out_bet.
          apply H5.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
          unfold InAngle in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold InAngle in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H8 X.
    induction H9.
(* Goal: False *)
      subst X.
      apply False_ind.
      apply H3.
      eapply bet_out_out_bet.
        apply H8.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst P'.
      unfold Out in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      absurde.
(* Goal: @Orth Tn A B C V U *)
    exists X.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
    eapply l6_7.
      apply H9.
    apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma inangle_distincts : forall A B C P, InAngle P A B C ->
  A <> B /\ C <> B /\ P <> B.
Proof.
(* Goal: @CongA Tn D E F A B C *)
  intros; unfold InAngle in *; spliter; repeat split; assumption.
Qed.

Lemma segment_construction_0 : forall A B A', exists B', Cong A' B' A B.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: or (@SuppA Tn A B C D E F) (not (@SuppA Tn A B C D E F)) *)
    induction (eq_dec_points A B).
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
      exists A'.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
      subst B.
(* Goal: @Cong Tn A' A' A A *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
      apply cong_trivial_identity.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
    assert(exists X : Tpoint, A' <> X).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => not (@eq (@Tpoint Tn) A' X)) *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
      apply another_point.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
    ex_and H0 X.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
    assert(HH:=segment_construction_3 A' X A B H1 H).
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
    ex_and HH B'.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
    exists B'.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma angle_construction_3 :
 forall A B C A' B',
  A <> B -> C <> B -> A' <> B' ->
  exists C', CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    assert(exists P, ~Col A' B' P).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => not (@Col Tn A' B' P)) *)
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
      eapply not_col_exists.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    ex_and H2 P.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    induction (eq_dec_points A C).
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
      exists A'.
(* Goal: @CongA Tn D E F A B C *)
      apply conga_trivial_1; assumption.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    assert(exists C', CongA A B C A' B' C' /\ (OS A' B' C' P \/ Col A' B' C')).
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (or (@OS Tn A' B' C' P) (@Col Tn A' B' C'))) *)
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
      apply angle_construction_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    ex_and H4 C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_28 : forall A B C D A' B' C',
 Cong_3 A B C A' B' C' -> Col A C D ->
 exists D', Cong A D A' D' /\ Cong B D B' D' /\ Cong C D C' D'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    induction (eq_dec_points A C).
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
(* Goal: @CongA Tn A' B' C' A'' B'' C'' *)
      unfold Cong_3 in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      apply cong_symmetry in H1.
      apply cong_identity in H1.
      subst C'.
(* Goal: or (@SuppA Tn A B C D E F) (not (@SuppA Tn A B C D E F)) *)
      induction(eq_dec_points A B).
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
        apply cong_symmetry in H2.
        apply cong_identity in H2.
(* Goal: False *)
        subst B'.
        assert(exists D', Cong A' D' A D).
          apply segment_construction_0.
        ex_and H1 D'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
        exists D'.
        apply cong_symmetry in H2.
(* Goal: @CongA Tn D E F A B C *)
        repeat split; assumption.
      induction (eq_dec_points A D).
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
        exists A'.
        subst D.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @Cong Tn A' A' A A *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
          apply cong_trivial_identity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A' A' A A *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        apply cong_trivial_identity.
      induction (eq_dec_points B D).
        subst D.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
        exists B'.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A' A' A A *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
          apply cong_trivial_identity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(exists D'', CongA B A D B' A' D'').
        eapply angle_construction_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        subst B'.
        apply cong_identity in H.
(* Goal: @Out Tn O B C *)
        contradiction.
      ex_and H5 D''.
      assert(exists D', Out A' D'' D' /\ Cong A' D' A D).
        apply segment_construction_3.
          unfold CongA in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H5 D'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
      exists D'.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        assert(CongA B A D B' A' D').
          eapply (l11_10 B A D B' A' D''); try apply out_trivial; try solve [auto].
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
(* Goal: False *)
            subst B'.
            unfold CongA in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
            absurde.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply (cong2_conga_cong _ A _ _ A' _).
          apply H8.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A' C' C' A' *)
        Cong.
(* Goal: @Cong Tn A' C' C' A' *)
      Cong.
(* Goal: @CongA Tn A' B' C' A'' B'' C'' *)
    unfold Cong_3 in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    (*****************)
    induction(eq_dec_points A D).
      subst D.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
      exists A'.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Cong Tn A' A' A A *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        apply cong_trivial_identity.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold Col in H0.
    induction H0.
      prolong A' C' D' C D.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
      exists D'.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @CongA Tn D E F A B C *)
        eapply (l2_11 A C D A' C' D'); try assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        eapply (five_segment_with_def A C D B A' C' D' B').
(* Goal: @CongA Tn D E F A B C *)
          repeat split; try assumption.
            apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H0.
      assert(exists D', Bet A' D' C' /\ Cong_3 A D C A' D' C').
        eapply l4_5.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H5 D'.
      unfold Cong_3 in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
      exists D'.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        eapply (l4_2 A D C B A' D' C' B').
(* Goal: @CongA Tn D E F A B C *)
        repeat split; try assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    prolong C' A' D' A D.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
    exists D'.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
      eapply (five_segment_with_def C A D B C' A' D' B').
(* Goal: @CongA Tn D E F A B C *)
        repeat split; try assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    eapply l2_11.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: False *)
      apply H0.
      apply H5.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma bet_conga__bet :
 forall A B C A' B' C',
  Bet A B C ->
  CongA A B C A' B' C' ->
  Bet A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C0.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H4 A1.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    ex_and H5 C1.
    assert(Bet A0 B C0).
      eapply outer_transitivity_between.
        2:apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        eapply outer_transitivity_between.
(* Goal: False *)
          2:apply H4.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(Cong_3 A0 B C0 A1 B' C1).
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        eapply l2_11.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: False *)
          apply H4.
          apply H8.
(* Goal: @Cong Tn B C' E F' *)
          apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
      eapply l2_11.
        apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H10.
        apply cong_symmetry.
(* Goal: @Cong Tn B C' E F' *)
        apply cong_left_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
      apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Bet A1 B' C1).
      eapply l4_6.
        apply H13.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply between_inner_transitivity.
      2:apply H10.
    eapply between_exchange3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
      apply H8.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma out_in_angle_out :
 forall A B C P,
  Out B A C ->
  InAngle P A B C ->
  Out B A P.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
    unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H3 X.
(* Goal: @Lt Tn B C B A *)
    induction H4.
(* Goal: False *)
      subst X.
      unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @TS Tn P B A C *)
      induction H5.
        assert (A = B).
          eapply between_equality.
            apply H3.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn O B C *)
        contradiction.
      assert (C = B).
        eapply between_equality.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H3.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn O B C *)
      contradiction.
    unfold Out in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    induction H6.
      assert(Bet B A X).
        eapply between_inner_transitivity.
          apply H6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Out in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      induction H9.
        assert(Bet B A P).
          eapply between_exchange4.
(* Goal: @Out Tn B P1 P2 *)
            apply H7.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        apply bet_out; assumption.
      assert(Bet B A P \/ Bet B P A).
        eapply l5_3.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Out.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
    assert (Bet B X A).
      eapply between_exchange2.
        apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold Out in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    induction H9.
      assert(Bet B A P \/ Bet B P A).
        eapply l5_1.
(* Goal: @Out Tn B P1 P2 *)
          2: apply H7.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Out.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
    assert(Bet B P A).
      eapply between_exchange4.
        apply H9.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply l6_6.
(* Goal: @CongA Tn D E F A B C *)
    apply bet_out; assumption.
Qed.

Lemma in_angle_one_side :
 forall A B C P,
  ~ Col A B C ->
  ~ Col B A P ->
  InAngle P A B C ->
  OS A B P C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @TS Tn P B A C *)
    unfold InAngle in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @TS Tn P B A C *)
    ex_and H4 X.
(* Goal: @TS Tn P B A C *)
    induction H5.
(* Goal: False *)
      subst X.
      apply False_ind.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold OS.
    prolong C A C' C A.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
    assert(TS A B X C').
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        apply H0.
        eapply (col_transitivity_1 _ X).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
          subst X.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
          left.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          eapply (col_transitivity_1 _ A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
            apply col_permutation_3.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply col_trivial_2.
(* Goal: @Col Tn B A C *)
        apply out_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        eapply (col_transitivity_1 _  C').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C'.
          apply cong_symmetry in H7.
          apply cong_identity in H7.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
          apply col_trivial_3.
(* Goal: @Col Tn A B C *)
          apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      exists A.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply col_trivial_1.
      eapply between_exchange3.
        2: apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply l9_5.
        apply H8.
        2: apply H5.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
      apply col_trivial_3.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
      eapply (col_transitivity_1 _ C').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        unfold TS in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        apply H10.
        apply col_trivial_1.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; right.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @LtA Tn A B P A B C *)
    split.
      apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma inangle_one_side : forall A B C P Q , ~ Col A B C -> ~ Col A B P -> ~ Col A B Q ->
    InAngle P A B C -> InAngle Q A B C ->
    OS A B P Q.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    unfold InAngle in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H9 P'.
    ex_and H6 Q'.
    induction H10.
      subst P'.
      apply bet_col in H9.
(* Goal: @Out Tn O B C *)
      contradiction.
    induction H11.
      subst Q'.
      apply bet_col in H6.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert(OS A B P' Q').
      prolong P' A T A C.
      unfold OS.
      exists T.
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
      unfold TS.
      assert(A <> P').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst P'.
        apply out_col in H10.
(* Goal: False *)
        apply H0.
(* Goal: False *)
        Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      repeat split; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        apply H0.
        assert(P' <> B).
          unfold Out in H10.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply out_col in H10.
        ColR.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        induction(eq_dec_points A T).
          subst T.
          apply cong_symmetry in H13.
          apply cong_identity in H13.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: False *)
          Col.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        apply bet_col in H9.
        apply bet_col in H12.
        assert(Col T A C).
          ColR.
(* Goal: False *)
        eapply (col_transitivity_1 _ T); Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
        exists A.
(* Goal: False *)
        split; Col.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        apply H1.
        assert(Q' <> B).
          unfold Out in H11.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply out_col in H11.
        ColR.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        induction(eq_dec_points A T).
          subst T.
          apply cong_symmetry in H13.
          apply cong_identity in H13.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: False *)
          Col.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        apply bet_col in H9.
        apply bet_col in H12.
        assert(Col T A C).
          ColR.
(* Goal: False *)
        eapply (col_transitivity_1 _ T); Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      exists A.
(* Goal: False *)
      split; Col.
      assert(Bet A P' Q' \/ Bet A Q' P').
        eapply l5_3.
          apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      induction H15.
        eapply (outer_transitivity_between2 _ P'); Between.
      eapply (between_exchange3 P'); Between.
    assert(OS A B P P').
(* Goal: False *)
      eapply (out_one_side_1  _ _ _ _  B); Col.
      apply l6_6.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(OS A B Q Q').
(* Goal: False *)
      eapply (out_one_side_1  _ _ _ _ B); Col.
      apply l6_6.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    eapply one_side_transitivity.
      apply H13.
    apply one_side_symmetry.
    eapply one_side_transitivity.
      apply H14.
    apply one_side_symmetry.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma inangle_one_side2 : forall A B C P Q , ~ Col A B C -> ~ Col A B P -> ~ Col A B Q ->
    ~ Col C B P -> ~ Col C B Q ->
    InAngle P A B C -> InAngle Q A B C ->
    OS A B P Q /\ OS C B P Q.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: False *)
      apply (inangle_one_side _ _ C); Col.
(* Goal: False *)
    apply (inangle_one_side _ _ A); Col.
(* Goal: @InAngle Tn Q C B A *)
      apply l11_24.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @InAngle Tn Q C B A *)
    apply l11_24.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    auto.
Qed.

Lemma col_conga_col : forall A B C D E F, Col A B C -> CongA A B C D E F -> Col D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A' B' C' *)
    induction H.
      assert (Bet D E F).
        eapply bet_conga__bet.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn A B C A' B' C' *)
    induction H.
      assert (Out E D F).
        eapply l11_21_a.
(* Goal: False *)
          2: apply H0.
        apply bet_out in H.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
          unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
      unfold Out in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      unfold Col.
      induction H3.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; right.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Out E D F).
      eapply l11_21_a.
(* Goal: False *)
        2: apply H0.
      apply between_symmetry in H.
      apply bet_out in H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
        unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
    unfold Out in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    unfold Col.
    induction H3.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; right.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    right; left.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma ncol_conga_ncol : forall A B C D E F, ~ Col A B C -> CongA A B C D E F -> ~ Col D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
    apply H.
    eapply col_conga_col.
(* Goal: False *)
      apply H1.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma angle_construction_4 :
 forall A B C A' B' P,
  A <> B -> C <> B -> A' <> B' ->
  exists C', CongA A B C A' B' C' /\ Coplanar A' B' C' P.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@CongA Tn A B C A' B' C') (@Coplanar Tn A' B' C' P)) *)
    destruct (col_dec A' B' P).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      destruct (angle_construction_3 A B C A' B') as [C']; auto.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      exists C'; split; Cop.
(* Goal: @Out Tn B P Q *)
    destruct (col_dec A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      destruct (angle_construction_3 A B C A' B') as [C']; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      exists C'; split; auto.
(* Goal: False *)
      exists C'; left; split; Col.
(* Goal: @CongA Tn D E F A B C *)
      apply (col_conga_col A B C); assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    destruct (angle_construction_1 A B C A' B' P) as [C' []]; auto.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    exists C'; split; Cop.
Qed.

Lemma lea_distincts : forall A B C D E F, LeA A B C D E F ->
   A<>B /\ C<>B /\ D<>E /\ F<>E.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LeA Tn A B C D E F), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
  intros A B C D E F Hlea.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
  destruct Hlea as [X [HInAngle HConga]].
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
  destruct HInAngle as [HDE [HEF _]].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (conga_diff1 A B C D E X); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (conga_diff2 A B C D E X); auto.
Qed.

Lemma gea_distincts : forall A B C D E F, GeA A B C D E F ->
   A<>B /\ C<>B /\ D<>E /\ F<>E.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @GeA Tn A B C D E F), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
  intros A B C D E F Hgea.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
  apply lea_distincts in Hgea.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
Qed.

Lemma l11_29_a : forall A B C D E F, LeA A B C D E F ->
  exists Q, InAngle C A B Q /\ CongA A B Q D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    unfold LeA in H.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@InAngle Tn C A B Q) (@CongA Tn A B Q F E D)) *)
    ex_and H P.
    assert(E <> D /\ B <> A /\ E <> F /\ E <> P /\ B <> C).
      unfold CongA in *.
      unfold InAngle in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(A <> B /\ C <> B).
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      intuition.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HH:=or_bet_out A B C).
(* Goal: @Lt Tn B C B A *)
    induction HH.
      assert(Bet D E P).
        eapply bet_conga__bet.
          apply H8.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
      exists C.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        apply inangle3123; assumption.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
      assert(HH:=H).
      unfold InAngle in HH.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      ex_and H13 X.
      induction H14.
(* Goal: False *)
        subst X.
        assert(Bet E F P \/ Bet E P F).
          eapply (l5_2 D).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply l11_10.
(* Goal: False *)
          apply H0.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out E P F).
        unfold Out in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        induction H16.
          assert( Bet D X P).
            eapply between_exchange2.
              apply H9.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          assert(Bet D E X).
            eapply between_inner_transitivity.
              apply H9.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          assert(Bet D E F).
            eapply between_exchange4.
              apply H18.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          unfold Out.
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
          eapply l5_2.
            2:apply H9.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Bet D P X).
          eapply outer_transitivity_between2.
            apply H9.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Bet D P F).
          eapply between_exchange4.
            apply H17.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Bet E P F).
          eapply between_exchange3.
            apply H9.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l11_10.
(* Goal: False *)
        apply H0.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l6_6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H8.
      assert(exists Q, CongA D E F A B Q).
        apply angle_construction_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H9 Q.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
      exists Q.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
          subst Q.
          unfold CongA in H10.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
          intuition.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        (* absurde.
(* Goal: @CongA Tn D E F A B C *)
        assumption. *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
        exists A.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply between_trivial2.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(D <> E /\ F <> E).
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      intuition.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HH:=or_bet_out D E F).
(* Goal: @Lt Tn B C B A *)
    induction HH.
      prolong A B Q E F.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
      exists Q.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          treat_equalities.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
        exists B.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @eq (@Tpoint Tn) B B *)
        reflexivity.
(* Goal: @CongA Tn D E F A B C *)
      eapply conga_line; try assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        treat_equalities.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
    induction H11.
      assert(Out E D P).
        eapply in_angle_out.
          apply H11.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: False *)
      assert (Out B A C).
        eapply l11_21_a.
          apply H12.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H8.
      apply out_col in H13.
(* Goal: False *)
      Col.
    (************)
    assert(exists Q, CongA D E F A B Q /\ OS A B Q C).
(* Goal: @CongA Tn D E F A B C *)
      apply angle_construction_1; assumption.
    ex_and H12 Q.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
    exists Q.
    assert(exists DD, Out E D DD /\ Cong E DD B A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      eapply segment_construction_3; auto.
    ex_and H14 DD.
    assert(exists FF, Out E F FF /\ Cong E FF B Q).
      eapply segment_construction_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      unfold CongA in H12.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    ex_and H16 FF.
    assert(InAngle P DD E FF).
      eapply l11_25.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(HH18:=H18).
    unfold InAngle in H18.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H21 X.
    induction H22.
(* Goal: False *)
      subst X.
      assert (Bet D E F).
        eapply bet_out_out_bet.
          apply H21.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H11.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(exists CC, Out B C CC /\ Cong B CC E X).
      apply segment_construction_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      unfold Out in H22.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    ex_and H23 CC.
    assert (CongA A B CC DD E X).
      eapply l11_10.
(* Goal: False *)
        apply H0.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong A CC DD X).
      eapply cong2_conga_cong.
        apply H25.
        apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA A B Q DD E FF).
      eapply l11_10.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H12.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
        subst Q.
        apply cong_identity in H17.
        subst FF.
        absurde.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong A Q DD FF).
      eapply cong2_conga_cong.
        apply H27.
        apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA CC B Q X E FF).
      eapply (l11_22b _ _ _ A).
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply one_side_symmetry.
        eapply out_out_one_side.
(* Goal: @OS Tn F D G G0 *)
          apply invert_one_side.
          apply H13.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn A B P A B C *)
      split.
        assert(InAngle X DD E FF).
          eapply l11_25.
            apply HH18.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply in_angle_one_side in H29.
          apply invert_one_side in H29.
          apply H29.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H11.
          eapply col_out2_col.
(* Goal: @Cong Tn A0 C0 A1 C1 *)
            apply H30.
            apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H8.
        eapply col_conga_col.
(* Goal: @CongA Tn A' B C A B C *)
          2:apply conga_sym.
(* Goal: False *)
          2: apply H0.
        eapply col_out2_col.
(* Goal: @Col Tn A B C *)
          apply col_permutation_4.
(* Goal: @Cong Tn A0 C0 A1 C1 *)
          apply H30.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        eapply l11_10.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
(* Goal: @CongA Tn A B C A' B C *)
          apply conga_comm.
(* Goal: False *)
          apply H0.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong CC Q X FF).
      eapply cong2_conga_cong.
        apply H29.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
      assert(InAngle CC A B Q).
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
          subst Q.
          unfold CongA in H12.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst CC.
          unfold CongA in H25.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        exists CC.
(* Goal: @LtA Tn A B P A B C *)
        split.
          eapply l4_6.
            apply H21.
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
            cong.
            cong.
          cong.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
        unfold Out in H23.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      eapply l11_25.
        apply H31.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
        unfold CongA in H27.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma in_angle_line : forall A B C P, P <> B -> A <> B -> C <> B -> Bet A B C -> InAngle P A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
    exists B.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    left.
(* Goal: @eq (@Tpoint Tn) B B *)
    reflexivity.
Qed.


Lemma l11_29_b : forall A B C D E F, (exists Q, InAngle C A B Q /\ CongA A B Q D E F) ->
  LeA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    ex_and H Q.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
    unfold LeA.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert(HH:=H).
    unfold InAngle in HH.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @TS Tn P B A C *)
    ex_and H4 X.
(* Goal: @TS Tn P B A C *)
    induction H5.
(* Goal: False *)
      subst X.
      assert(exists P, CongA A B C D E P).
        apply angle_construction_3.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
        unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H5 P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
      exists P.
(* Goal: @LtA Tn A B P A B C *)
      split.
        assert(Bet D E F).
          eapply bet_conga__bet.
(* Goal: False *)
            apply H4.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply in_angle_line.
          unfold CongA in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          unfold CongA in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
          unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(exists DD, Out E D DD /\ Cong E DD B A).
      apply segment_construction_3.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
        unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    ex_and H6 DD.
    assert(exists FF, Out E F FF /\ Cong E FF B Q).
      apply segment_construction_3.
(* Goal: and (not (@eq (@Tpoint Tn) A'' B'')) (not (@eq (@Tpoint Tn) C'' B'')) *)
(* Goal: @CongA Tn A B C A'' B'' C'' *)
        unfold CongA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    ex_and H8 FF.
    assert(D <> E /\ DD <> E /\ F <> E /\ FF <> E).
      unfold Out in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HI:=or_bet_out A B C).
    induction HI.
(* Goal: @LeA Tn E G F E G D *)
      exists F.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @InAngle Tn F D E F *)
(* Goal: @CongA Tn A B C D E F *)
        apply inangle3123.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA A B C A B Q).
        eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: False *)
            apply H1.
          apply H3.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        unfold Out in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        induction H16.
          assert(Bet A B X).
            eapply between_inner_transitivity.
              apply H14.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          assert(Bet B X Q).
            eapply between_exchange3.
              apply H17.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          assert(Bet B Q C \/ Bet B C Q).
            eapply l5_1.
              2:apply H18.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          unfold Out.
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Bet A B X).
          eapply outer_transitivity_between.
            apply H14.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        assert(Bet B X Q).
          eapply between_exchange3.
            apply H17.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Bet B C Q).
          eapply between_exchange4.
            apply H16.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Out.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply conga_trans.
        apply H15.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H14.
(* Goal: @LeA Tn G E D G E F *)
      exists D.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply inangle1123.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA A B C A B A).
        eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: False *)
            apply H1.
          apply H3.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply conga_trans.
        apply H15.
      apply conga_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HJ:=or_bet_out A B Q).
    induction HJ.
      assert(exists P, CongA A B C D E P).
        apply angle_construction_3.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Out in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      ex_and H16 P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
      exists P.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply in_angle_line.
          unfold CongA in H17.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply bet_conga__bet.
          apply H15.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H15.
(* Goal: False *)
      assert(Out B A C).
        eapply out_in_angle_out.
          apply H15.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H14.
      unfold Out in H16.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      unfold Col.
      induction H18.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; right.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(exists P, CongA A B C D E P /\ OS D E P F).
      eapply angle_construction_1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply ncol_conga_ncol.
        apply H15.
(* Goal: False *)
      apply H0.
    ex_and H16 P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    exists P.
(* Goal: @LtA Tn A B P A B C *)
    split.
      assert(exists PP, Out E P PP /\ Cong E PP B X).
        eapply segment_construction_3.
          unfold CongA in H16.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        unfold Out in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      ex_and H18 PP.
      eapply l11_25.
        2:apply H6.
        2:apply H8.
        2:apply H18.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        unfold Out in H18.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      exists PP.
(* Goal: @LtA Tn A B P A B C *)
      split.
        assert(CongA C B Q P E F).
          eapply (l11_22b _ _ _ A).
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: @OS Tn F D G G0 *)
            apply invert_one_side.
            eapply in_angle_one_side.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
              intro.
              apply H14.
(* Goal: @Col Tn A B C *)
              apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: @OS Tn F D G G0 *)
            apply invert_one_side.
            apply H17.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: @CongA Tn A B C A' B C *)
            apply conga_comm.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert (Cong DD FF A Q).
          eapply cong2_conga_cong.
            eapply l11_10.
(* Goal: @CongA Tn A' B C A B C *)
              apply conga_sym.
(* Goal: False *)
              apply H0.
              apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
              apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
              apply l6_6.
(* Goal: @Out Tn E D D *)
              apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Cong A X DD PP).
          eapply cong2_conga_cong.
            eapply l11_10.
              apply H16.
(* Goal: @Out Tn E D D *)
              apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
              apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
            apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Cong X Q PP FF).
          eapply cong2_conga_cong.
            eapply l11_10.
              apply H20.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Out Tn E D D *)
              apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
              apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
            apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply l4_6.
(* Goal: False *)
          apply H4.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
      unfold Out in H15.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      unfold Out in H18.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma bet_in_angle_bet : forall A B C P, Bet A B P -> InAngle P A B C -> Bet A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
    unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H3 X.
(* Goal: @Lt Tn B C B A *)
    induction H4.
(* Goal: False *)
      subst X.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold Out in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    induction H6.
      assert(Bet A X P).
        eapply between_exchange2.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet A P C \/ Bet A C P).
        eapply (l5_1 _ X).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
          subst X.
          assert(A = B).
            eapply between_equality.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
              apply H.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Out Tn O B C *)
          contradiction.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      induction H8.
        eapply between_exchange4.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet A B X).
        eapply between_inner_transitivity.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply between_exchange4.
        apply H9.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Bet A B X).
      eapply outer_transitivity_between.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    eapply between_exchange4.
(* Goal: @Out Tn B P1 P2 *)
      apply H7.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lea_line : forall A B C P, Bet A B P -> LeA A B P A B C -> Bet A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
    unfold LeA in H0.
    ex_and H0 PP.
    assert (HH:=H0).
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
    unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @TS Tn P B A C *)
    ex_and H4 X.
(* Goal: @TS Tn P B A C *)
    induction H5.
(* Goal: False *)
      subst X.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Bet A B PP).
      eapply bet_conga__bet.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply bet_in_angle_bet.
      apply H6.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.


Lemma eq_conga_out : forall A B D E F, CongA A B A D E F -> Out E D F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert(HH:=H).
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F')))))))) *)
    ex_and H3 A'.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @CongA Tn A B C A' B' C') *)
    ex_and H4 C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F')))))))) *)
    ex_and H3 D'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F')))))))) *)
    ex_and H4 F'.
    assert(Cong_3 B A' C' E D' F').
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        eapply l2_11.
          apply H3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
(* Goal: @Cong Tn B C0 B' C1 *)
          apply cong_right_commutativity.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
        eapply l2_11.
          apply H5.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
          apply H9.
(* Goal: @Cong Tn B C0 B' C1 *)
          apply cong_right_commutativity.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn B C0 B' C1 *)
        apply cong_right_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Out E D' F').
      eapply cong3_preserves_out.
        2:apply H12.
      unfold Out.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
        subst A'.
        apply between_identity in H3.
        subst A.
        absurde.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        apply between_identity in H5.
        subst A.
        absurde.
      eapply l5_1.
        2:apply H3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply bet2_out_out.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      apply H13.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_ex_cong3 : forall A B C A' B' C',
  CongA A B C A' B' C' -> exists AA, exists CC, Out B A AA -> Out B C CC -> Cong_3 AA B CC A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(B <> A /\ B <> C /\ B' <> A' /\ B' <> C').
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
      unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      repeat split; auto.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(exists AA, Out B A AA /\ Cong B AA B' A').
(* Goal: @CongA Tn D E F A B C *)
      apply segment_construction_3; assumption.
    assert(exists CC, Out B C CC /\ Cong B CC B' C').
(* Goal: @CongA Tn D E F A B C *)
      apply segment_construction_3; assumption.
    ex_and H4 AA.
    ex_and H5 CC.
    exists AA.
    exists CC.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
      eapply cong2_conga_cong.
        eapply l11_10.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Cong Tn A' C' C' A' *)
        Cong.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_preserves_in_angle : forall A B C I A' B' C' I',
 CongA A B C A' B' C' -> CongA A B I A' B' I' ->
 InAngle I A B C -> OS A' B' I' C' ->
 InAngle I' A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(A <> B /\ C <> B /\ A' <> B' /\ C' <> B' /\ I <> B /\ I' <> B').
      unfold CongA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HH1:= or_bet_out A B C).
    induction HH1.
      assert(Bet A' B' C').
        eapply bet_conga__bet.
          apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      apply in_angle_line; assumption.
    induction H9.
      assert(Out B A I).
        eapply out_in_angle_out.
          apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out B' A' I').
        eapply l11_21_a.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply out_in_angle.
        eapply l11_21_a.
          apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HH2:= or_bet_out A B I).
    induction HH2.
      assert(Bet A B C).
        eapply bet_in_angle_bet.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H9.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H10.
      assert(Out B' A' I').
        eapply l11_21_a.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      eapply col_in_angle; try assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    (*****************************)
    assert(exists AA', Out B' A' AA' /\ Cong B' AA' B A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply segment_construction_3; auto.
    assert(exists CC', Out B' C' CC' /\ Cong B' CC' B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply segment_construction_3; auto.
    ex_and H11 AA'.
    ex_and H12 CC'.
    assert(HH:=H1).
(* Goal: @TS Tn P B A C *)
    unfold InAngle in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H17 J.
    induction H18.
      subst J.
(* Goal: @CongA Tn D E F A B C *)
      eapply in_angle_line; try assumption.
      eapply bet_conga__bet.
        apply H17.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(B <> J).
      unfold Out in H18.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(~Col A B J).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H10.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      apply col_permutation_2.
      eapply (col_transitivity_1 _ J).
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn B A C *)
        apply out_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(exists J', CongA A B J  A' B' J' /\ OS A' B' J' I').
      apply angle_construction_1.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H10.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
        eapply (col_transitivity_1 _ J).
          unfold Out in H18.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Col Tn B A C *)
          apply out_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply ncol_conga_ncol.
        apply H10.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H21 J'.
    assert(B' <> J').
      unfold CongA in H21.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(exists JJ', Out B' J' JJ' /\ Cong B' JJ' B J).
      apply segment_construction_3.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H24 JJ'.
    assert(~Col A' B' J').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H20.
      eapply col_conga_col.
        apply H26.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(A' <> JJ').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst JJ'.
      apply H20.
      eapply col_conga_col.
        apply out_col in H24.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
        apply H24.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(B' <> JJ').
      unfold Out in H24.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(~Col A' B' JJ').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H26.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      apply col_permutation_2.
      eapply (col_transitivity_1 _ JJ').
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        apply col_permutation_5.
(* Goal: @Col Tn B A C *)
        apply out_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    (****************************************************************)
    assert(CongA A B C AA' B' CC').
      eapply l11_10.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA A' B' J' A' B' JJ').
      eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
          apply H5.
        3: apply H24.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(Out B' I' JJ' \/ TS A' B' I' JJ').
      apply conga_cop__or_out_ts.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      apply coplanar_perm_2, col_cop__cop with J'; Col; Cop.
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: False *)
        apply H0.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H31.
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H21.
      eapply l11_10.
        apply (conga_refl A B I).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    induction H32.
      assert(CongA J B C J' B' C').
        eapply (l11_22b _ _ _ A _ _ _ A').
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @OS Tn F D G G0 *)
          apply invert_one_side.
          apply in_angle_one_side.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H10.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
            apply col_permutation_2.
            eapply (col_transitivity_1 _ J).
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Col Tn B A C *)
              apply out_col.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          eapply l11_25.
(* Goal: False *)
(* Goal: not (@Col Tn A B C) *)
(* Goal: @Lt Tn B C B A *)
            apply HH.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
          eapply one_side_transitivity.
(* Goal: @OS Tn F D G G0 *)
            2:apply invert_one_side.
(* Goal: False *)
            2:apply H2.
(* Goal: @OS Tn F D G G0 *)
          apply invert_one_side.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @CongA Tn A B C A' B C *)
          apply conga_comm.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Cong A C AA' CC').
        eapply cong2_conga_cong.
          eapply l11_10.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
            apply H.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
            apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Cong A J AA' JJ').
        eapply cong2_conga_cong.
          eapply l11_10.
(* Goal: False *)
            apply H0.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
            apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA J' B' C' JJ' B' CC').
        eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
            4:apply H12.
          3:apply H24.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          unfold CongA in H30.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
        unfold CongA in H30.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(Cong J C JJ' CC').
        eapply (cong2_conga_cong).
          eapply conga_trans.
            apply H33.
          apply H36.
          apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet AA' JJ' CC').
        eapply l4_6.
          apply H17.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l11_25.
        2: apply H11.
        2: apply H12.
(* Goal: forall (P A B C : @Tpoint Tn) (_ : @InAngle Tn P A B C), @InAngle Tn P C B A *)
        unfold InAngle.
(* Goal: @CongA Tn D E F A B C *)
        repeat split; try assumption.
          unfold Out in H11.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          unfold Out in H12.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          3:apply H32.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      exists JJ'.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(OS B' A' I' JJ').
      eapply out_out_one_side.
(* Goal: @OS Tn F D G G0 *)
        apply invert_one_side.
        apply one_side_symmetry.
        apply H22.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply invert_two_sides in H32.
    apply l9_9 in H32.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma l11_30 : forall A B C D E F A' B' C' D' E' F',
 LeA A B C D E F ->
 CongA A B C A' B' C' ->
 CongA D E F D' E' F' ->
 LeA A' B' C' D' E' F'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A'' B'' C'' *)
    assert(HH:=H).
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@InAngle Tn C A B Q) (@CongA Tn A B Q F E D)) *)
    apply l11_29_a in H.
    ex_and H Q.
(* Goal: @LeA Tn A B C F E D *)
    apply l11_29_b.
    assert(A <> B /\ C <> B /\ A' <> B' /\ C' <> B' /\ D <> E /\ F <> E /\ D' <> E' /\ F' <> E').
      unfold CongA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(Hi:=or_bet_out A' B' C').
    induction Hi.
      prolong A' B' Q' A' B'.
      exists Q'.
      assert(B' <> Q').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst Q'.
        apply cong_symmetry in H13.
        apply cong_identity in H13.
(* Goal: @Out Tn O B C *)
        contradiction.
      assert(A' <> Q').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst Q'.
        apply between_identity in H12.
(* Goal: @Out Tn O B C *)
        contradiction.
      assert(CongA A' B' Q' A' B' C').
(* Goal: @CongA Tn D E F A B C *)
        apply conga_line; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        apply in_angle_line; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(Bet A B C).
        eapply bet_conga__bet.
          apply H11.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet A B Q).
        eapply lea_line.
          apply H17.
(* Goal: @LeA Tn A B C F E D *)
        apply l11_29_b.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
        exists Q.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold CongA in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet D E F).
        eapply bet_conga__bet.
          apply H18.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert (Bet D' E' F').
        eapply bet_conga__bet.
          apply H19.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      eapply conga_line; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
    (************************)
    induction H11.
      assert(exists Q', CongA D' E' F' A' B' Q').
(* Goal: @CongA Tn D E F A B C *)
        eapply angle_construction_3; assumption.
      ex_and H12 Q'.
      exists Q'.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        apply col_in_angle; try assumption.
          unfold CongA in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Hi:=or_bet_out D' E' F').
    induction Hi.
      assert(exists Q', CongA  D' E' F' A' B' Q').
(* Goal: @CongA Tn D E F A B C *)
        eapply angle_construction_3; try assumption.
      ex_and H13 Q'.
      exists Q'.
      assert(Bet A' B' Q').
        eapply bet_conga__bet.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        apply in_angle_line; try assumption.
        unfold CongA in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H12.
      assert(exists Q', CongA  D' E' F' A' B' Q').
(* Goal: @CongA Tn D E F A B C *)
        eapply angle_construction_3; try assumption.
      ex_and H13 Q'.
      exists Q'.
      assert(Out B' A' Q').
        eapply l11_21_a.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA A B Q D' E' F').
        eapply conga_trans.
(* Goal: False *)
          apply H2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out B A Q).
        eapply l11_21_a.
          apply H12.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: False *)
      assert(Out B A C).
        eapply out_in_angle_out.
          apply H16.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out  B' A' C').
        eapply l11_21_a.
          apply H17.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply out_in_angle.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(exists QQ, CongA D' E' F' A' B' QQ /\ OS A' B' QQ C').
      eapply angle_construction_1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H13 Q'.
    exists Q'.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply conga_preserves_in_angle.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        3: apply H.
        eapply conga_trans.
(* Goal: False *)
          apply H2.
        eapply conga_trans.
(* Goal: False *)
          apply H1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: False *)
        apply H0.
      (************** etrange ****************)
(* Goal: @CongA Tn D E F A B C *)
      try assumption.
      apply one_side_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_31_1 : forall A B C D E F,
 Out B A C -> D <> E -> F <> E ->
 LeA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
    unfold LeA.
(* Goal: @LeA Tn G E D G E F *)
    exists D.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      apply inangle1123; assumption.
(* Goal: @CongA Tn C B A C B C *)
    apply l11_21_b.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Out Tn E D D *)
    apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    auto.
Qed.

Lemma l11_31_2 : forall A B C D E F,
 A <> B -> C <> B -> D <> E -> F <> E ->
 Bet D E F ->
 LeA A B C D E F.
Proof.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
intros; destruct (angle_construction_3 A B C D E) as [P HCongA]; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
exists P; split; try apply in_angle_line; unfold CongA in *; spliter; auto.
Qed.

Lemma lea_refl : forall A B C,
 A <> B -> C <> B -> LeA A B C A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
    unfold LeA.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
    exists C .
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      apply inangle3123; assumption.
(* Goal: @CongA Tn D E F A B C *)
    apply conga_refl; assumption.
Qed.

Lemma conga__lea : forall A B C D E F,
 CongA A B C D E F -> LeA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
    unfold LeA.
(* Goal: @LeA Tn E G F E G D *)
    exists F.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @InAngle Tn F D E F *)
(* Goal: @CongA Tn A B C D E F *)
      apply inangle3123.
(* Goal: @CongA Tn D E F A B C *)
        apply (conga_diff45 A B C D E F); assumption.
(* Goal: @CongA Tn D E F A B C *)
        apply (conga_diff56 A B C D); assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga__lea456123 : forall A B C D E F,
 CongA A B C D E F -> LeA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @CongA Tn A B C D E F), @LeA Tn D E F A B C *)
    intros; apply conga__lea, conga_sym; trivial.
Qed.

Lemma lea_out4__lea : forall A B C D E F A' C' D' F',
 LeA A B C D E F -> Out B A A' -> Out B C C' -> Out E D D' -> Out E F F' ->
 LeA A' B C' D' E F'.
Proof.
(* Goal: forall (A B C D E F A' C' D' F' : @Tpoint Tn) (_ : @LeA Tn A B C D E F) (_ : @Out Tn B A A') (_ : @Out Tn B C C') (_ : @Out Tn E D D') (_ : @Out Tn E F F'), @LeA Tn A' B C' D' E F' *)
    intros A B C D E F A' C' D' F' Hl HA HC HD HF.
(* Goal: @CongA Tn D E F A B C *)
    apply (l11_30 A B C D E F); trivial; apply out2__conga; apply l6_6; assumption.
Qed.

Lemma lea121345 : forall A B C D E, A<>B -> C<>D -> D<>E -> LeA A B A C D E.
Proof.
(* Goal: forall (A B C D E : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) C D)) (_ : not (@eq (@Tpoint Tn) D E)), @LeA Tn A B A C D E *)
  intros A B C D E HAB HCD HDE.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_31_1; try (apply out_trivial); auto.
Qed.

Lemma inangle__lea : forall A B C P, InAngle P A B C -> LeA A B P A B C.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : @InAngle Tn P A B C), @LeA Tn A B P A B C *)
  intros A B C P HIn.
(* Goal: @LeA Tn Q B P C B A *)
  exists P; split; trivial.
(* Goal: @LtA Tn F E D0 C B A0 *)
  unfold InAngle in HIn; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply conga_refl; auto.
Qed.

Lemma in_angle_trans : forall A B C D E,
 InAngle C A B D -> InAngle D A B E -> InAngle C A B E.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(HA1 :=H).
    assert(HA2:= H0).
    unfold InAngle in H.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
    unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H3 DD.
    ex_and H6 CC.
    induction H8; induction H7.
      subst CC.
      subst DD.
(* Goal: @CongA Tn D E F A B C *)
      apply in_angle_line; assumption.
      subst CC.
      assert(Bet A B E).
        eapply bet_in_angle_bet.
          apply H6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      apply in_angle_line; assumption.
      subst DD.
(* Goal: @CongA Tn D E F A B C *)
      apply in_angle_line; assumption.
    assert(InAngle C A B DD).
      eapply l11_25.
        apply HA1.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    unfold InAngle in H9.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H12 CC'.
    induction H13.
      subst CC'.
      assert(Bet A B E).
        eapply between_exchange4.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      apply in_angle_line; assumption.
    eapply l11_25.
      4: apply l6_6.
      4:apply H13.
(* Goal: @Out Tn E D D *)
      2: apply out_trivial.
(* Goal: @Out Tn E D D *)
      3: apply out_trivial.
(* Goal: forall (P A B C : @Tpoint Tn) (_ : @InAngle Tn P A B C), @InAngle Tn P C B A *)
      unfold InAngle.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
        unfold Out in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      exists CC'.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply between_exchange4.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
      unfold Out in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    auto.
Qed.

Lemma lea_trans : forall A B C A1 B1 C1 A2 B2 C2,
 LeA A B C A1 B1 C1 ->
 LeA A1 B1 C1 A2 B2 C2 ->
 LeA A B C A2 B2 C2.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(Hlea1 := H).
    assert (Hlea2 := H0).
    unfold LeA in H.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
    unfold LeA in H0.
    ex_and H P1.
    ex_and H0 P2.
    assert( A <> B /\ C <> B /\ A1 <> B1 /\ C1 <> B1 /\ A2 <> B2 /\ C2 <> B2).
      unfold CongA in *.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
      unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HH1 := or_bet_out A B C).
    induction HH1.
      assert(Bet A1 B1 P1).
        eapply bet_conga__bet.
          apply H9.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet A1 B1 C1).
        eapply bet_in_angle_bet.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet A2 B2 P2).
        eapply bet_conga__bet.
          apply H11.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet A2 B2 C2).
        eapply bet_in_angle_bet.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      apply l11_31_2; assumption.
    induction H9.
(* Goal: @CongA Tn D E F A B C *)
      apply l11_31_1; assumption.
    assert(HH2 := or_bet_out A2 B2 C2).
    induction HH2.
(* Goal: @CongA Tn D E F A B C *)
      apply l11_31_2; assumption.
    induction H10.
      assert(Out B2 A2 P2).
        eapply in_angle_out.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out B1 A1 C1).
        eapply l11_21_a.
          apply H11.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out B1 A1 P1).
        eapply in_angle_out.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: False *)
      assert(Out B A C).
        eapply l11_21_a.
          apply H13.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      apply l11_31_1; assumption.
    assert(exists P, CongA A B C A2 B2 P /\ OS A2 B2 P C2).
(* Goal: @CongA Tn D E F A B C *)
      apply angle_construction_1; assumption.
    ex_and H11 P.
    assert (OS A2 B2 P2 C2).
      apply in_angle_one_side.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        assert (B2 <> A2).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        assert(P2 <> A2).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst P2.
          assert(Out B1 A1 C1).
            eapply l11_21_a.
(* Goal: @CongA Tn A' B C A B C *)
              2: apply conga_sym.
(* Goal: False *)
              2:apply H2.
(* Goal: @Out Tn E D D *)
            apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          assert(Out B1 A1 P1).
            eapply out_in_angle_out.
              apply H14.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: False *)
          assert(Out B A C).
            eapply l11_21_a.
              apply H15.
(* Goal: @CongA Tn A' B C A B C *)
            apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply H9.
          apply out_col in H16.
(* Goal: @Col Tn A B C *)
          apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(HH:=or_bet_out A2 B2 P2 ).
(* Goal: @Lt Tn B C B A *)
        induction HH.
          assert (Bet A2 B2 C2).
            eapply bet_in_angle_bet.
              apply H15.
(* Goal: False *)
            apply H0.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H10.
          unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
          left.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          induction H15.
            assert(Out B1 A1 C1).
              eapply l11_21_a.
                apply H15.
(* Goal: @CongA Tn A' B C A B C *)
              apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            assert( Out B1 A1 P1).
              eapply in_angle_out.
                apply H16.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: False *)
            assert (Out B A C).
              eapply l11_21_a.
                apply H17.
(* Goal: @CongA Tn A' B C A B C *)
              apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            apply False_ind.
            apply H9.
            apply out_col in H18.
(* Goal: @Col Tn A B C *)
            apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H15.
(* Goal: @Col Tn A B C *)
          apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold CongA in H2.
    assert(OS A2 B2 P P2).
      eapply one_side_transitivity.
        apply H12; eapply l11_21_a.
      apply one_side_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
    unfold LeA.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    exists P.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply (in_angle_trans _ _ _ P2).
        eapply conga_preserves_in_angle.
(* Goal: False *)
          apply H2.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          2: apply H.
          eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
            apply conga_sym.
(* Goal: False *)
            apply H1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.


Lemma in_angle_asym : forall A B C D,
 InAngle D A B C -> InAngle C A B D -> CongA A B C A B D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    unfold InAngle in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H3 CC.
    ex_and H6 DD.
    induction H7; induction H8.
      subst DD.
      subst CC.
(* Goal: @CongA Tn D E F A B C *)
      apply conga_line; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      subst CC.
      unfold Out in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      induction H9.
        assert(Bet A B C).
          eapply between_exchange4.
            2: apply H6.
          eapply between_inner_transitivity.
            apply H3.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        apply conga_line; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
      assert(Bet A B C).
        eapply between_exchange4.
          eapply outer_transitivity_between.
            apply H3.
            apply H9.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        apply conga_line; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
      subst DD.
      assert(Bet A B D).
        unfold Out in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        induction H9.
          eapply between_exchange4.
            eapply between_inner_transitivity.
              apply H6.
            apply H9.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply between_exchange4.
          eapply outer_transitivity_between.
            apply H6.
            apply H9.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        apply conga_line; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
    assert(exists B', Bet CC B' C /\ Bet DD B' D).
      eapply inner_pasch.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
        apply H3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H9 X.
    assert (Out B X C).
      eapply out_bet_out_2.
(* Goal: @Out Tn B P1 P2 *)
        apply H7.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Out B X D).
      eapply out_bet_out_2.
        apply H8.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Out B C D).
      eapply out2_out_1.
        apply H11.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
      apply conga_refl.
        4:apply H13.
(* Goal: @Out Tn E D D *)
      3: apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Out Tn B P1 P2 *)
      assumption; apply H7.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Out Tn E D D *)
    apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    auto.
Qed.

Lemma lea_asym : forall A B C D E F,
 LeA A B C D E F -> LeA D E F A B C -> CongA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Lt Tn B C B A *)
    induction (col_dec A B C).
      induction (bet_dec A B C).
(* Goal: @LtA Tn F E D0 C B A0 *)
        apply lea_distincts in H0; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply conga_line; auto.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@InAngle Tn C A B Q) (@CongA Tn A B Q F E D)) *)
        ex_and H P.
        apply bet_in_angle_bet with P; trivial.
(* Goal: @CongA Tn D E F A B C *)
        apply (bet_conga__bet A B C); assumption.
      apply not_bet_out in H2; trivial.
(* Goal: @CongA Tn D E F C B C *)
      apply l11_21_b; trivial.
      ex_and H0 P.
      apply (l11_21_a A B P).
(* Goal: @CongA Tn D E F A B C *)
        apply out_in_angle_out with C; assumption.
(* Goal: @CongA Tn D E F A B C *)
      apply conga_sym; assumption.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@InAngle Tn C A B Q) (@CongA Tn A B Q F E D)) *)
    apply l11_29_a in H.
(* Goal: @LeA Tn C B A D E F *)
    unfold LeA in *.
    ex_and H Q.
    ex_and H0 P.
    assert(A <> B /\ Q <> B /\ P <> B /\ D <> E /\ F <> E).
      unfold CongA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(CongA A B Q A B P).
      eapply conga_trans.
(* Goal: False *)
        apply H2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HH1:= or_bet_out A B Q).
    induction HH1.
      assert(Bet A B P).
        eapply bet_conga__bet.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet A B C).
        eapply bet_in_angle_bet.
          apply H11.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet D E F).
        eapply bet_conga__bet.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      eapply conga_line; try assumption.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
        unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
    induction H10.
      assert(Out E D F).
        eapply l11_21_a.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out B A P).
        eapply l11_21_a.
          apply H11.
        apply H3.
(* Goal: False *)
      assert(Out B A C).
        eapply in_angle_out.
          apply H10.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn C B A C B C *)
      eapply l11_21_b.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HH2:= or_bet_out A B P).
    induction HH2.
      assert(Bet A B C).
        eapply bet_in_angle_bet.
          apply H11.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Bet D E F).
        eapply bet_conga__bet.
          apply H11.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      apply conga_line; try assumption.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
        unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
    induction H11.
      assert(Out B A Q).
        eapply l11_21_a.
          apply H11.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: False *)
      assert (Out B A C).
        eapply in_angle_out.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Out E D F).
        eapply l11_21_a.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn C B A C B C *)
      apply l11_21_b.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Out B P Q \/ TS A B P Q).
      apply conga_cop__or_out_ts.
(* Goal: False *)
      apply coplanar_trans_1 with C; Cop; Col.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H12.
      assert(InAngle C A B P).
        eapply l11_25.
          3: apply H12.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
        subst C.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
        unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
      assert(CongA A B C A B P).
(* Goal: @CongA Tn D E F A B C *)
        apply in_angle_asym; assumption.
      eapply conga_trans.
        apply H14.
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H9.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(C <> B).
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
      unfold InAngle in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HH:=or_bet_out A B C).
(* Goal: @Lt Tn B C B A *)
    induction HH.
      assert(Bet A B Q).
        eapply bet_in_angle_bet.
          apply H14.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
      apply False_ind.
      apply H10.
      unfold Col.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H14.
      assert(Out B A P).
        eapply in_angle_out.
          apply H14.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H11.
      apply out_col in H15.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply in_angle_one_side in H.
      apply in_angle_one_side in H0.
        assert(OS A B P Q).
          eapply one_side_transitivity.
(* Goal: False *)
            apply H0.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply l9_9 in H15.
(* Goal: @Out Tn O B C *)
          contradiction.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H11.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    apply H14.
(* Goal: @Col Tn A B C *)
    apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma col_lta__bet : forall A B C X Y Z, Col X Y Z -> LtA A B C X Y Z -> Bet X Y Z.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: False *)
    destruct H0.
(* Goal: @Out Tn E D F *)
    assert (Hd := H0).
(* Goal: @Bet Tn X Y Z *)
    apply not_out_bet.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply H1.
(* Goal: @CongA Tn D E F G H I *)
    apply lea_asym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LeA Tn X Y Z A B C *)
    apply lea_distincts in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_31_1; auto.
Qed.

Lemma col_lta__out : forall A B C X Y Z, Col A B C -> LtA A B C X Y Z -> Out B A C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Out Tn B A C *)
    apply not_bet_out.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    destruct H0.
(* Goal: False *)
    apply H2.
(* Goal: @CongA Tn D E F G H I *)
    apply lea_asym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LeA Tn X Y Z A B C *)
    apply lea_distincts in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_31_2; auto.
Qed.

Lemma lta_distincts : forall A B C D E F, LtA A B C D E F ->
   A<>B /\ C<>B /\ D<>E /\ F<>E /\ D <> F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LtA Tn A B C D E F), not (@LeA Tn D E F A B C) *)
  intros A B C D E F Hlta.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (not (@eq (@Tpoint Tn) D F))))) *)
  assert (Hlea : LeA A B C D E F) by (destruct Hlta; assumption).
(* Goal: @CongA Tn D E F D E F *)
  apply lea_distincts in Hlea.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: False *)
  subst F.
(* Goal: False *)
  assert (Bet D E D) by (apply (col_lta__bet A B C); Col).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  treat_equalities; auto.
Qed.

Lemma gta_distincts : forall A B C D E F, GtA A B C D E F ->
   A<>B /\ C<>B /\ D<>E /\ F<>E /\ A <> C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @GtA Tn A B C D E F), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (not (@eq (@Tpoint Tn) A C))))) *)
  intros A B C D E F Hgta.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (not (@eq (@Tpoint Tn) A C))))) *)
  apply lta_distincts in Hgta.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
Qed.

Lemma acute_distincts : forall A B C, Acute A B C -> A<>B /\ C<>B.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Acute Tn A B C), and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C B)) *)
  intros A B C Hacute.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C B)) *)
  destruct Hacute as [x [y [z [HPer Hlta]]]].
(* Goal: @LtA Tn G H I D E F *)
  apply lta_distincts in Hlta.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  split; auto.
Qed.

Lemma obtuse_distincts : forall A B C, Obtuse A B C -> A<>B /\ C<>B /\ A <> C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Obtuse Tn A B C), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (not (@eq (@Tpoint Tn) A C))) *)
  intros A B C Hobtuse.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (not (@eq (@Tpoint Tn) A C))) *)
  destruct Hobtuse as [x [y [z [HPer Hgta]]]].
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (not (@eq (@Tpoint Tn) A C))) *)
  apply gta_distincts in Hgta.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  split; auto.
Qed.

Lemma two_sides_in_angle : forall A B C P P',
 B <> P' ->
 TS B P A C ->
 Bet P B P' ->
 InAngle P A B C \/ InAngle P' A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    unfold TS in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    ex_and H3 T.
    assert(A <> B).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst A.
(* Goal: False *)
      apply H0.
      apply col_trivial_1.
    assert(C <> B).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
(* Goal: False *)
      apply H2.
      apply col_trivial_1.
    induction (eq_dec_points B T).
      subst T.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
(* Goal: False *)
        Col.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @eq (@Tpoint Tn) B B *)
      reflexivity.
    assert(P <> B /\ T <> B).
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
(* Goal: False *)
        Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HH:= or_bet_out P B T).
(* Goal: @Lt Tn B C B A *)
    induction HH.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: forall (P A B C : @Tpoint Tn) (_ : @InAngle Tn P A B C), @InAngle Tn P C B A *)
      unfold InAngle.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
        unfold Out in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      exists T.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
      unfold Out.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      eapply l5_2.
        2:apply H10.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction H10.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: forall (P A B C : @Tpoint Tn) (_ : @InAngle Tn P A B C), @InAngle Tn P C B A *)
      unfold InAngle.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
      exists T.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
      apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply col_permutation_3 in H3.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma in_angle_reverse :
 forall A B A' C D,
  A' <> B ->
  Bet A B A' ->
  InAngle C A B D ->
  InAngle D A' B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert (Hd := H1).
(* Goal: @InAngle Tn D C B E *)
    apply inangle_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    induction (col_dec B A C).
      assert(HH:=or_bet_out C B A).
(* Goal: @Lt Tn B C B A *)
      induction HH.
        assert(Bet A B D).
          eapply bet_in_angle_bet.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
            apply between_symmetry.
            apply H6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Out B A' C).
(* Goal: @CongA Tn D E F A B C *)
          repeat split; try assumption.
          eapply l5_2.
(* Goal: False *)
            apply H2.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert( Out B D A').
(* Goal: @CongA Tn D E F A B C *)
          repeat split; try assumption.
          eapply l5_2.
(* Goal: False *)
            apply H2.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply out_in_angle.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      induction H6.
(* Goal: @CongA Tn D E F A B C *)
        repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
        exists B.
(* Goal: @LtA Tn A B P A B C *)
        split.
          unfold Out in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          induction H8.
            eapply between_inner_transitivity.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
              apply between_symmetry.
(* Goal: False *)
              apply H0.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          eapply outer_transitivity_between.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
            apply between_symmetry.
(* Goal: False *)
            apply H0.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @eq (@Tpoint Tn) B B *)
        reflexivity.
      apply False_ind.
      apply H6.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    induction (col_dec B D C).
      assert(HH:=or_bet_out C B D).
(* Goal: @Lt Tn B C B A *)
      induction HH.
        assert(OS A B C D).
          apply in_angle_one_side.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H5.
            eapply (col_transitivity_1 _ D).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
              apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(TS A B C D).
(* Goal: @CongA Tn D E F A B C *)
          repeat split; try assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H5.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
            apply col_permutation_3.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H5.
            eapply (col_transitivity_1 _ D).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
              apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
          exists B.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
            apply col_trivial_3.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply l9_9 in H9.
(* Goal: @Out Tn O B C *)
        contradiction.
      induction H7.
        assert(InAngle C A' B C).
(* Goal: @CongA Tn D E F A B C *)
          apply inangle3123; assumption.
        eapply l11_25.
          apply H8.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
(* Goal: @Out Tn B P1 P2 *)
      apply H7.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert( HH:= H1).
    apply in_angle_two_sides in HH.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
      assert(HH1:=H1).
(* Goal: @TS Tn P B A C *)
      unfold InAngle in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      ex_and H9 X.
      induction H10.
(* Goal: False *)
        subst X.
(* Goal: @CongA Tn D E F A B C *)
        apply col_in_angle; try assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        repeat split; try assumption.
        eapply l5_2.
(* Goal: False *)
          apply H1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(HH0:= HH).
      unfold TS in HH.
      assert (C <> B).
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
(* Goal: False *)
        Col.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      assert(OS D B C A).
        apply in_angle_one_side.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H12.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
          eapply (col_transitivity_1 _ X).
            unfold Out in H10.
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
            eapply (col_transitivity_1 _ D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
              intro.
              subst D.
              apply between_identity in H9.
(* Goal: False *)
              subst X.
              ex_and H14 T.
              apply between_identity in H14.
              subst T.
(* Goal: @Out Tn O B C *)
              contradiction.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
              apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            apply col_permutation_5.
(* Goal: @Col Tn A B D *)
            apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Col Tn B A C *)
          apply out_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H13.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @InAngle Tn Q C B A *)
        apply l11_24.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(~Col A D B).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H12.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
        eapply (col_transitivity_1 _ X).
          unfold Out in H10.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
          eapply (col_transitivity_1 _ D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst D.
            apply between_identity in H9.
(* Goal: False *)
            subst X.
            apply H13.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
(* Goal: @Col Tn B A C *)
            apply out_col.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply col_permutation_5.
(* Goal: @Col Tn A B D *)
          apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn B A C *)
        apply out_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(~Col A' D B).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H16.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
        eapply (col_transitivity_1 _ A').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
(* Goal: @Col Tn A B D *)
          apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(TS D B A A').
(* Goal: @CongA Tn D E F A B C *)
        repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
        exists B.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
          apply col_trivial_3.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(TS D B C A' ).
        eapply l9_8_2.
          apply H18.
        apply one_side_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold TS in H19.
      assert (~ Col C D B).
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      ex_and H22 Y.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
      exists Y.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
      apply col_permutation_1 in H22.
      unfold Col in H22.
      induction H22.
        assert(OS C B A' Y).
          apply out_one_side.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
            left.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H12.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
            eapply (col_transitivity_1 _ A').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
              apply col_permutation_1.
(* Goal: @Col Tn A B D *)
              apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply l6_6.
          apply bet_out.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst Y.
            apply H13.
            apply col_permutation_5.
(* Goal: @Col Tn A B D *)
            apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(TS C B Y D).
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H20.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
            eapply (col_transitivity_1 _ Y).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
              intro.
              subst Y.
              unfold OS in H24.
              ex_and H24 C0.
              unfold TS in H26.
(* Goal: @LtA Tn F E D0 C B A0 *)
              spliter.
              apply H26.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
              apply col_trivial_3.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
              apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
(* Goal: @Col Tn A B D *)
            apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H20.
(* Goal: @Col Tn A B C *)
            apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
          exists B.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
            apply col_trivial_3.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(TS C B A A').
(* Goal: @CongA Tn D E F A B C *)
          repeat split; try assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            apply H12.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
            eapply (col_transitivity_1 _ A').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
              apply col_permutation_1.
(* Goal: @Col Tn A B D *)
              apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
            apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
          exists B.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
            apply col_trivial_3.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(TS C B Y A).
          eapply l9_8_2.
            apply l9_2.
            apply H26.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(OS C B A D).
          eapply l9_8_1.
            apply l9_2.
            apply H27.
          apply l9_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply l9_9 in HH0.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst Y.
        apply H12.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
        eapply (col_transitivity_1 _ A').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
(* Goal: @Col Tn A B D *)
          apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
(* Goal: @Col Tn A B D *)
        apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      induction H22.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H5.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma in_angle_trans2 : forall A B C D E, InAngle C A B D -> InAngle D A B E -> InAngle D C B E.
Proof.
(* Goal: forall (A B C D E : @Tpoint Tn) (_ : @InAngle Tn C A B D) (_ : @InAngle Tn D A B E), @InAngle Tn D C B E *)
  intros A B C D E HC HD.
(* Goal: @InAngle Tn D C B E *)
  destruct (segment_construction E B E B) as [E' [HE1 HE2]].
(* Goal: @InAngle Tn D C B E *)
  assert (Hd := HD).
(* Goal: @InAngle Tn D C B E *)
  apply inangle_distincts in Hd.
(* Goal: @SuppA Tn A B C A B B' *)
  spliter; assert_diffs.
(* Goal: @InAngle Tn D C B E *)
  apply l11_24, in_angle_reverse with E'; Between.
(* Goal: @InAngle Tn C E' B D *)
  apply l11_24, in_angle_trans with A; apply l11_24; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply in_angle_reverse with E; auto.
(* Goal: @InAngle Tn D E B A *)
  apply l11_24; trivial.
Qed.

Lemma l11_36 : forall A B C D E F A' D',
 A <> B -> A' <> B -> D <> E -> D' <> E ->
 Bet A B A' -> Bet D E D' ->
 (LeA A B C D E F <-> LeA D' E F A' B C).
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      assert(HH:=H5).
      apply l11_29_a in H5.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
      unfold LeA.
      ex_and H5 P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
      exists P.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        eapply (in_angle_reverse A); try assumption.
      eapply l11_13.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(HH:=H5).
    unfold LeA in H5.
(* Goal: @LeA Tn A B C F E D *)
    apply l11_29_b.
    ex_and H5 P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    exists P.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      eapply (in_angle_reverse A'); try assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply l11_13.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
      apply H6.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_41_aux : forall A B C D,
 ~ Col A B C ->
 Bet B A D ->
 A <> D ->
 LtA A C B C A D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(exists M , Midpoint M A C).
      apply midpoint_existence.
    ex_and H2 M.
    double B M P.
    assert(Cong_3 A C B C A P).
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @eq (@Tpoint Tn) B B *)
        apply cong_pseudo_reflexivity.
        eapply l7_13.
          apply l7_2.
          apply H3.
        apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply l7_13.
        apply H3.
      apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(A <> C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
      apply col_trivial_3.
    assert(B <> C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
      apply col_trivial_2.
    assert(C <> D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @Col Tn A B D *)
      apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(A <> M).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst M.
      apply is_midpoint_id in H3.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert(CongA A C B C A P).
(* Goal: @CongA Tn D E F A B C *)
      apply cong3_conga; assumption.
    assert(exists X, Bet A X P /\ Bet M X D).
      eapply inner_pasch.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: False *)
        apply H0.
      apply midpoint_bet.
      apply l7_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    ex_and H10 X.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
      unfold LeA.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
      exists P.
(* Goal: @LtA Tn A B P A B C *)
      split.
        assert(InAngle P M A D).
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst P.
            unfold CongA in H9.
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
            absurde.
(* Goal: @Orth Tn A B C V U *)
          exists X.
(* Goal: @LtA Tn A B P A B C *)
          split.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
          right.
          apply bet_out.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
(* Goal: False *)
            subst X.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
            apply H.
            eapply (col_transitivity_1 _ M).
(* Goal: @CongA Tn D E F A B C *)
              assumption.
              eapply (col_transitivity_1 _ D).
(* Goal: @CongA Tn D E F A B C *)
                assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
                apply col_permutation_1.
(* Goal: @Col Tn A B D *)
                apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
                assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
              apply col_permutation_1.
(* Goal: @Col Tn A B D *)
              apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Col Tn A B D *)
            apply bet_col.
            apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        eapply l11_25.
          apply H12.
          apply l6_6.
          apply bet_out.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
          apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
        unfold CongA in H9.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(CongA C A D C A P).
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H12.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert (Coplanar C A D P).
(* Goal: @SuppA Tn A B C A B B' *)
      assert_diffs.
(* Goal: False *)
      apply coplanar_perm_3, col_cop__cop with B; Col.
      exists M.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: False *)
      split; Col.
    apply conga_cop__or_out_ts in H13; trivial.
    induction H13.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
      assert(Col B A P).
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
        eapply (col_transitivity_1 _ D).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn B A C *)
          apply out_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
(* Goal: @Col Tn A B D *)
        apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(B <> P).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst P.
        apply l7_3 in H2.
        subst M.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Col Tn A B D *)
        apply bet_col.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Col M B A).
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
        eapply (col_transitivity_1 _ P).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply col_permutation_5.
(* Goal: @Col Tn A B D *)
        apply bet_col.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply col_transitivity_1.
        apply H8.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn A B D *)
      apply bet_col.
      apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(TS A C B P).
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        assert(Col M C P).
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
          apply col_permutation_2.
          eapply (col_transitivity_1 _ A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
            apply col_permutation_3.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
          apply col_permutation_2.
(* Goal: @Col Tn A B D *)
          apply bet_col.
          apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Col M B C).
          eapply (col_transitivity_1 _ P).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst M.
            apply l7_2 in H2.
            apply is_midpoint_id in H2.
            subst P.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
            apply H.
(* Goal: @Col Tn A B C *)
            apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
            apply col_permutation_1.
(* Goal: @Col Tn A B D *)
            apply bet_col.
            apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
        eapply (col_transitivity_1 _ M).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst M.
          apply l7_2 in H3.
          apply is_midpoint_id in H3.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
          subst C.
          absurde.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
          apply col_permutation_3.
(* Goal: @Col Tn A B D *)
          apply bet_col.
          apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      exists M.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @Col Tn A B D *)
        apply bet_col.
        apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply midpoint_bet.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(TS A C B D).
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        eapply (col_transitivity_1 _ D).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
(* Goal: @Col Tn A B D *)
          apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      exists A.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(OS A C D P).
      unfold OS.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply l9_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l9_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply invert_two_sides in H13.
    apply l9_9 in H13.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

(** This is exterior angle theorem *)

Lemma l11_41 : forall A B C D,
  ~ Col A B C ->
  Bet B A D ->
  A <> D ->
  LtA A C B C A D /\ LtA A B C C A D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn A B P A B C *)
    split.
      apply l11_41_aux.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    prolong C A E C A.
    assert(LtA A B C B A E).
      eapply l11_41_aux.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        assert_diffs;auto.
    assert(CongA B A C C A B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    {
(* Goal: @CongA Tn A B C D E F *)
      apply conga_left_comm.
      apply conga_refl;
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      assert_diffs;auto.
    }
    assert(CongA D A C E A B)
      by (eapply l11_13 with B C;assert_diffs;auto).
(* Goal: @LtA Tn D' E F A' B C *)
    unfold LtA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
      eapply l11_30 with A B C B A E;finish.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply conga_refl;assert_diffs;auto.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn A B C A' B C *)
      apply conga_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @Out Tn B P1 P2 *)
    apply H7.
    eapply conga_trans.
      apply H8.
(* Goal: @CongA Tn A B C A' B C *)
    apply conga_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma not_conga : forall A B C A' B' C' D E F ,
 CongA A B C A' B' C' ->
 ~ CongA A B C D E F ->
 ~ CongA A' B' C' D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply H0.
    eapply conga_trans.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma not_conga_sym : forall A B C D E F,
 ~ CongA A B C D E F ->
 ~ CongA D E F A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
    apply H.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma not_and_lta : forall A B C D E F, ~ (LtA A B C D E F /\ LtA D E F A B C).
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @LtA Tn D' E F A' B C *)
    unfold LtA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: False *)
    assert(CongA A B C D E F).
(* Goal: @CongA Tn D E F G H I *)
      apply lea_asym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma conga_preserves_lta : forall A B C D E F A' B' C' D' E' F',
 CongA A B C A' B' C' ->
 CongA D E F D' E' F' ->
 LtA A B C D E F ->
 LtA A' B' C' D' E' F'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn D' E F A' B C *)
    unfold LtA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply l11_30.
(* Goal: False *)
        apply H1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply H2.
    eapply conga_trans.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
    eapply conga_trans.
      apply H3.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_preserves_gta : forall A B C D E F A' B' C' D' E' F',
 CongA A B C A' B' C' ->
 CongA D E F D' E' F' ->
 GtA A B C D E F ->
 GtA A' B' C' D' E' F'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @GtA Tn C B A A' B' C' *)
    unfold GtA in *.
    eapply conga_preserves_lta.
(* Goal: False *)
      apply H0.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lta_trans : forall A B C A1 B1 C1 A2 B2 C2,
 LtA A B C A1 B1 C1 ->
 LtA A1 B1 C1 A2 B2 C2 ->
 LtA A B C A2 B2 C2.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(HH1:= H).
    assert(HH2:= H0).
(* Goal: False *)
    unfold LtA in H.
(* Goal: not (@Per Tn A B C) *)
    unfold LtA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(LeA A B C A2 B2 C2).
      eapply lea_trans.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(LtA A2 B2 C2 A1 B1 C1).
      eapply conga_preserves_lta.
(* Goal: False *)
        apply H4.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
          unfold LeA in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
          ex_and H0 X.
          unfold CongA in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
        unfold LeA in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
        ex_and H0 X.
        unfold CongA in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply (not_and_lta A1 B1 C1 A2 B2 C2).
(* Goal: @CongA Tn D E F A B C *)
    split; assumption.
Qed.

Lemma gta_trans : forall A B C A1 B1 C1 A2 B2 C2,
 GtA A B C A1 B1 C1 ->
 GtA A1 B1 C1 A2 B2 C2 ->
 GtA A B C A2 B2 C2.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @GtA Tn C B A A' B' C' *)
    unfold GtA in *.
    eapply lta_trans.
(* Goal: False *)
      apply H0.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lea_left_comm : forall A B C D E F, LeA A B C D E F -> LeA C B A D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LeA Tn C B A D E F *)
    unfold LeA in *.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@InAngle Tn C A B Q) (@CongA Tn A B Q F E D)) *)
    ex_and H P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    exists P.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn A B C D E F *)
    apply conga_left_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lea_right_comm : forall A B C D E F, LeA A B C D E F -> LeA A B C F E D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LeA Tn A B C F E D *)
    apply l11_29_b.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@InAngle Tn C A B Q) (@CongA Tn A B Q F E D)) *)
    apply l11_29_a in H.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@InAngle Tn C A B Q) (@CongA Tn A B Q F E D)) *)
    ex_and H P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    exists P.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn A B C D E F *)
    apply conga_right_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lea_comm : forall A B C D E F, LeA A B C D E F -> LeA C B A F E D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LeA Tn P B Q A B C *)
    apply lea_left_comm.
(* Goal: @LeA Tn P B Q A B C *)
    apply lea_right_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lta_left_comm : forall A B C D E F, LtA A B C D E F -> LtA C B A D E F.
Proof.
(* Goal: @LtA Tn A B A A B C *)
    unfold LtA.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @LeA Tn P B Q A B C *)
      apply lea_left_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply H0.
(* Goal: @CongA Tn A B C D E F *)
    apply conga_left_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lta_right_comm : forall A B C D E F, LtA A B C D E F -> LtA A B C F E D.
Proof.
(* Goal: @LtA Tn A B A A B C *)
    unfold LtA.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @LeA Tn P B Q A B C *)
      apply lea_right_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply H0.
(* Goal: @CongA Tn A B C D E F *)
    apply conga_right_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma lta_comm : forall A B C D E F, LtA A B C D E F -> LtA C B A F E D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn C B A F E D *)
    apply lta_left_comm.
(* Goal: @LtA Tn A' B' C' C B A *)
    apply lta_right_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma obtuse_sym : forall A B C, Obtuse A B C -> Obtuse C B A.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Obtuse Tn A B C), @Obtuse Tn C B A *)
    unfold Obtuse.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Per Tn A B C) *)
    ex_and H A'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H0 B'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
    exists B'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @GtA Tn C B A A' B' C' *)
    unfold GtA in *.
(* Goal: @LtA Tn A' B' C' C B A *)
    apply lta_right_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma acute_sym : forall A B C, Acute A B C -> Acute C B A.
Proof.
(* Goal: @Acute Tn A B A *)
    unfold Acute.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Per Tn A B C) *)
    ex_and H A'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H0 B'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
    exists B'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C') *)
    split;auto using lta_left_comm.
Qed.

Lemma acute_col__out : forall A B C, Col A B C -> Acute A B C -> Out B A C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Bet Tn A B C *)
    destruct H0 as [X [Y [Z []]]].
(* Goal: @CongA Tn D E F A B C *)
    apply col_lta__out with X Y Z; assumption.
Qed.

Lemma col_obtuse__bet : forall A B C, Col A B C -> Obtuse A B C -> Bet A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Bet Tn A B C *)
    destruct H0 as [X [Y [Z []]]].
(* Goal: @CongA Tn D E F A B C *)
    apply (col_lta__bet X Y Z); assumption.
Qed.

Lemma out__acute : forall A B C, Out B A C -> Acute A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Out Tn B A C), @Acute Tn A B C *)
  intros A B C Hout.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Obtuse Tn A B C *)
  assert(HD := perp_exists B A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct HD as [D]; auto.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
  exists A.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
  exists B.
(* Goal: @LeA Tn G E D G E F *)
  exists D.
(* Goal: and (@Per Tn A B D) (@GtA Tn A B C A B D) *)
  split; Perp.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_31_1; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: False *)
  assert(HNCol : ~ Col A B D) by (apply per_not_col; Perp).
(* Goal: False *)
  apply HNCol.
(* Goal: @Col Tn A B C *)
  apply col_permutation_4.
(* Goal: @Col Tn B A C *)
  apply out_col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (l11_21_a A B C); auto.
Qed.

Lemma bet__obtuse : forall A B C, Bet A B C -> A <> B -> B <> C -> Obtuse A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)), @Obtuse Tn A B C *)
  intros A B C HBet HAB HBC.
(* Goal: @Obtuse Tn A B C *)
  assert(HD := perp_exists B A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct HD as [D]; auto.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
  exists A.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
  exists B.
(* Goal: @LeA Tn G E D G E F *)
  exists D.
(* Goal: and (@Per Tn A B D) (@GtA Tn A B C A B D) *)
  split; Perp.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_31_2; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: False *)
  assert(HNCol : ~ Col A B D) by (apply per_not_col; Perp).
(* Goal: False *)
  apply HNCol.
(* Goal: @Col Tn A B D *)
  apply bet_col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (bet_conga__bet A B C); try (apply conga_sym); auto.
Qed.

Lemma l11_43_aux : forall A B C, A <> B -> A <> C -> (Per B A C \/ Obtuse B A C) -> Acute A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Lt Tn B C B A *)
    induction (col_dec A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      induction H1.
(* Goal: @Out Tn B C T' *)
        exfalso.
(* Goal: False *)
        apply (per_not_col B A C); Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply out__acute, bet_out; auto.
(* Goal: False *)
      apply col_obtuse__bet; Col.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    prolong B A B' B A.
    assert(~ Col B' A C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
      apply H2.
      eapply (col_transitivity_1 _ B').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        subst B'.
        apply cong_symmetry in H4.
        apply cong_identity in H4.
        subst A.
(* Goal: False *)
        apply H2.
        apply col_trivial_1.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
(* Goal: @Col Tn A B D *)
        apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply not_col_distincts in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(LtA A C B C A B'/\ LtA A B C C A B').
      apply l11_41.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    induction H1.
(* Goal: @Acute Tn A B A *)
      unfold Acute.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
      exists C.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      exists A.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @LtA Tn A B A A B C *)
      unfold LtA.
      unfold LtA in H11.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      assert(Per B' A C).
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
        eapply (per_col _ _ B).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
          apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @Col Tn A B D *)
        apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(CongA B A C B' A C).
        apply l11_16.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply l11_30.
          apply H11.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn A B C A' B C *)
        apply conga_comm.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H12.
      eapply conga_trans.
        apply H15.
(* Goal: @CongA Tn A B C A' B C *)
      apply conga_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Acute Tn A B A *)
    unfold Acute.
    unfold Obtuse in H1.
    ex_and H1 a.
    ex_and H12 b.
    ex_and H1 c.
    unfold GtA in H12.
    assert(HH1:= H12).
    unfold LtA in H12.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    unfold LeA in H12.
    ex_and H12 P.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
    exists B.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    exists P.
    assert(Per B A P).
      eapply l11_17.
(* Goal: False *)
        apply H1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Per P A B').
      eapply per_col.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @Col Tn A B D *)
      apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA B A P B' A P).
      eapply l11_16.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst P.
        unfold CongA in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        absurde.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst P.
      unfold CongA in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      absurde.
    assert(LtA C A B' P A B).
      assert(B <> A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(HH := l11_36 B A P B A C B' B' H18 H7 H18 H7 H3 H3).
      destruct HH.
(* Goal: @LtA Tn A B A A B C *)
      unfold LtA.
(* Goal: @LtA Tn A B P A B C *)
      split.
        eapply l11_30.
          apply H19.
          unfold LtA in HH1.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          eapply l11_30.
            apply H21.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn A B C D E F *)
          apply conga_left_comm.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn A B C D E F *)
        apply conga_right_comm.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H13.
      assert(Per B' A C).
        eapply l11_17.
          apply H15.
(* Goal: @CongA Tn A B C A' B C *)
        apply conga_comm.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Per C A B).
        eapply (per_col _ _ B').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
          apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
(* Goal: @Col Tn A B D *)
        apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l11_16.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        unfold CongA in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        unfold CongA in H14.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    eapply lta_trans.
      apply H11.
(* Goal: @LtA Tn A' B' C' C B A *)
    apply lta_right_comm.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma l11_43 : forall A B C, A <> B -> A <> C -> (Per B A C \/ Obtuse B A C) -> Acute A B C /\ Acute A C B.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l11_43_aux;auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_43_aux;auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    induction H1.
      left;finish.
(* Goal: @CongA Tn D E F A B C *)
    right;apply obtuse_sym;assumption.
Qed.

Lemma acute_lea_acute : forall A B C D E F, Acute D E F -> LeA A B C D E F -> Acute A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    unfold Acute in *.
(* Goal: not (@Per Tn A B C) *)
    ex_and H A'.
    ex_and H1 B'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
    exists B'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    assert(HH1:=H1).
    unfold LtA in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B A A B C *)
    unfold LtA.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply lea_trans.
(* Goal: False *)
        apply H0.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(LtA A' B' C' D E F).
      eapply conga_preserves_lta.
        apply H3.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
          unfold LeA in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
          ex_and H0 X.
          unfold CongA in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply lea_comm in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
        unfold LeA in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
        ex_and H0 X.
        unfold CongA in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
      apply H2.
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: False *)
        apply H4.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply (not_and_lta A' B' C' D E F).
(* Goal: @CongA Tn D E F A B C *)
    split; assumption.
Qed.

Lemma obtuse_gea_obtuse : forall A B C D E F, Obtuse D E F -> GeA A B C D E F -> Obtuse A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Per Tn A B C) *)
    ex_and H A'.
    ex_and H1 B'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H C'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
    exists B'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
    exists C'.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    assert(HH1:=H1).
    unfold GtA in H1.
    unfold LtA in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @GtA Tn A B C D E F *)
    unfold GtA.
(* Goal: @LtA Tn A B A A B C *)
    unfold LtA.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply lea_trans.
(* Goal: False *)
        apply H1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(GtA A' B' C' D E F).
      eapply conga_preserves_gta.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H3; apply H3.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
          unfold LeA in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
          ex_and H0 X.
          unfold CongA in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply lea_comm in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
        unfold LeA in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
        ex_and H0 X.
        unfold CongA in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @GtA Tn A B C D E F *)
      unfold GtA.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
      apply H2.
      eapply conga_trans.
        apply H3.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @GtA Tn C B A A' B' C' *)
    unfold GtA in *.
    apply (not_and_lta A' B' C' D E F).
(* Goal: @CongA Tn D E F A B C *)
    split; assumption.
Qed.

(** In an isosceles triangle the two base angles are equal.
    This is Euclid: Book 1, Proposition 5.
 *)

Lemma l11_44_1_a : forall A B C, A <> B -> A <> C -> Cong B A B C -> CongA B A C B C A.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn B A C B C A *)
    destruct (midpoint_existence A C) as [P HP].
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @CongA Tn B A C B C A *)
    assert(Cong_3 B C P B A P) by (repeat split;finish).
(* Goal: @CongA Tn B A C B C A *)
    assert(CongA B C P B A P) by (auto using cong3_conga).
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
    eapply l11_10 with B P B P;finish.
Qed.

(** This is Euclid: Book 1, Proposition 18 *)

Lemma l11_44_2_a : forall A B C, ~ Col A B C -> Lt B A B C -> LtA B C A B A C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Cong Tn B A B C *)
    apply not_col_distincts in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    unfold Lt in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    unfold Le in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    ex_and H0 C'.
    assert(C <> C').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C'.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert(C' <> A).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C'.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @Col Tn A B D *)
      apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(C' <> B).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C'.
      apply cong_identity in H5.
      subst A.
      absurde.
    assert(InAngle C' B A C).
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
      exists C'.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(HH:=l11_41 C' C A B).
    assert(LtA C' A C A C' B /\ LtA C' C A A C' B).
(* Goal: False *)
(* Goal: not (@Col Tn A B C) *)
(* Goal: @Lt Tn B C B A *)
      apply HH.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
        eapply col_transitivity_1.
          apply H6.
(* Goal: @Col Tn A B C *)
          apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
        apply col_permutation_3.
(* Goal: @Col Tn A B D *)
        apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
        apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    clear HH.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(LtA B A C' B A C).
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
        unfold LeA.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
        exists C'.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      apply conga_cop__or_out_ts in H12; Cop.
      induction H12.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
        apply out_col in H12.
        apply bet_col in H0.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
        eapply col_transitivity_1.
          apply H6.
(* Goal: False *)
          Col.
(* Goal: False *)
        Col.
      assert(OS B A C' C).
        apply out_one_side.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
          right.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: False *)
          Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply bet_out;auto.
      apply l9_9 in H12.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert(LtA B C A A C' B).
      eapply conga_preserves_lta.
        3: apply H11.
        eapply out_conga.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: False *)
            apply H2.
          apply H3.
          apply l6_6.
          apply bet_out.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
      apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(CongA B A C' B C' A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (l11_44_1_a A B C'); auto.
    apply conga_right_comm in H14.
    assert(LtA B C A B A C').
      eapply conga_preserves_lta.
(* Goal: @CongA Tn A' B C A B C *)
        2: apply conga_sym.
        2: apply H14.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    eapply lta_trans.
      apply H15.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma not_lta_and_conga : forall A B C D E F, ~ (LtA A B C D E F /\ CongA A B C D E F).
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: False *)
    unfold LtA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma not_gta_and_conga : forall A B C D E F, ~ (GtA A B C D E F /\ CongA A B C D E F).
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: False *)
    unfold GtA in H.
(* Goal: False *)
    unfold LtA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Cong Tn B A B C *)
(* Goal: not (@Col Tn A B C) *)
(* Goal: @Cong Tn B A B C *)
    apply conga_sym in H0.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma not_lta_and_gta : forall  A B C D E F, ~ (LtA A B C D E F /\ GtA A B C D E F).
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: False *)
    unfold GtA in H0.
(* Goal: @LtA Tn D' E F A' B C *)
    unfold LtA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: False *)
    apply H2.
(* Goal: @CongA Tn D E F G H I *)
    apply lea_asym.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_sym_equiv : forall A B C A' B' C', CongA A B C A' B' C' <-> CongA A' B' C' A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A' B C A B C *)
    split; apply conga_sym.
Qed.

Lemma conga_dec :
  forall A B C D E F,
   CongA A B C D E F \/ ~ CongA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: or (@SuppA Tn A B C D E F) (not (@SuppA Tn A B C D E F)) *)
    induction (eq_dec_points A B).
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      subst;right;intro;unfold CongA in *;intuition.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    induction (eq_dec_points C B).
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      subst;right;intro;unfold CongA in *;intuition.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    induction (eq_dec_points D E).
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      subst;right;intro;unfold CongA in *;intuition.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    induction (eq_dec_points F E).
(* Goal: @Out Tn B P1 B *)
(* Goal: @Col Tn A B P2 *)
(* Goal: @Out Tn B P1 P2 *)
      subst;right;intro;unfold CongA in *;intuition.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    assert (exists A' : Tpoint, Bet B A A' /\ Cong A A' E D) by (apply segment_construction).
    decompose [ex and] H3; clear H3.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    assert (exists C' : Tpoint, Bet B C C' /\ Cong C C' E F) by (apply segment_construction).
    decompose [ex and] H3; clear H3.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    assert (exists D' : Tpoint, Bet E D D' /\ Cong D D' B A) by (apply segment_construction).
    decompose [ex and] H3; clear H3.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    assert (exists F' : Tpoint, Bet E F F' /\ Cong F F' B C) by (apply segment_construction).
    decompose [ex and] H3; clear H3.
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
    induction (cong_dec x x0 x1 x2).
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: not (@CongA Tn A B C D E F) *)
      unfold CongA.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))) *)
(* Goal: or (@CongA Tn A B C D E F) (not (@CongA Tn A B C D E F)) *)
      exists x; exists x0; exists x1; exists x2.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: not (@CongA Tn A B C D E F) *)
    unfold CongA.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    decompose [and ex] H4; clear H4.
(* Goal: False *)
    assert (x3 = x) by (apply construction_uniqueness with B A E D; intuition).
(* Goal: False *)
    assert (x4 = x0) by (apply construction_uniqueness with B C E F; intuition).
(* Goal: False *)
    assert (x5 = x1) by (apply construction_uniqueness with E D B A; intuition).
(* Goal: False *)
    assert (x6 = x2) by (apply construction_uniqueness with E F B C; intuition).
(* Goal: False *)
    subst.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma lta_not_conga : forall A B C D E F, LtA A B C D E F -> ~ CongA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    unfold LtA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

(** If the base angles are equal, then the triangle is isosceles *)

Lemma l11_44_1_b : forall A B C, ~ Col A B C -> CongA B A C B C A -> Cong B A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Cong Tn B A B C *)
    apply not_col_distincts in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Lt Tn B C B A *)
    assert(HH:= or_lt_cong_gt B A B C).
(* Goal: @Lt Tn B C B A *)
    induction HH.
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      apply l11_44_2_a in H4.
(* Goal: @Cong Tn B A B C *)
(* Goal: not (@Col Tn C B A) *)
(* Goal: @Cong Tn B A B C *)
        apply lta_not_conga in H4.
(* Goal: @Cong Tn B A B C *)
(* Goal: not (@Col Tn A B C) *)
(* Goal: @Cong Tn B A B C *)
          apply conga_sym in H0.
(* Goal: @Out Tn O B C *)
          contradiction.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Lt Tn B C B A *)
    induction H4.
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      unfold Gt in H4.
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      apply l11_44_2_a in H4.
(* Goal: @Cong Tn B A B C *)
(* Goal: not (@Col Tn C B A) *)
(* Goal: @Cong Tn B A B C *)
        apply lta_not_conga in H4.
(* Goal: @Out Tn O B C *)
          contradiction.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      apply H.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
      apply col_permutation_3.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

(** This is Euclid Book I, Proposition 19 *)

Lemma l11_44_2_b : forall A B C, LtA B A C B C A -> Lt B C B A.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Lt Tn B C B A *)
    induction (col_dec A B C).
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      assert (Hd := H).
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      apply lta_distincts in Hd; spliter; clean_reap_hyps.
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      apply col_lta__bet in H; Col; Le.
(* Goal: @Lt Tn B C B A *)
    apply not_col_distincts in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Lt Tn B C B A *)
    assert(HH:= or_lt_cong_gt B A B C).
(* Goal: @Lt Tn B C B A *)
    induction HH.
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      apply l11_44_2_a in H4.
(* Goal: @Lt Tn B C B A *)
(* Goal: not (@Col Tn A B C) *)
(* Goal: @Lt Tn B C B A *)
        assert(HH:= not_lta_and_gta B A C B C A).
(* Goal: @Out Tn B C T' *)
        exfalso.
(* Goal: False *)
(* Goal: not (@Col Tn A B C) *)
(* Goal: @Lt Tn B C B A *)
        apply HH.
(* Goal: @CongA Tn D E F A B C *)
        split; assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Lt Tn B C B A *)
    induction H4.
(* Goal: @Lt Tn B C B A *)
(* Goal: @Lt Tn B C B A *)
      unfold Gt in H4.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_44_1_a in H4; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply lta_not_conga in H; auto.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

Lemma l11_44_1 : forall A B C, ~ Col A B C -> (CongA B A C B C A <-> Cong B A B C).
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Col Tn A B C)), iff (@CongA Tn B A C B C A) (@Cong Tn B A B C) *)
    intros;assert_diffs;split;intro; auto using l11_44_1_b, l11_44_1_a.
Qed.

Lemma l11_44_2 : forall A B C, ~ Col A B C -> (LtA B A C B C A <-> Lt B C B A).
Proof.
    intros;split;intro;
    auto using l11_44_2_b, l11_44_2_a with col. 
Qed.

Lemma l11_46 : forall A B C, A <> B -> B <> C -> (Per A B C \/ Obtuse A B C) -> Lt B A A C /\ Lt B C A C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Lt Tn B C B A *)
    induction (col_dec A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      induction H1.
(* Goal: @Out Tn B C T' *)
        exfalso.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply (per_not_col A B C); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply col_obtuse__bet in H1; auto.
      repeat split; Le.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Cong Tn A' C' C' A' *)
        apply H0, between_cong with A; Cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H, eq_sym, between_cong with C; finish.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    assert(HH:= H1).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_43 in H1; auto.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @LtA Tn A B P A B C *)
      split.
        apply lt_left_comm.
        apply l11_44_2_b.
        unfold Acute in H3.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Out Tn B A' A) (and (@Out Tn B C C') (and (@Out Tn E D' D) (and (@Out Tn E F F') (@Cong_3 Tn A' B C' D' E F')))))))) *)
        ex_and H3 A'.
        ex_and H4 B'.
        ex_and H3 C'.
        assert (Hd := H4).
(* Goal: @Lt Tn E F B C *)
        apply lta_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Lt Tn B C B A *)
        induction HH.
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
         {
            eapply conga_preserves_lta with A C B A' B' C'.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              apply conga_refl;auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              apply l11_16;auto.
(* Goal: @LtA Tn C B A F E D *)
          apply lta_left_comm.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
         }
        unfold Obtuse in H11.
        ex_and H11 A''.
        ex_and H12 B''.
        ex_and H11 C''.
        unfold GtA in H12.
        eapply lta_trans.
(* Goal: @LtA Tn C B A F E D *)
          apply lta_left_comm.
(* Goal: False *)
          apply H4.
        eapply conga_preserves_lta with A'' B'' C'' A B C.
          assert (Hd := H12).
(* Goal: @Lt Tn E F B C *)
          apply lta_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          apply l11_16.
            apply H11.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply lt_left_comm.
      apply lt_right_comm.
      eapply l11_44_2_b.
        finish.
      unfold Acute in H1.
(* Goal: @Acute Tn D E F *)
      ex_and H1 A'.
      ex_and H4 B'.
      ex_and H1 C'.
      assert (Hd := H4).
(* Goal: @Lt Tn E F B C *)
      apply lta_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Lt Tn B C B A *)
      induction HH.
        eapply conga_preserves_lta.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply l11_16.
(* Goal: False *)
            apply H1.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
            apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn C B A F E D *)
        apply lta_left_comm.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Obtuse in H11.
      ex_and H11 A''.
      ex_and H12 B''.
      ex_and H11 C''.
      unfold GtA in H12.
      eapply lta_trans.
(* Goal: @LtA Tn C B A F E D *)
        apply lta_left_comm.
(* Goal: False *)
        apply H4.
      eapply conga_preserves_lta.
        apply lta_distincts in H12.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        apply l11_16.
          apply H11.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @LtA Tn A' B' C' C B A *)
      apply lta_right_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
Qed.

Lemma l11_47 : forall A B C H , Per A C B -> Perp_at H C H A B ->
 Bet A H B /\ A <> H /\ B <> H.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
    assert(HH1:= H1).
    unfold Perp_at in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(Per C H A).
      apply H5.
        apply col_trivial_1.
      apply col_trivial_1.
    assert(Perp C H A B).
      eapply l8_14_2_1a.
      apply HH1.
    induction (col_dec A C B).
      assert(A <> H).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst H.
(* Goal: False *)
        apply H1.
        apply sym_equal.
        eapply per_col_eq.
(* Goal: False *)
          apply H0.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
        assert(Perp_at C C A A C).
          apply perp_perp_in.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: False *)
        apply H2.
        eapply l8_14_3.
          apply HH1.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H9.
      eapply per_col_eq.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
        apply H6.
        ColR.
       (* eapply (col_transitivity_1 _ B).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
          apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply col_permutation_5.
(* Goal: @CongA Tn D E F A B C *)
        assumption. *)
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    apply not_col_distincts in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(A <> H).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst A.
      assert(Per C H B).
        apply perp_in_per.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: False *)
      apply H1.
      eapply l8_7.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: False *)
        apply H0.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
      apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Per C H B).
      eapply per_col.
        2: apply H6.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(H <> B).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
      subst B.
      apply H10.
      eapply l8_7.
(* Goal: False *)
        apply H0.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
      apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Lt H A A C /\ Lt H C A C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l11_46; auto.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
      apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Lt C A A B /\ Lt C B A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l11_46; auto.
    assert(Lt H B B C /\ Lt H C B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l11_46; auto.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
      finish.
(* Goal: @LtA Tn A B P A B C *)
    split.
      unfold Lt in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      apply l5_12_b.
        finish.
        eapply le_transitivity.
          apply le_left_comm.
          apply H15.
        apply le_left_comm.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      eapply le_transitivity.
        apply H17.
      apply le_left_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    split;auto.
Qed.


(** This is SAS congruence. *)

Lemma l11_49 : forall A B C A' B' C',
 CongA A B C A' B' C' -> Cong B A B' A' -> Cong B C B' C' ->
 Cong A C A' C' /\ (A <> C -> CongA B A C B' A' C' /\ CongA B C A B' C' A').
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @CongA Tn A B C A' B' C' *)
    assert(Cong A C A' C').
      eapply cong2_conga_cong.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(A <> B /\ C <> B /\ A' <> B'  /\ C' <> B').
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
      unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn A B C A B C *)
      apply l11_3_bis.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
      exists C.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
      exists B'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
      exists C'.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        apply cong_identity in H2.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: @CongA Tn A B C A B C *)
    apply l11_3_bis.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
    exists B.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A' B' C') (@LtA Tn C B A A' B' C'))) *)
    exists B'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
    exists A'.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst C'.
      apply cong_identity in H2.
(* Goal: @Out Tn O B C *)
      contradiction.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

(** This is ASA congruence. *)

Lemma l11_50_1  : forall A B C A' B' C',
  ~ Col A B C -> CongA B A C B' A' C' -> CongA A B C A' B' C' -> Cong A B A' B' ->
  Cong A C A' C' /\ Cong B C B' C' /\ CongA A C B A' C' B'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(A <> B /\ C <> B /\ A' <> B'  /\ C' <> B') by (unfold CongA in *;intuition).
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(exists C'', Out B' C'' C' /\ Cong B' C'' B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l6_11_existence;auto.
    ex_and H7 C''.
    assert(B' <> C'') by (unfold Out in *;intuition).
    assert(~ Col A' B' C') by (eapply ncol_conga_ncol;eauto).
    assert(~ Col A' B' C'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H10.
      apply out_col in H7.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      eapply col_permutation_2.
      eapply (col_transitivity_1 _ C'').
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HH:=l11_4_1 A B C A' B' C' H1).
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(Cong A C A' C'').
      apply H16.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      assert (C''<> B') by auto.
(* Goal: @CongA Tn D E F A B C *)
      repeat split;try assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
        apply between_trivial.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
        apply between_trivial.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
        apply between_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
        unfold Out in  H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong_3 B A C B' A' C'').
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA B A C B' A' C'').
(* Goal: @CongA Tn B C A B' C' A' *)
      apply cong3_conga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Cong Tn B A B C *)
        apply not_col_distincts in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA B' A' C' B' A' C'').
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: False *)
        apply H0.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(C' = C'').
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      assert(HCop : Coplanar B' A' C' C'') by Cop.
      assert(HH:= conga_cop__or_out_ts B' A' C' C'' HCop H20).
(* Goal: @Lt Tn B C B A *)
      induction HH.
        eapply l6_21.
          apply not_col_permutation_5.
          apply H10.
          apply H9.
          apply col_trivial_2.
(* Goal: @Col Tn B A C *)
          apply out_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply out_col in H7.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply col_trivial_2.
      assert(OS B' A' C' C'').
        apply out_one_side.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
          left.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H10.
(* Goal: @Col Tn A B C *)
          apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply l9_9 in H21.
(* Goal: @Out Tn O B C *)
      contradiction.
(* Goal: @Cong Tn A' C' C'' A' *)
    subst C''.
    clear H20.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply cong2_conga_cong.
        apply H19.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn B C A B' C' A' *)
    apply cong3_conga.
(* Goal: @Cong Tn B A B C *)
      apply not_col_distincts in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @Cong_3 Tn A B C A' B' C' *)
    unfold Cong_3.
(* Goal: @LtA Tn A B P A B C *)
    repeat split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply cong_symmetry.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

(** This is AAS congruence. *)

Lemma l11_50_2  : forall A B C A' B' C',
  ~ Col A B C -> CongA B C A B' C' A' -> CongA A B C A' B' C' -> Cong A B A' B' ->
  Cong A C A' C' /\ Cong B C B' C' /\ CongA C A B C' A' B'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(A <> B /\ C <> B /\ A' <> B'  /\ C' <> B').
      unfold CongA in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; assumption.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(exists C'',  Out B' C'' C' /\ Cong B' C'' B C).
      apply l6_11_existence.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    ex_and H7 C''.
    assert(B' <> C'').
      unfold Out in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(~Col A' B' C').
      eapply ncol_conga_ncol.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
        apply H.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(~Col A' B' C'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H10.
      apply out_col in H7.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
      eapply col_permutation_2.
      eapply (col_transitivity_1 _ C'').
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HH:=l11_4_1 A B C A' B' C' H1).
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(Cong A C A' C'').
      apply H16.
(* Goal: @CongA Tn D E F A B C *)
      repeat split; try assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
        apply between_trivial.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
        apply between_trivial.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Bet Tn A C C *)
(* Goal: or (@eq (@Tpoint Tn) C B) (@Out Tn B C P) *)
        apply between_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
        unfold Out in  H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(Cong_3 B C A B' C'' A').
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA B C A B' C'' A').
(* Goal: @CongA Tn B C A B' C' A' *)
      apply cong3_conga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Cong Tn B A B C *)
        apply not_col_distincts in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(CongA B' C' A' B' C'' A').
      eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: False *)
        apply H0.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @Cong Tn B A B C *)
    apply not_col_distincts in H.
    apply not_col_distincts in H10.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    clear H16.
    induction(eq_dec_points C' C'').
      induction (eq_dec_points C' C'').
(* Goal: @Cong Tn A' C' C'' A' *)
        subst C''.
(* Goal: @LtA Tn A B P A B C *)
        split.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @LtA Tn A B P A B C *)
        split.
          apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Cong_3 C A B C' A' B').
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
            apply cong_symmetry.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn B C A B' C' A' *)
        apply cong3_conga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H27.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(~Col C'' C' A').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H10.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
      eapply col_transitivity_1.
        apply H16.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Col Tn A B C *)
(* Goal: @Cong Tn B A B C *)
      apply col_permutation_3.
(* Goal: @Col Tn B A C *)
      apply out_col.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply not_col_distincts in H27.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    unfold Out in H7.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    induction H32.
      assert(HH:=l11_41 ).
      assert(HH1:=l11_41 C'' C' A' B' H27 (between_symmetry _ _ _ H32) H7).
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      assert(CongA B' C' A' C'' C' A').
        eapply (l11_10 B' C' A' B' C' A').
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply bet_out.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
          apply  between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(LtA B' C' A' A' C'' B').
        eapply conga_preserves_lta.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
          apply H35.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold LtA in H36.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      apply conga_right_comm in H20.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert(~Col C' C'' A').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H27.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(HH1:=l11_41 C' C'' A' B' H33 (between_symmetry _ _ _ H32) H15).
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(CongA B' C'' A' C' C'' A').
      eapply (l11_10 B' C'' A' B' C'' A').
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
        apply bet_out.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
        apply  between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn E D D *)
      apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
    assert(LtA B' C'' A' A' C' B').
      eapply conga_preserves_lta.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H36.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold LtA in H37.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    apply conga_sym in H20.
    apply conga_right_comm in H20.
(* Goal: @Out Tn O B C *)
    contradiction.
Qed.

(** This is SSS congruence. *)

Lemma l11_51 : forall A B C A' B' C',
  A <> B -> A <> C -> B <> C -> Cong A B A' B' -> Cong A C A' C' -> Cong B C B' C' ->
  CongA B A C B' A' C' /\ CongA A B C A' B' C' /\ CongA B C A B' C' A'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: and (@CongA Tn B A C B' A' C') (and (@CongA Tn A B C A' B' C') (@CongA Tn B C A B' C' A')) *)
    assert(Cong_3 B A C B' A' C' /\ Cong_3 A B C A' B' C' /\ Cong_3 B C A B' C' A').
      repeat split; cong.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn B C A B' C' A' *)
      apply cong3_conga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn B C A B' C' A' *)
      apply cong3_conga.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn B C A B' C' A' *)
    apply cong3_conga.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma conga_distinct : forall A B C D E F, CongA A B C D E F -> CongA A B C D E F /\ A <> B /\ C <> B /\ D <> E /\ F <> E.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) F E)))) *)
    unfold CongA in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    repeat split; assumption.
Qed.

(** This is SSA congruence with a restriction *)

Lemma l11_52 : forall A B C A' B' C',
  CongA A B C A' B' C' -> Cong A C A' C' -> Cong B C B' C' -> Le B C A C ->
  Cong B A B' A' /\ CongA B A C B' A' C' /\ CongA B C A B' C' A'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    apply conga_distinct in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(Cong B A B' A').
(* Goal: @Lt Tn B C B A *)
      induction(col_dec A B C).
        unfold Col in H7.
        induction H7.
          assert(Bet A' B' C').
            eapply bet_conga__bet.
(* Goal: @Out Tn B P1 P2 *)
              apply H7.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
          eapply l4_3.
(* Goal: @Out Tn B P1 P2 *)
            apply H7.
            apply H8.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        induction H7.
          assert(Out B' A' C').
            eapply l11_21_a.
              apply bet_out.
(* Goal: False *)
                apply H4.
(* Goal: @Out Tn B P1 P2 *)
              apply H7.
(* Goal: @CongA Tn A B C D E F *)
            apply conga_left_comm.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          unfold Out in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          induction H10.
            assert(Le B' C' A' C').
              eapply l5_6.
(* Goal: @LtA Tn A B P A B C *)
              repeat split.
(* Goal: False *)
                apply H2.
(* Goal: @CongA Tn D E F A B C *)
                assumption.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
            assert(B'=A').
              eapply bet_le_eq.
                apply H10.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: False *)
            subst B'.
            absurde.
          eapply l2_11.
(* Goal: @Out Tn B P1 P2 *)
            apply H7.
            apply H10.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          cong.
        assert(B = A).
          eapply bet_le_eq.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
            apply between_symmetry.
(* Goal: @Out Tn B P1 P2 *)
            apply H7.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
        absurde.
      assert(exists A'', Out B' A'' A' /\ Cong B' A'' B A).
        apply l6_11_existence.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      ex_and H8 A''.
      assert(CongA A' B' C' A'' B' C').
        eapply (l11_10  A'' _ C' A'' _ C' ).
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
            unfold Out in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
            spliter.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
          apply l6_6.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
          unfold Out in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(CongA A B C A'' B' C').
        eapply l11_10.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(Cong A'' C' A C).
        eapply cong2_conga_cong.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
          apply H11.
          cong.
        cong.
      assert(Cong_3 A'' B' C' A B C).
        repeat split; cong.
      assert(Cong A'' C' A' C').
        eapply cong_transitivity.
          apply H12.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(~Col A' B' C').
        eapply ncol_conga_ncol.
(* Goal: @Out Tn B P1 P2 *)
          apply H7.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(~Col A'' B' C').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H15.
(* Goal: @Col Tn B C P *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P B) (@Bet Tn A T C)) *)
        apply col_permutation_2.
        eapply (col_transitivity_1 _ A'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: @Cong Tn A' C' C'' A'' *)
          subst A''.
          unfold Out in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          absurde.
          permut.
(* Goal: False *)
        apply out_col in H8.
        permut.
      induction(eq_dec_points A'' A').
(* Goal: @Cong Tn A' C' C'' A'' *)
        subst A''.
        unfold Cong_3 in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        cong.
      unfold Out in H8.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      induction H19.
        assert(HH:= l11_41 A'' B' C' A' H16 H19 H17).
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        assert(Cong A' C' A'' C').
          eapply (cong_transitivity _ _ A C).
            cong.
          unfold Cong_3 in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          cong.
        assert(~Col A'' C' A').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H15.
          eapply (col_transitivity_1 _ A'' ).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
            apply bet_col in H19.
            permut.
          permut.
        assert (HH:= l11_44_1 A'' C' A' H23 ).
        destruct HH.
        apply cong_commutativity in H22.
        apply cong_symmetry in H22.
        apply H25 in H22.
        assert(~Col B' C' A'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H16.
          permut.
        assert(CongA B' A' C' A'' A' C').
          eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
            apply conga_refl.
(* Goal: @Out Tn E D D *)
              3:apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
              auto.
(* Goal: @Out Tn E D D *)
            3:apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst C'.
            apply H15.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
            apply col_trivial_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
            subst C'.
            apply H15.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
            apply col_trivial_3.
            apply between_symmetry in H19.
            apply bet_out in H19.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @CongA Tn D E F A B C *)
              assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C'.
          apply H15.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
          apply col_trivial_3.
        assert(~Col B' C' A').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H15.
          permut.
        assert(HH:=l11_44_2 B' C' A' H28).
        destruct HH.
        assert(Lt C' A'  C' B').
          apply H29.
          eapply conga_preserves_lta.
(* Goal: @CongA Tn A B C D E F *)
            apply conga_right_comm.
(* Goal: @CongA Tn A' B C A B C *)
            apply conga_sym.
            apply H10.
            2:apply H21.
          eapply conga_trans.
            apply H22.
(* Goal: @CongA Tn A B C A' B C *)
          apply conga_comm.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        assert(Lt C' A'' C' B').
          unfold Lt in H31.
(* Goal: @LtA Tn F E D0 C B A0 *)
          spliter.
          unfold Lt.
(* Goal: @LtA Tn A B P A B C *)
          split.
            eapply l5_6.
              apply H31.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
              apply cong_commutativity.
              cong.
            cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          apply H32.
          eapply cong_transitivity.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
            apply cong_symmetry.
            apply H14.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        unfold Lt in H32.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        assert(Le C A C B).
          eapply l5_6.
(* Goal: @LtA Tn A B P A B C *)
          repeat split.
            apply H32.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
          cong.
        assert(Cong C A C B).
          apply le_anti_symmetry.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
          apply le_comm.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply False_ind.
        apply H33.
        apply cong_symmetry.
        eapply cong_transitivity.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
          apply cong_symmetry.
(* Goal: False *)
          apply H1.
        eapply cong_transitivity.
          apply cong_symmetry.
          apply H35.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        cong.
      assert(A' <> A'').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      assert(HH:= l11_41 A' B' C' A'' H15 H19 H20).
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      assert(Cong A' C' A'' C').
        eapply (cong_transitivity _ _ A C).
          cong.
        unfold Cong_3 in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        cong.
      assert(~Col A'' C' A').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H15.
        eapply (col_transitivity_1 _ A'' ).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply bet_col in H19.
          permut.
        permut.
      assert (HH:= l11_44_1 A'' C' A' H24 ).
      destruct HH.
      apply cong_commutativity in H23.
      apply cong_symmetry in H23.
      apply H26 in H23.
      assert(~Col B' C' A'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H16.
        permut.
      assert(CongA B' A'' C' A' A'' C').
        eapply l11_10.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Out Tn E D D *)
            3:apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Out Tn E D D *)
          3:apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C'.
          apply H16.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
          apply col_trivial_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst C'.
          apply H16.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
          apply col_trivial_3.
          apply between_symmetry in H19.
          apply bet_out in H19.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst C'.
        apply H16.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
        apply col_trivial_3.
      assert(~Col B' C' A'').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H16.
        permut.
      assert(HH:=l11_44_2 B' C' A'' H29).
      destruct HH.
      assert(Lt C' A''  C' B').
(* Goal: @Cong Tn A0 C0 A1 C1 *)
        apply H30.
        eapply conga_preserves_lta.
(* Goal: @CongA Tn A B C D E F *)
          apply conga_right_comm.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
          apply H10.
          2:apply H22.
        eapply conga_trans.
(* Goal: @CongA Tn A' B C A B C *)
          apply conga_sym.
          apply H23.
(* Goal: @CongA Tn A B C A' B C *)
        apply conga_comm.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      assert(Lt C' A' C' B').
        unfold Lt in H32.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        unfold Lt.
(* Goal: @LtA Tn A B P A B C *)
        split.
          eapply l5_6.
            apply H32.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
            apply cong_commutativity.
            cong.
          cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        apply H33.
        eapply cong_transitivity.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
          apply H14.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      unfold Lt in H33.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      assert(Le C A C B).
        eapply l5_6.
(* Goal: @LtA Tn A B P A B C *)
        repeat split.
          apply H32.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
          apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        cong.
      assert(Cong C A C B).
        apply le_anti_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply le_comm.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
      apply False_ind.
      apply H34.
      apply cong_symmetry.
      eapply cong_transitivity.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
        apply cong_commutativity.
        apply cong_symmetry.
(* Goal: False *)
        apply H1.
      eapply cong_transitivity.
        apply cong_symmetry.
        apply H36.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
      apply cong_commutativity.
      cong.
    assert(Cong_3 A B C A' B' C').
      repeat split; cong.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn B C A B' C' A' *)
      apply cong3_conga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
        subst C.
        apply le_zero in H2.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
        subst B.
        absurde.
      auto with cong3.
(* Goal: @CongA Tn B C A B' C' A' *)
    apply cong3_conga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
      apply le_zero in H2.
(* Goal: @Cong Tn A' A' A B *)
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @Cong Tn A' B' A B) *)
      subst B.
      absurde.
    auto with cong3.
Qed.

Lemma l11_53 : forall A B C D,
 Per D C B -> C <> D -> A <> B -> B <> C -> Bet A B C ->
 LtA C A D C B D /\ Lt B D A D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(A<>C) by (intro; Between).
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(~Col B A D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      assert(Col B C D).
        eapply (col_transitivity_1 _ A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply bet_col in H3.
          permut.
        permut.
      assert(~Col  B C D).
        apply per_not_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
        apply l8_2.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert(A <> D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      subst D.
      apply H5.
      apply col_trivial_2.
    assert( LtA C A D C B D).
      assert(HH:=l11_41 B A D C H5 H3 H2).
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
      assert(CongA C A D B A D).
        eapply (l11_10  C A D C _ D).
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Out Tn E D D *)
          apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply bet_out.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
      eapply conga_preserves_lta.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        apply H9.
(* Goal: @CongA Tn A B C D E F *)
        apply conga_right_comm.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
          subst D.
          apply H5.
(* Goal: @Col Tn B P B *)
(* Goal: @Bet Tn A B C *)
(* Goal: @TS Tn P B A C *)
          apply col_trivial_3.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold Per in H.
    ex_and H B'.
    unfold Midpoint in H.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    assert(HH:= H8).
    assert(~Col B D B').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H5.
      apply (col_transitivity_1 _ B').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        subst B'.
        apply between_identity in H.
(* Goal: @Out Tn O B C *)
        contradiction.
        apply (col_transitivity_1 _ C).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn A B D *)
          apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply bet_col in H3.
        permut.
      permut.
    destruct(l11_44_1 B D B').
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    apply H12 in H8.
    destruct(l11_44_2 A D B').
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply H10.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
      apply col_permutation_1.
      eapply (col_transitivity_1 _ A).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
(* Goal: False *)
        subst B'.
        apply between_symmetry in H3.
        assert(B = C).
(* Goal: @CongA Tn D E F A B C *)
          eapply (between_equality _ _ A); assumption.
(* Goal: @Out Tn O B C *)
        contradiction.
(* Goal: @Col Tn X P B *)
(* Goal: @Bet Tn A X C *)
        apply col_permutation_1.
        eapply (col_transitivity_1 _ C).
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Col Tn A B D *)
          apply bet_col.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
        apply bet_col in H3.
        permut.
      permut.
    assert(LtA C A D C B' D).
      eapply conga_preserves_lta.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
        apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @CongA Tn A' B C A B C *)
        apply conga_sym.
        eapply l11_10.
(* Goal: @Out Tn E D D *)
          3: apply out_trivial.
          apply conga_sym in H8.
          apply conga_comm in H8.
          apply H8.
          apply bet_out.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
(* Goal: False *)
            subst B'.
            apply cong_identity in H9.
(* Goal: @Out Tn O B C *)
            contradiction.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
          apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
          subst B'.
          apply H10.
          apply col_trivial_2.
          apply bet_out.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
            2: apply H.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Out Tn E D D *)
        apply out_trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        subst D.
        apply H10.
        apply col_trivial_1.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    assert(B' <> A).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: False *)
      subst B'.
      apply between_symmetry in H3.
      assert(B=C).
        eapply between_equality.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
          apply H.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: @Out Tn O B C *)
      contradiction.
    assert (Lt D B' D A).
      apply l11_44_2_b.
      apply (conga_preserves_lta D A C D B' C).
        eapply (l11_10).
(* Goal: @Out Tn E D D *)
          2: apply out_trivial.
(* Goal: @Out Tn E D D *)
          4: apply out_trivial.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
(* Goal: @Out Tn E D D *)
          5:apply out_trivial.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
          apply bet_out.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
          eapply outer_transitivity_between2.
            apply H3.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @CongA Tn D E F A B C *)
          assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
        eapply (l11_10).
(* Goal: @Out Tn E D D *)
          2: apply out_trivial.
(* Goal: @Out Tn E D D *)
          4: apply out_trivial.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
          apply conga_refl.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
(* Goal: False *)
            subst B'.
            apply H10.
            apply col_trivial_2.
(* Goal: @Out Tn E D D *)
          5:apply out_trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
          subst B'.
          apply H10.
          apply col_trivial_2.
          apply bet_out.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
            intro.
(* Goal: False *)
            subst B'.
            apply cong_identity in H9.
(* Goal: @Out Tn O B C *)
            contradiction.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
            auto.
          eapply outer_transitivity_between.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
            apply between_symmetry.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
            apply H.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
            apply between_symmetry.
(* Goal: @CongA Tn D E F A B C *)
            assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
          intro.
(* Goal: False *)
          subst B'.
          apply H10.
          apply col_trivial_2.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        auto.
(* Goal: @LtA Tn D E G F E G *)
      apply lta_comm.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
    unfold Lt in H17.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
    unfold Lt.
(* Goal: @LtA Tn A B P A B C *)
    split.
      eapply l5_6.
(* Goal: @LtA Tn A B P A B C *)
      repeat split.
        apply H17.
        cong.
(* Goal: @eq (@Tpoint Tn) B B *)
      apply cong_pseudo_reflexivity.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    apply H18.
    eapply cong_transitivity.
      apply cong_symmetry.
(* Goal: False *)
(* Goal: not (@Col Tn A B C) *)
(* Goal: @Lt Tn B C B A *)
      apply HH.
(* Goal: @Cong Tn A1 C1 A2 C2 *)
    apply cong_commutativity.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

(** This is SSA congruence with an obtuse angle *)

Lemma cong2_conga_obtuse__cong_conga2 :
forall A B C A' B' C',
       Obtuse A B C ->
       CongA A B C A' B' C' ->
       Cong A C A' C' ->
       Cong B C B' C' ->
       Cong B A B' A' /\ CongA B A C B' A' C' /\ CongA B C A B' C' A'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply (l11_52 A B C A' B' C'); auto.
(* Goal: @Out Tn B P Q *)
destruct (col_dec A B C).
(* Goal: @CongA Tn D E F A B C *)
  apply bet__le2313, col_obtuse__bet; assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
assert_diffs; apply l11_46; auto.
Qed.

(** This is SSA congruence with a right angle *)

Lemma cong2_per2__cong_conga2 :
forall A B C A' B' C',
       A<>B -> B<>C ->
       Per A B C ->
       Per A' B' C' ->
       Cong A C A' C' ->
       Cong B C B' C' ->
       Cong B A B' A' /\ CongA B A C B' A' C' /\ CongA B C A B' C' A'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
(* Goal: and (@Cong Tn B A B' A') (and (@CongA Tn B A C B' A' C') (@CongA Tn B C A B' C' A')) *)
destruct (l11_46 A B C) as [_ []]; auto using per_not_col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply (l11_52 A B C A' B' C');auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply l11_16;auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
intro.
(* Goal: False *)
subst B'.
(* Goal: @Cong Tn A' C' C' A' *)
apply H9, cong_transitivity with A' C'; Cong.
Qed.

Lemma cong2_per2__cong :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Cong A C A' C' ->
       Cong B C B' C' ->
       Cong B A B' A'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Lt Tn A C A' C' *)
destruct (eq_dec_points B C).
(* Goal: @Cong Tn A' C' C' A' *)
  treat_equalities; Cong.
(* Goal: @Lt Tn A C A' C' *)
destruct (eq_dec_points A B).
(* Goal: @Cong Tn B A B' A' *)
(* Goal: @Cong Tn B A B' A' *)
  destruct (eq_dec_points A' B'); subst; [Cong|].
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Cong Tn B B B' A' *)
(* Goal: @Cong Tn B A B' A' *)
  destruct (cong2_per2__cong_conga2 A' B' C' B B C); Cong; Perp.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply cong2_per2__cong_conga2 with C C'; auto.
Qed.

Lemma cong2_per2__cong_3 :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Cong A C A' C' ->
       Cong B C B' C' ->
       Cong_3 A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Cong_3 Tn A B C A' B' C' *)
unfold Cong_3.
assert (Cong B A B' A') by
 (apply (cong2_per2__cong A B C A' B' C');auto).
(* Goal: @Cong Tn A' C' C' A' *)
repeat split;Cong.
Qed.

Lemma cong_lt_per2__lt :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Cong A B A' B' ->
       Lt B C B' C' ->
       Lt A C A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Lt Tn A C A' C' *)
destruct (eq_dec_points A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  treat_equalities; auto.
(* Goal: @Lt Tn A C A' C' *)
destruct (eq_dec_points B C).
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
  subst C.
(* Goal: @Cong Tn A' C' C' A' *)
  apply (cong2_lt__lt B' A' C' A'); Cong.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Lt Tn B' A' C' A' *)
(* Goal: @Lt Tn A C A' C' *)
  apply l11_46; Perp.
(* Goal: @Lt Tn A C A' C' *)
destruct H2 as [[C0 []] HNCong].
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
(* Goal: @Lt Tn A C A' C' *)
assert (Per A' B' C0) by (apply per_col with C'; Col).
(* Goal: @Cong Tn A' C' C' A' *)
apply (cong2_lt__lt A' C0 A' C'); [|apply l10_12 with B' B|]; Cong.
(* Goal: @Lt Tn A' C0 A' C' *)
apply lt_comm.
(* Goal: @Lt Tn C0 A' C' A' *)
destruct (l11_53 C' C0 B' A'); Between.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
intro; subst; auto.
Qed.

Lemma cong_le_per2__le :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Cong A B A' B' ->
       Le B C B' C' ->
       Le A C A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Le Tn A C A' C' *)
destruct (cong_dec B C B' C').
(* Goal: @CongA Tn D E F A B C *)
  apply cong__le, l10_12 with B B'; assumption.
(* Goal: @Le Tn A C A' C' *)
assert (Lt B C B' C') by (split; assumption).
(* Goal: @CongA Tn D E F A B C *)
apply lt__le, cong_lt_per2__lt with B B'; assumption.
Qed.

Lemma lt2_per2__lt :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Lt A B A' B' ->
       Lt B C B' C' ->
       Lt A C A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Lt Tn A C A' C' *)
destruct (eq_dec_points B C).
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
  subst C.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply lt_transitivity with A' B'; auto.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Lt Tn A' B' A' C' *)
(* Goal: @Lt Tn A C A' C' *)
  apply lt_comm, l11_46; Perp.
(* Goal: @Lt Tn A C A' C' *)
apply lt_comm in H1.
(* Goal: @Lt Tn A C A' C' *)
assert (HC0 := H2).
(* Goal: @Lt Tn A C A' C' *)
destruct HC0 as [[C0 []] HNCong].
(* Goal: @Lt Tn A C A' C' *)
assert (Per A' B' C0).
(* Goal: False *)
  assert_diffs; apply per_col with C'; Col.
(* Goal: @Lt Tn A C A' C' *)
apply lt_transitivity with A' C0.
(* Goal: @Lt Tn A C A' C0 *)
(* Goal: @Lt Tn A' C0 A' C' *)
  apply lt_comm, cong_lt_per2__lt with B B'; Cong; Perp.
(* Goal: @Cong Tn A' C' C' A' *)
apply cong_lt_per2__lt with B' B'; Cong.
(* Goal: @Cong Tn A' C' C' A' *)
apply (cong2_lt__lt B C B' C'); Cong.
Qed.

Lemma le_lt_per2__lt :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Le A B A' B' ->
       Lt B C B' C' ->
       Lt A C A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Lt Tn A C A' C' *)
destruct (cong_dec A B A' B').
(* Goal: @CongA Tn D E F A B C *)
  apply cong_lt_per2__lt with B B'; assumption.
(* Goal: @Lt Tn A C A' C' *)
assert (Lt A B A' B') by (split; assumption).
(* Goal: @CongA Tn D E F A B C *)
apply lt2_per2__lt with B B'; assumption.
Qed.

Lemma le2_per2__le :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Le A B A' B' ->
       Le B C B' C' ->
       Le A C A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Le Tn A C A' C' *)
destruct (cong_dec B C B' C').
  apply le_comm, cong_le_per2__le with B B'; finish.
(* Goal: @Le Tn A C A' C' *)
assert (Lt B C B' C') by (split; assumption).
(* Goal: @CongA Tn D E F A B C *)
apply le_lt_per2__lt with B B'; assumption.
Qed.

Lemma cong_lt_per2__lt_1 :
forall A B C A' B' C',
       Per A B C ->
       Per A' B' C' ->
       Lt A B A' B' ->
       Cong A C A' C' ->
       Lt B' C' B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Lt Tn B' C' B C *)
apply nle__lt.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
intro.
destruct (le_lt_per2__lt C B A C' B' A'); finish.
Qed.

Lemma symmetry_preserves_conga :
 forall A B C A' B' C' M, A <> B -> C <> B ->
  Midpoint M A A' ->
  Midpoint M B B' ->
  Midpoint M C C' ->
  CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @CongA Tn A B C A' B' C' *)
  assert(Cong A B A' B').
(* Goal: @Cong Tn A C A' C' *)
(* Goal: @CongA Tn A B C A' B' C' *)
    apply (l7_13 M); Midpoint.
(* Goal: @CongA Tn A B C A' B' C' *)
  assert(Cong B C B' C').
(* Goal: @Cong Tn A C A' C' *)
(* Goal: @CongA Tn A B C A' B' C' *)
    apply (l7_13 M); Midpoint.
(* Goal: @CongA Tn A B C A' B' C' *)
  assert(Cong A C A' C').
(* Goal: @Cong Tn A C A' C' *)
(* Goal: @CongA Tn A B C A' B' C' *)
    apply (l7_13 M); Midpoint.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply cong3_conga; auto.
(* Goal: @Cong Tn A' C' C' A' *)
  repeat split; Cong.
Qed.

Lemma l11_57 : forall A B C A' B' C',
  OS A A' B B' -> Per B A A' -> Per B' A' A ->
  OS A A' C C' -> Per C A A' -> Per C' A' A ->
  CongA B A C B' A' C'.
Proof.
(* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @OS Tn A A' B B') (_ : @Per Tn B A A') (_ : @Per Tn B' A' A) (_ : @OS Tn A A' C C') (_ : @Per Tn C A A') (_ : @Per Tn C' A' A), @CongA Tn B A C B' A' C' *)
  intros A B C A' B' C' HOSB HPer1 HPer2 HOSC HPer3 HPer4.
(* Goal: @CongA Tn B A C B' A' C' *)
  destruct (midpoint_existence A A') as [M HM].
(* Goal: @CongA Tn B A C B' A' C' *)
  destruct (symmetric_point_construction B M) as [B'' HB''].
(* Goal: @CongA Tn B A C B' A' C' *)
  destruct (symmetric_point_construction C M) as [C'' HC''].
(* Goal: @CongA Tn B A C B' A' C' *)
  assert (HNColB := one_side_not_col123 A A' B B' HOSB).
(* Goal: @CongA Tn B A C B' A' C' *)
  assert (HNColC := one_side_not_col123 A A' C C' HOSC).
(* Goal: @CongA Tn B A C B' A' C' *)
  apply conga_trans with B'' A' C''.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    assert_diffs; apply symmetry_preserves_conga with M; auto.
(* Goal: @CongA Tn B'' A' C'' B' A' C' *)
  assert (~ Col B'' A A').
    assert (B <> M) by (intro; subst; apply HNColB; Col); intro; apply HNColB; ColR.
(* Goal: @CongA Tn B'' A' C'' B' A' C' *)
  assert (Bet B'' A' B').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { assert (Col B' B'' A').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    { assert_diffs; apply (cop_per2__col A); auto.
(* Goal: @Coplanar Tn A B' B'' A' *)
(* Goal: @Per Tn B'' A' A *)
        apply coplanar_perm_3, coplanar_trans_1 with B; [Col|Cop|].
(* Goal: False *)
        exists M; right; right; split; Col.
(* Goal: @Per Tn B'' A' A *)
      apply midpoint_preserves_per with B A A' M; Midpoint.
    }
(* Goal: False *)
    apply col_two_sides_bet with A; Col.
(* Goal: @TS Tn A' A B'' B' *)
    apply invert_two_sides, l9_2, l9_8_2 with B; trivial.
(* Goal: False *)
    repeat split; Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn C T C'')) *)
    exists M; split; [Col|Between].
  }
(* Goal: @CongA Tn B'' A' C'' B' A' C' *)
  assert (~ Col C'' A A').
    assert (C <> M) by (intro; subst; apply HNColC; Col); intro; apply HNColC; ColR.
(* Goal: @CongA Tn B'' A' C'' B' A' C' *)
  assert (Bet C'' A' C').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { assert (Col C' C'' A').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    { assert_diffs; apply (cop_per2__col A); auto.
(* Goal: @Coplanar Tn A C' C'' A' *)
(* Goal: @Per Tn C'' A' A *)
        apply coplanar_perm_3, coplanar_trans_1 with C; [Col|Cop|].
(* Goal: False *)
        exists M; right; right; split; Col.
(* Goal: @Per Tn C'' A' A *)
      apply midpoint_preserves_per with C A A' M; Midpoint.
    }
(* Goal: False *)
    apply col_two_sides_bet with A; Col.
(* Goal: @TS Tn A' A C'' C' *)
    apply invert_two_sides, l9_2, l9_8_2 with C; trivial.
(* Goal: False *)
    repeat split; Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn C T C'')) *)
    exists M; split; [Col|Between].
  }
(* Goal: @CongA Tn B'' A' C'' B' A' C' *)
  apply one_side_not_col124 in HOSB.
(* Goal: @CongA Tn B'' A' C'' B' A' C' *)
  apply one_side_not_col124 in HOSC.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  assert_diffs; apply l11_14; auto.
Qed.

Lemma cop3_orth_at__orth_at : forall A B C D E F U V X, ~ Col D E F ->
  Coplanar A B C D -> Coplanar A B C E -> Coplanar A B C F -> Orth_at X A B C U V ->
  Orth_at X D E F U V.
Proof.
(* Goal: forall (A B C D E F U V X : @Tpoint Tn) (_ : not (@Col Tn D E F)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @Coplanar Tn A B C F) (_ : @Orth_at Tn X A B C U V), @Orth_at Tn X D E F U V *)
  intros A B C D E F U V X HNCol HD HE HF [HNCol1 [HUV [HX1 [HX2 HX3]]]].
(* Goal: @Orth_at Tn X A B C U V *)
  repeat split; trivial.
(* Goal: @CongA Tn D E F A B C *)
    apply coplanar_pseudo_trans with A B C; assumption.
(* Goal: forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn D E F P) (_ : @Col Tn U V Q), @Per Tn P X Q *)
  assert (forall M, Coplanar A B C M -> Coplanar D E F M).
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    intro; apply coplanar_pseudo_trans; Cop.
(* Goal: forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn D E F P) (_ : @Col Tn U V Q), @Per Tn P X Q *)
  assert (forall M, Coplanar D E F M -> Coplanar A B C M).
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    intro; apply coplanar_pseudo_trans; Cop.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  intros; apply HX3; auto.
Qed.

Lemma col2_orth_at__orth_at : forall A B C P Q U V X, U <> V ->
  Col P Q U -> Col P Q V -> Orth_at X A B C P Q -> Orth_at X A B C U V.
Proof.
(* Goal: forall (A B C P Q U V X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U V)) (_ : @Col Tn P Q U) (_ : @Col Tn P Q V) (_ : @Orth_at Tn X A B C P Q), @Orth_at Tn X A B C U V *)
  intros A B C P Q U V X HUV HU HV [HNCol [HPQ [HX1 [HX2 HX3]]]].
(* Goal: @Orth_at Tn X A B C U V *)
  repeat split; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (col3 P Q); auto.
(* Goal: forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn U V Q), @Per Tn P X Q *)
  intros D W HD HW.
(* Goal: @CongA Tn D E F A B C *)
  apply HX3; [|apply (colx U V)]; assumption.
Qed.

Lemma col_orth_at__orth_at : forall A B C U V W X, U <> W ->
  Col U V W -> Orth_at X A B C U V -> Orth_at X A B C U W.
Proof.
(* Goal: forall (A B C U V W X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U W)) (_ : @Col Tn U V W) (_ : @Orth_at Tn X A B C U V), @Orth_at Tn X A B C U W *)
  intros A B C U V W X HUW HCol HX.
(* Goal: False *)
  apply col2_orth_at__orth_at with U V; Col.
Qed.

Lemma orth_at_symmetry : forall A B C U V X,
  Orth_at X A B C U V -> Orth_at X A B C V U.
Proof.
(* Goal: forall (A B C U V X Y : @Tpoint Tn) (_ : @Orth_at Tn X A B C U V) (_ : @Orth_at Tn Y A B C U V), @eq (@Tpoint Tn) X Y *)
  unfold Orth_at.
(* Goal: @LtA Tn F E D0 C B A0 *)
  intros A B C U V X HX; spliter.
(* Goal: False *)
  repeat split; Col.
Qed.

Lemma orth_at_distincts : forall A B C U V X, Orth_at X A B C U V ->
  A <> B /\ B <> C /\ A <> C /\ U <> V.
Proof.
(* Goal: @SuppA Tn A B C A B B' *)
  unfold Orth_at; intros; spliter; assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
Qed.

Lemma orth_at_chara : forall A B C P X, Orth_at X A B C X P <->
  ~ Col A B C /\ X <> P /\ Coplanar A B C X /\ (forall D, Coplanar A B C D -> Per D X P).
Proof.
(* Goal: @LtA Tn A B P A B C *)
  intros A B C P X; split.
(* Goal: @LtA Tn F E D0 C B A0 *)
  - unfold Orth_at; intro; spliter.
(* Goal: False *)
    repeat split; Col.
(* Goal: @LtA Tn F E D0 C B A0 *)
  - intro; spliter.
(* Goal: False *)
    repeat split; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intros; apply per_col with P; auto.
Qed.

Lemma cop3_orth__orth : forall A B C D E F U V, ~ Col D E F ->
  Coplanar A B C D -> Coplanar A B C E -> Coplanar A B C F -> Orth A B C U V ->
  Orth D E F U V.
Proof.
(* Goal: forall (A B C D E F U V : @Tpoint Tn) (_ : not (@Col Tn D E F)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @Coplanar Tn A B C F) (_ : @Orth Tn A B C U V), @Orth Tn D E F U V *)
  intros A B C D E F U V HNCol HD HE HF [X HX].
(* Goal: @Orth Tn A B C V U *)
  exists X.
(* Goal: @CongA Tn D E F A B C *)
  apply (cop3_orth_at__orth_at A B C); assumption.
Qed.

Lemma col2_orth__orth : forall A B C P Q U V, U <> V ->
  Col P Q U -> Col P Q V -> Orth A B C P Q -> Orth A B C U V.
Proof.
(* Goal: forall (A B C P Q U V : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U V)) (_ : @Col Tn P Q U) (_ : @Col Tn P Q V) (_ : @Orth Tn A B C P Q), @Orth Tn A B C U V *)
  intros A B C P Q U V HUV HU HV [X HX].
(* Goal: @Orth Tn A B C V U *)
  exists X.
(* Goal: @CongA Tn D E F A B C *)
  apply col2_orth_at__orth_at with P Q; assumption.
Qed.

Lemma col_orth__orth : forall A B C U V W, U <> W ->
  Col U V W -> Orth A B C U V -> Orth A B C U W.
Proof.
(* Goal: forall (A B C U V W : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U W)) (_ : @Col Tn U V W) (_ : @Orth Tn A B C U V), @Orth Tn A B C U W *)
  intros A B C U V W HUW HCol HOrth.
(* Goal: False *)
  apply col2_orth__orth with U V; Col.
Qed.

Lemma orth_symmetry : forall A B C U V,
  Orth A B C U V -> Orth A B C V U.
Proof.
(* Goal: forall (A B C U V : @Tpoint Tn) (_ : @Orth Tn A B C U V), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) U V)))) *)
  intros A B C U V [X HX].
(* Goal: @Orth Tn A B C V U *)
  exists X.
(* Goal: @Orth_at Tn X A B C V U *)
  apply orth_at_symmetry, HX.
Qed.

Lemma orth_distincts : forall A B C U V, Orth A B C U V ->
  A <> B /\ B <> C /\ A <> C /\ U <> V.
Proof.
(* Goal: forall (A B C U V : @Tpoint Tn) (_ : @Orth Tn A B C U V), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) U V)))) *)
  intros A B C U V [X HX].
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) U V)))) *)
  apply orth_at_distincts with X, HX.
Qed.

Lemma col_cop_orth__orth_at : forall A B C U V X,
  Orth A B C U V -> Coplanar A B C X -> Col U V X -> Orth_at X A B C U V.
Proof.
(* Goal: forall (A B C U V X : @Tpoint Tn) (_ : @Orth Tn A B C U V) (_ : @Coplanar Tn A B C X) (_ : @Col Tn U V X), @Orth_at Tn X A B C U V *)
  intros A B C U V X [Y [HNCol [HUV [HY1 [HY2 HY3]]]]] HX1 HX2.
(* Goal: @Orth_at Tn X A B C U V *)
  repeat split; trivial.
(* Goal: forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn U V Q), @Per Tn P X Q *)
  replace X with Y; [assumption|].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply eq_sym, l8_8; auto.
Qed.

Lemma l11_60_aux : forall A B C D P Q, ~ Col A B C ->
  Cong A P A Q -> Cong B P B Q -> Cong C P C Q -> Coplanar A B C D ->
  Cong D P D Q.
Proof.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros A B C D P Q HNCol HA HB HC HCop.
(* Goal: @Cong Tn D P D Q *)
  destruct (midpoint_existence P Q) as [M []].
(* Goal: @LtA Tn F E D0 C B A0 *)
  assert_diffs; destruct HCop as [X [|[|]]]; spliter.
(* Goal: False *)
  - apply l4_17 with C X; Col.
(* Goal: @CongA Tn D E F A B C *)
      intro; subst; apply HNCol; assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l4_17 with A B; auto.
(* Goal: False *)
  - apply l4_17 with B X; Col.
(* Goal: False *)
      intro; subst; apply HNCol; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l4_17 with A C; auto.
(* Goal: False *)
  - apply l4_17 with A X; Col.
(* Goal: False *)
      intro; subst; apply HNCol; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l4_17 with B C; auto.
Qed.

Lemma l11_60 : forall A B C D E P, ~ Col A B C ->
  Per A D P -> Per B D P -> Per C D P -> Coplanar A B C E ->
  Per E D P.
Proof.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros A B C D E P HNCol HPerA HPerB HPerC HCop.
(* Goal: @Per Tn E D P *)
  destruct (eq_dec_points D P).
(* Goal: @Per Tn E D P *)
(* Goal: @Per Tn E D P *)
    subst; apply l8_5.
(* Goal: @Per Tn P D0' A0' *)
  destruct (symmetric_point_construction P D) as [P'].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  exists P'; split; auto.
(* Goal: @CongA Tn D E F A B C *)
  apply (l11_60_aux A B C); [|apply per_double_cong with D..|]; assumption.
Qed.

Lemma l11_60_bis : forall A B C D P, ~ Col A B C -> D <> P ->
  Coplanar A B C D -> Per A D P -> Per B D P -> Per C D P ->
  Orth_at D A B C D P.
Proof.
(* Goal: forall (A B C D P : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : not (@eq (@Tpoint Tn) D P)) (_ : @Coplanar Tn A B C D) (_ : @Per Tn A D P) (_ : @Per Tn B D P) (_ : @Per Tn C D P), @Orth_at Tn D A B C D P *)
  intros A B C D P HNCol HDP HD HA HB HC.
(* Goal: False *)
  repeat split; Col.
(* Goal: forall (P0 Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P0) (_ : @Col Tn D P Q), @Per Tn P0 D Q *)
  intros E Q HE HQ.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply per_col with P; auto.
(* Goal: @CongA Tn D E F A B C *)
  apply (l11_60 A B C); assumption.
Qed.

Lemma l11_61 : forall A B C A' B' C',
  A <> A' -> A <> B -> A <> C ->
  Coplanar A A' B B' -> Per B A A' -> Per B' A' A ->
  Coplanar A A' C C' -> Per C A A' ->
  Per B A C -> Per B' A' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros A B C A' B' C'; intros.
(* Goal: @Per Tn B' A' C' *)
  assert (~ Col C A A') by (assert_diffs; apply per_not_col; auto).
(* Goal: False *)
  destruct (l10_15 A A' A' C) as [C'' []]; Col.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  apply l8_2, (l11_60 A' A C'');
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    [apply one_side_not_col124 with C; Side|Perp..| |apply coplanar_trans_1 with C; Col; Cop].
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
  apply l8_2.
(* Goal: @Per Tn B' A' C'' *)
  revert dependent B'.
  assert (Haux : forall B', OS A A' B B' -> Per B' A' A -> Per B' A' C'').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { intros B' HOS HPer.
(* Goal: @Per Tn B' A' C'' *)
    apply (l11_17 B A C); trivial.
(* Goal: @CongA Tn B A C B' A' C'' *)
    apply l11_57; Perp.
  }
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intro B'; intros.
(* Goal: @Per Tn B' A' C'' *)
  destruct (eq_dec_points B' A'); [subst; Perp|].
(* Goal: @Per Tn B' A' C'' *)
  assert (HNCol : ~ Col B' A' A) by (apply per_not_col; auto).
(* Goal: False *)
  destruct (cop__one_or_two_sides A A' B B'); Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply per_not_col; auto.
(* Goal: @Per Tn B' A' C'' *)
  destruct (segment_construction B' A' A' B') as [B'' []].
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: False *)
  apply l8_2, per_col with B''; Col.
(* Goal: @Per Tn C'' A' B'' *)
  apply l8_2, Haux; [|apply l8_2, per_col with B'; Perp; Col].
(* Goal: @OS Tn A A' B B'' *)
  exists B'; split; trivial.
(* Goal: False *)
  repeat split; Col.
    intro; apply HNCol; ColR.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B'' T B')) *)
  exists A'; split; Col; Between.
Qed.

Lemma l11_61_bis : forall A B C D E P Q,
  Orth_at D A B C D P -> Perp D E E Q -> Coplanar A B C E -> Coplanar D E P Q ->
  Orth_at E A B C E Q.
Proof.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros A B C D E P Q [HNCol [HDP [HD [_ HOrth]]]] HPerp HE HCop.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: False *)
  repeat split; Col.
  assert (Haux : forall M, Coplanar A B C M -> Per M E Q).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { intros M HM.
(* Goal: @Per Tn M E Q *)
    assert (HD' : exists D', Perp D E D' D /\ Coplanar A B C D').
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    { destruct (ex_ncol_cop A B C D E) as [F []]; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      destruct (ex_perp_cop D E D F) as [D' []]; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      exists D'; split; auto.
      apply coplanar_pseudo_trans with D E F; trivial;
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      apply coplanar_pseudo_trans with A B C; Cop.
    }
(* Goal: @Per Tn M E Q *)
    destruct HD' as [D' []].
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l8_2, (l11_61 D P D'); auto.
(* Goal: False *)
      apply l8_2; Col.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
      Perp.
(* Goal: @CongA Tn D E F A B C *)
      apply coplanar_pseudo_trans with A B C; assumption.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
      Perp.
(* Goal: False *)
      apply l8_2; Col.
  }
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros; apply per_col with Q; Cop.
Qed.

Lemma l11_62_unicity : forall A B C D D' P,
  Coplanar A B C D -> Coplanar A B C D' ->
  (forall E, Coplanar A B C E -> Per E D P) ->
  (forall E, Coplanar A B C E -> Per E D' P) ->
  D = D'.
Proof.
(* Goal: forall (A B C D D' P : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C D') (_ : forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P) (_ : forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D' P), @eq (@Tpoint Tn) D D' *)
  intros A B C D D' P HCop HCop' HD HD'.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
  apply l8_7 with P; Perp.
Qed.

Lemma l11_62_unicity_bis : forall A B C U X Y,
  Orth_at X A B C X U -> Orth_at Y A B C Y U -> X = Y.
Proof.
(* Goal: forall (A B C U V X Y : @Tpoint Tn) (_ : @Orth_at Tn X A B C U V) (_ : @Orth_at Tn Y A B C U V), @eq (@Tpoint Tn) X Y *)
  unfold Orth_at.
(* Goal: forall (A B C U X Y : @Tpoint Tn) (_ : and (not (@Col Tn A B C)) (and (not (@eq (@Tpoint Tn) X U)) (and (@Coplanar Tn A B C X) (and (@Col Tn X U X) (forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn X U Q), @Per Tn P X Q))))) (_ : and (not (@Col Tn A B C)) (and (not (@eq (@Tpoint Tn) Y U)) (and (@Coplanar Tn A B C Y) (and (@Col Tn Y U Y) (forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn Y U Q), @Per Tn P Y Q))))), @eq (@Tpoint Tn) X Y *)
  intros A B C U X Y HX HY.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: False *)
  apply l11_62_unicity with A B C U; trivial; intros; Col.
Qed.

Lemma orth_at2__eq : forall A B C U V X Y,
  Orth_at X A B C U V -> Orth_at Y A B C U V -> X = Y.
Proof.
(* Goal: forall (A B C U V X Y : @Tpoint Tn) (_ : @Orth_at Tn X A B C U V) (_ : @Orth_at Tn Y A B C U V), @eq (@Tpoint Tn) X Y *)
  unfold Orth_at.
(* Goal: forall (A B C U V X Y : @Tpoint Tn) (_ : and (not (@Col Tn A B C)) (and (not (@eq (@Tpoint Tn) U V)) (and (@Coplanar Tn A B C X) (and (@Col Tn U V X) (forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn U V Q), @Per Tn P X Q))))) (_ : and (not (@Col Tn A B C)) (and (not (@eq (@Tpoint Tn) U V)) (and (@Coplanar Tn A B C Y) (and (@Col Tn U V Y) (forall (P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn U V Q), @Per Tn P Y Q))))), @eq (@Tpoint Tn) X Y *)
  intros A B C U V X Y HX HY.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: False *)
  apply l11_62_unicity with A B C U; trivial; intros; Col.
Qed.

Lemma col_cop_orth_at__eq : forall A B C U V X Y,
  Orth_at X A B C U V -> Coplanar A B C Y -> Col U V Y -> X = Y.
Proof.
(* Goal: False *)
  intros A B C U V X Y HOrth HCop HCol.
(* Goal: @eq (@Tpoint Tn) X Y *)
  apply (orth_at2__eq A B C U V); [assumption|].
(* Goal: @CongA Tn D E F A B C *)
  apply col_cop_orth__orth_at; [exists X|..]; assumption.
Qed.

Lemma orth_at__ncop1 : forall A B C U V X, U <> X ->
  Orth_at X A B C U V -> ~ Coplanar A B C U.
Proof.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros A B C U V X HUX HOrth HCop.
(* Goal: False *)
  apply HUX, eq_sym, (col_cop_orth_at__eq A B C U V); Col.
Qed.

Lemma orth_at__ncop2 : forall A B C U V X, V <> X ->
  Orth_at X A B C U V -> ~ Coplanar A B C V.
Proof.
(* Goal: forall (A B C U V X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) V X)) (_ : @Orth_at Tn X A B C U V), not (@Coplanar Tn A B C V) *)
  intros A B C U V X HUX HOrth.
(* Goal: not (@Coplanar Tn A B C V) *)
  apply orth_at__ncop1 with U X; [assumption|apply orth_at_symmetry, HOrth].
Qed.

Lemma orth_at__ncop : forall A B C P X,
  Orth_at X A B C X P -> ~ Coplanar A B C P.
Proof.
(* Goal: forall (A B C P X : @Tpoint Tn) (_ : @Orth_at Tn X A B C X P), not (@Coplanar Tn A B C P) *)
  intros A B C P X HOrth.
(* Goal: @LtA Tn F E D0 C B A0 *)
  assert (Hd := HOrth); apply orth_at_distincts in Hd; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply orth_at__ncop2 with X X; auto.
Qed.

Lemma l11_62_existence : forall A B C P, exists D,
  Coplanar A B C D /\ forall E, Coplanar A B C E -> Per E D P.
Proof.
(* Goal: forall A B C P : @Tpoint Tn, or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
  intros A B C P.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  destruct (cop_dec A B C P) as [|HNCop].
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
    exists P; split; [assumption|intros; Perp].
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  assert (HNCol : ~ Col A B C) by (apply ncop__ncol with P, HNCop).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  destruct (l8_18_existence A B P) as [D0 [HCol0 HPerp0]].
(* Goal: False *)
    intro; apply HNCop; exists P; left; split; Col.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  assert (HCop0 : Coplanar A B C D0) by (exists D0; left; split; Col).
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (ex_perp_cop A B D0 C) as [D1 [HPerp1 HCop1]]; auto.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  destruct (perp_not_col2 A B D1 D0 HPerp1) as [HNCol1|]; [|exfalso; Col].
  assert (Haux : forall D, Col D0 D1 D -> Coplanar A B C D).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { intros D HD.
(* Goal: @Coplanar Tn A B C D *)
    apply coplanar_trans_1 with D1; [Col|Cop|].
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    assert_diffs; apply coplanar_perm_12, col_cop__cop with D0; Col; Cop.
  }
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  destruct (diff_col_ex3 A B D0 HCol0) as [A0].
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  assert (HCopA : Coplanar A B C A0) by (exists A0; left; split; Col).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  assert (Per P D0 A0) by (destruct (l8_16_1 A B P A0 D0); auto).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
  destruct (per_dec P D0 D1) as [|HNPer].
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
  { exists D0.
(* Goal: False *)
    split; Col.
(* Goal: forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P *)
    intros E HE.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    apply l11_60 with A0 D1 D0; Perp.
      intro; apply HNCol1; ColR.
(* Goal: @Coplanar Tn D0 A0 D E *)
    apply coplanar_pseudo_trans with A B C; trivial.
  }
(* Goal: False *)
  destruct (l8_18_existence D0 D1 P) as [D []]; Col.
(* Goal: not (@Col Tn D0 D1 P) *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Coplanar Tn A B C D) (forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P)) *)
    intro Habs; apply HNCop, Haux, Habs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  exists D; split; auto.
(* Goal: forall (E : @Tpoint Tn) (_ : @Coplanar Tn A B C E), @Per Tn E D P *)
  intros E HE.
(* Goal: @Per Tn E D P *)
  assert (D <> D0) by (intro; subst; apply HNPer; Perp).
(* Goal: @Per Tn E D P *)
  assert (HPer : Per D0 D P) by (apply perp_per_1, perp_left_comm, perp_col with D1; auto).
(* Goal: @Per Tn E D P *)
  assert (HPer1 : Per D D0 A0).
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    assert_diffs; apply l8_2, per_col with D1; auto; destruct (l8_16_1 A B D1 A0 D0); Perp.
(* Goal: @Per Tn E D P *)
  apply l11_60 with D0 A0 D; Perp; [apply per_not_col in HPer1; Col|..].
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { destruct (symmetric_point_construction A0 D) as [A0'].
(* Goal: @Per Tn A0 D P *)
    apply l8_2; exists A0'; split; trivial.
(* Goal: @Cong Tn P A0 P A0' *)
    destruct (symmetric_point_construction D0 D) as [D0'].
    apply l10_12 with D0 D0';
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    [..|apply per_double_cong with D|apply cong_symmetry, l7_13 with D]; Perp.
(* Goal: @Per Tn P D0' A0' *)
    destruct (symmetric_point_construction P D) as [P'].
(* Goal: @Per Tn P D0' A0' *)
    apply midpoint_preserves_per with P' D0 A0 D; Midpoint.
(* Goal: @Per Tn P' D0 A0 *)
    apply l11_60 with P D D0; Perp; [|exists P'; left; split; Col].
(* Goal: not (@Col Tn P D D0) *)
    intro; apply HNCop, coplanar_trans_1 with D1; Col; [Cop|].
    exists D0; right; right; split; ColR.
  }
(* Goal: @Coplanar Tn D0 A0 D E *)
  apply coplanar_pseudo_trans with A B C; trivial.
(* Goal: False *)
  apply coplanar_trans_1 with D1; Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    Cop.
(* Goal: False *)
  exists D0; right; right; split; Col.
Qed.

Lemma l11_62_existence_bis : forall A B C P, ~ Coplanar A B C P ->
  exists X, Orth_at X A B C X P.
Proof.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros A B C P HNCop.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Orth_at Tn X A B C X P) *)
  destruct (l11_62_existence A B C P) as [X [HCop HX]].
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Orth_at Tn X A B C X P) *)
  assert (X <> P) by (intro; subst; apply (HNCop HCop)).
(* Goal: False *)
  exists X; repeat split; Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    apply ncop__ncol with P, HNCop.
(* Goal: forall (P0 Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P0) (_ : @Col Tn X P Q), @Per Tn P0 X Q *)
  intros D Q HD HQ.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply per_col with P; auto.
Qed.

Lemma l11_63_aux : forall A B C D E P,
  Coplanar A B C D -> D <> E -> Orth_at E A B C E P ->
  exists Q, OS D E P Q /\ Orth A B C D Q.
Proof.
(* Goal: forall (A B C D E P : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : not (@eq (@Tpoint Tn) D E)) (_ : @Orth_at Tn E A B C E P), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
  intros A B C D E P HD HDE HOrth.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
  assert (H' := HOrth).
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
  destruct H' as [HNCol [HEP [HE1 [_ HE2]]]].
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
  assert (HNCop : ~ Coplanar A B C P).
(* Goal: False *)
    intro; apply HEP, (col_cop_orth_at__eq A B C E P); Col.
(* Goal: False *)
  destruct (l10_15 D E D P) as [Q [HQ1 HQ2]]; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; apply HNCop, col_cop2__cop with D E; auto.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@OS Tn D E P Q) (@Orth Tn A B C D Q)) *)
  exists Q.
(* Goal: and (@OS Tn D E P Q) (@Orth Tn A B C D Q) *)
  split; [assumption|].
(* Goal: @Orth Tn A B C D Q *)
  destruct (ex_ncol_cop A B C D E HDE) as [F [HF1 HF2]].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (ex_perp_cop D E D F) as [D' [HD'1 HD'2]]; auto.
(* Goal: @Orth Tn A B C D Q *)
  assert (~ Col D' D E) by (assert_diffs; apply per_not_col; Perp).
(* Goal: @Orth Tn A B C D Q *)
  assert (Coplanar D E F A) by (apply coplanar_pseudo_trans with A B C; Cop).
(* Goal: @Orth Tn A B C D Q *)
  assert (Coplanar D E F B) by (apply coplanar_pseudo_trans with A B C; Cop).
(* Goal: @Orth Tn A B C D Q *)
  assert (Coplanar D E F C) by (apply coplanar_pseudo_trans with A B C; Cop).
(* Goal: @LeA Tn G E D G E F *)
  exists D.
  apply (cop3_orth_at__orth_at D' D E);
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    [assumption|apply coplanar_pseudo_trans with D E F; Cop..|].
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
  apply l11_60_bis; Cop; [|Perp..].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (ex_perp_cop D E E F) as [E' [HE'1 HE'2]]; auto.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
  apply (l11_61 E E' P); Perp.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    apply coplanar_trans_1 with F; Col; Cop.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    apply os__coplanar in HQ2; Cop.
(* Goal: False *)
    apply l8_2, HE2; Col.
(* Goal: @CongA Tn D E F A B C *)
    apply HE2; Col; apply coplanar_pseudo_trans with D E F; assumption.
Qed.

Lemma l11_63_existence : forall A B C D P,
  Coplanar A B C D -> ~ Coplanar A B C P ->
  exists Q, Orth A B C D Q.
Proof.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros A B C D P HCop HNCop.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Orth Tn A B C D Q) *)
  destruct (l11_62_existence_bis A B C P HNCop) as [E HE].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  destruct (eq_dec_points D E).
(* Goal: @CongA Tn D E F A B C *)
    exists P, D; subst; assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (l11_63_aux A B C D E P) as [Q []]; auto.
(* Goal: @CongA Tn D E F A B C *)
  exists Q; assumption.
Qed.

Lemma l8_21_3 : forall A B C D X, Coplanar A B C D -> ~ Coplanar A B C X ->
  exists P T, Orth A B C D P /\ Coplanar A B C T /\ Bet X T P.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : not (@Coplanar Tn A B C X)), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  intros A B C D X HD HX.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  destruct (l11_62_existence_bis A B C X HX) as [E HE].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  destruct (eq_dec_points D E).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { subst E.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
    destruct (segment_construction X D D X) as [Y []].
(* Goal: @Orth_at Tn X A B C U V *)
    exists Y, D; subst; repeat split; trivial.
(* Goal: @SuppA Tn A B C A B B' *)
    assert (D <> X) by (intro; subst; apply (HX HD)); assert_diffs.
(* Goal: False *)
    apply col_orth__orth with X; Col.
(* Goal: @CongA Tn D E F A B C *)
    exists D; assumption.
  }
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (l11_63_aux A B C D E X) as [P' [HOS HP']]; auto.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  destruct HE as [HNCol [HEX [HE [_ HOrth]]]].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  assert (HOrth' : Orth_at D A B C D P') by (apply col_cop_orth__orth_at; Col).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  assert (HDP' : D <> P') by (apply orth_distincts in HP'; spliter; auto).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  assert (HNCop : ~ Coplanar A B C P').
(* Goal: False *)
    apply orth_at__ncop2 with D D; auto; apply col_cop_orth__orth_at; Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  destruct HOrth' as [_ [_ [_ [_ HOrth']]]].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  destruct (segment_construction P' D D P') as [P []].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  assert (HT : TS D E X P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { apply l9_8_2 with P'; [|Side].
    repeat split; [intro; apply HNCop, col_cop2__cop with D E; ColR..|exists D; split; Col].
  }
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  destruct HT as [_ [_ [T []]]].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Orth Tn A B C D P) (and (@Coplanar Tn A B C T) (@Bet Tn X T P)))) *)
  exists P, T; repeat split; [|apply col_cop2__cop with D E; Col|assumption].
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: False *)
  apply col_orth__orth with P'; Col.
Qed.

Lemma mid2_orth_at2__cong : forall A B C X Y P Q P' Q',
  Orth_at X A B C X P -> Orth_at Y A B C Y Q -> Midpoint X P P' -> Midpoint Y Q Q' ->
  Cong P Q P' Q'.
Proof.
(* Goal: forall (A B C X Y P Q P' Q' : @Tpoint Tn) (_ : @Orth_at Tn X A B C X P) (_ : @Orth_at Tn Y A B C Y Q) (_ : @Midpoint Tn X P P') (_ : @Midpoint Tn Y Q Q'), @Cong Tn P Q P' Q' *)
  intros A B C X Y P Q P' Q' HX1 HY1 HX2 HY2.
(* Goal: @Cong Tn P Q P' Q' *)
  assert (HX3 := HX1).
(* Goal: @Cong Tn P Q P' Q' *)
  destruct HX3 as [HNCol [HXP [HCop1 [_ HX3]]]].
(* Goal: @Cong Tn P Q P' Q' *)
  assert (HY3 := HY1).
(* Goal: @Cong Tn P Q P' Q' *)
  destruct HY3 as [_ [HYQ [HCop2 [_ HY3]]]].
(* Goal: @Cong Tn P Q P' Q' *)
  destruct (midpoint_existence X Y) as [Z].
(* Goal: @Cong Tn P Q P' Q' *)
  destruct (symmetric_point_construction P Z) as [R].
(* Goal: @Cong Tn P Q P' Q' *)
  destruct (symmetric_point_construction P' Z) as [R'].
(* Goal: @Cong Tn P Q P' Q' *)
  assert (Coplanar A B C Z) by (apply bet_cop2__cop with X Y; Between).
(* Goal: @Cong Tn P Q P' Q' *)
  assert (Cong Z P Z P').
(* Goal: False *)
    apply per_double_cong with X; Col.
(* Goal: @Cong Tn P Q P' Q' *)
  apply five_segment with R R' Z Z; Between.
(* Goal: @Cong Tn A' C' C' A' *)
    apply cong_transitivity with P Z; [|apply cong_transitivity with P' Z]; Cong.
(* Goal: @CongA Tn D E F A B C *)
    apply cong_symmetry, l7_13 with Y; [apply symmetry_preserves_midpoint with P X P' Z|]; assumption.
(* Goal: False *)
    apply per_double_cong with Y; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; treat_equalities; auto.
Qed.

Lemma orth_at2_tsp__ts : forall A B C X Y P Q, P <> Q ->
  Orth_at P A B C P X -> Orth_at Q A B C Q Y -> TSP A B C X Y -> TS P Q X Y.
Proof.
(* Goal: forall (A B C X Y P Q : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) P Q)) (_ : @Orth_at Tn P A B C P X) (_ : @Orth_at Tn Q A B C Q Y) (_ : @TSP Tn A B C X Y), @TS Tn P Q X Y *)
  intros A B C X Y P Q HPQ HP HQ [HX [HY [T [HT HBet]]]].
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  assert (HP1 := HP).
(* Goal: @LtA Tn F E D0 C B A0 *)
  apply orth_at_chara in HP1; spliter.
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  assert (HQ1 := HQ).
(* Goal: @LtA Tn F E D0 C B A0 *)
  apply orth_at_chara in HQ1; spliter.
(* Goal: @LtA Tn A B P A B C *)
  repeat split.
(* Goal: False *)
    intro; apply HX, col_cop2__cop with P Q; Col.
(* Goal: False *)
    intro; apply HY, col_cop2__cop with P Q; Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn X T Y)) *)
  exists T; split; [|assumption].
(* Goal: @Col Tn T P Q *)
  destruct (symmetric_point_construction X P) as [X'].
(* Goal: @Col Tn T P Q *)
  destruct (symmetric_point_construction Y Q) as [Y'].
(* Goal: @Col Tn T P Q *)
  assert (Cong T X T X') by (apply per_double_cong with P; auto).
(* Goal: @Col Tn T P Q *)
  assert (Cong T Y T Y') by (apply per_double_cong with Q; auto).
(* Goal: @Col Tn T P Q *)
  apply col_permutation_4, bet_col, l7_22 with X Y X' Y'; trivial.
(* Goal: @Cong Tn A' C' C' A' *)
  apply (l4_6 X T Y); repeat split; Cong.
(* Goal: @Cong Tn X Y X' Y' *)
  assert (~ Col A B C) by (apply ncop__ncol with X, HX).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply mid2_orth_at2__cong with A B C P Q; auto.
Qed.

Lemma orth_dec : forall A B C U V, Orth A B C U V \/ ~ Orth A B C U V.
Proof.
(* Goal: forall A B C U V : @Tpoint Tn, or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
  intros A B C U V.
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
  destruct (eq_dec_points U V).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    unfold Orth, Orth_at; right; intros [X []]; spliter; auto.
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
  revert dependent V.
(* Goal: forall (V : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U V)), or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
  revert U.
  assert (Haux : forall U V, U <> V -> ~ Coplanar A B C U -> Orth A B C U V \/ ~ Orth A B C U V).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { intros U V HUV HU.
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
    destruct (l11_62_existence_bis A B C U HU) as [X HX].
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
    destruct (col_dec U V X).
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
      left; apply col_orth__orth with X; Col; apply orth_symmetry; exists X; apply HX.
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
    right; intros [Y HY].
(* Goal: False *)
    assert (X = Y).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { apply l11_62_unicity_bis with A B C U; [assumption|].
(* Goal: @LtA Tn F E D0 C B A0 *)
      apply orth_at_symmetry, col_orth_at__orth_at with V; [destruct HY; spliter..|]; trivial.
(* Goal: not (@eq (@Tpoint Tn) U Y) *)
      intro; subst Y; absurd (Coplanar A B C U); [|assumption].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      assert_diffs; apply orth_at__ncop2 with X X; auto.
    }
(* Goal: False *)
    subst; destruct HY; spliter; Col.
  }
(* Goal: forall (U V : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U V)), or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
  intros U V HUV.
(* Goal: @Out Tn B P Q *)
  destruct (col_dec A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    unfold Orth, Orth_at; right; intros [X []]; spliter; auto.
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
  destruct (cop_dec A B C U); [|auto].
(* Goal: or (@Orth Tn A B C U V) (not (@Orth Tn A B C U V)) *)
  destruct (cop_dec A B C V).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - right; intro.
(* Goal: False *)
    apply HUV, (orth_at2__eq A B C U V); apply col_cop_orth__orth_at; Col.
  - destruct (Haux V U) as [HOrth|HNOrth]; auto;
    [left|right; intro HOrth; apply HNOrth]; apply orth_symmetry, HOrth.
Qed.

Lemma orth_at_dec : forall A B C U V X, Orth_at X A B C U V \/ ~ Orth_at X A B C U V.
Proof.
(* Goal: forall A B C U V X : @Tpoint Tn, or (@Orth_at Tn X A B C U V) (not (@Orth_at Tn X A B C U V)) *)
  intros A B C U V X.
(* Goal: or (@Orth_at Tn X A B C U V) (not (@Orth_at Tn X A B C U V)) *)
  destruct (orth_dec A B C U V) as [|HNOrth]; [|right; intro HX; apply HNOrth; exists X; apply HX].
(* Goal: or (@Orth_at Tn X A B C U V) (not (@Orth_at Tn X A B C U V)) *)
  destruct (cop_dec A B C X); [|unfold Orth_at; right; intro; spliter; auto].
(* Goal: or (@Orth_at Tn X A B C U V) (not (@Orth_at Tn X A B C U V)) *)
  destruct (col_dec U V X) as [HCol|]; [|unfold Orth_at; right; intro; spliter; auto].
(* Goal: @CongA Tn D E F A B C *)
  left; apply col_cop_orth__orth_at; assumption.
Qed.

Lemma tsp_dec : forall A B C X Y, TSP A B C X Y \/ ~ TSP A B C X Y.
Proof.
(* Goal: forall A B C X Y : @Tpoint Tn, or (@OSP Tn A B C X Y) (not (@OSP Tn A B C X Y)) *)
  intros A B C X Y.
(* Goal: or (@OSP Tn A B C X Y) (not (@OSP Tn A B C X Y)) *)
  destruct (cop_dec A B C X) as [|HX].
(* Goal: @CongA Tn D E F A B C *)
    right; intros [Ha]; apply Ha; assumption.
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  destruct (cop_dec A B C Y) as [|HY].
(* Goal: @CongA Tn D E F A B C *)
    right; intros [_ [Ha]]; apply Ha; assumption.
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  destruct (l11_62_existence_bis A B C X HX) as [P HP].
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  destruct (l11_62_existence_bis A B C Y HY) as [Q HQ].
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  assert (HP1 := HP).
(* Goal: @LtA Tn F E D0 C B A0 *)
  apply orth_at_chara in HP1; spliter.
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  assert (HQ1 := HQ).
(* Goal: @LtA Tn F E D0 C B A0 *)
  apply orth_at_chara in HQ1; spliter.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
  destruct (eq_dec_points P Q).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { subst Q; clear HQ; destruct (bet_dec X P Y) as [|HNBet].
(* Goal: @LeA Tn Q B P C B A *)
      left; repeat split; trivial; exists P; split; trivial.
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
    right; intro HQ; apply HNBet.
(* Goal: @Bet Tn X P Y *)
    destruct HQ as [_ [_ [Q [HQ HBet]]]].
(* Goal: @Bet Tn X P Y *)
    replace P with Q; [assumption|].
(* Goal: False *)
    apply l8_8, (col_per2__per X Y); try (apply l8_2); Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; treat_equalities; auto.
  }
(* Goal: or (@TSP Tn A B C X Y) (not (@TSP Tn A B C X Y)) *)
  destruct (two_sides_dec P Q X Y) as [HT|HNTS].
(* Goal: @CongA Tn D E F A B C *)
    left; apply cop2_ts__tsp with P Q; assumption.
(* Goal: @CongA Tn D E F A B C *)
    right; intro; apply HNTS, (orth_at2_tsp__ts A B C); assumption.
Qed.

Lemma osp_dec : forall A B C X Y, OSP A B C X Y \/ ~ OSP A B C X Y.
Proof.
(* Goal: forall A B C X Y : @Tpoint Tn, or (@OSP Tn A B C X Y) (not (@OSP Tn A B C X Y)) *)
  intros A B C X Y.
(* Goal: or (@OSP Tn A B C X Y) (not (@OSP Tn A B C X Y)) *)
  destruct (cop_dec A B C X) as [|HX].
(* Goal: @CongA Tn D E F A B C *)
    right; intros [X' [[Ha _] _]]; apply Ha; assumption.
(* Goal: or (@OSP Tn A B C X Y) (not (@OSP Tn A B C X Y)) *)
  destruct (tsp_exists A B C X HX) as [X'].
(* Goal: or (@OSP Tn A B C X Y) (not (@OSP Tn A B C X Y)) *)
  destruct (tsp_dec A B C Y X') as [|HNTS].
(* Goal: @CongA Tn D E F A B C *)
    left; exists X'; split; assumption.
(* Goal: @CongA Tn D E F A B C *)
    right; intro; apply HNTS; apply l9_41_2 with X; assumption.
Qed.

Lemma os_ts__inangle : forall A B C P, TS B P A C -> OS B A C P -> InAngle P A B C.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : @TS Tn B P A C) (_ : @OS Tn B A C P), @InAngle Tn P A B C *)
  intros A B C P Hts Hos.
(* Goal: @InAngle Tn P A B C *)
  assert(HNCol : ~ Col A B P) by (destruct Hts as []; Col).
(* Goal: @InAngle Tn P A B C *)
  assert(~ Col B A C) by (apply (one_side_not_col123 _ _ _ P); auto).
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
  assert (HP' := symmetric_point_construction P B).
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
  destruct HP' as [P'].
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @InAngle Tn P A B C *)
  assert(~ Col B A P') by (intro; apply HNCol; ColR).
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
  assert(HUn := two_sides_in_angle A B C P P').
(* Goal: @InAngle Tn P A B C *)
  destruct HUn as [|Habs]; Between.
(* Goal: @Out Tn B C T' *)
  exfalso.
(* Goal: False *)
  apply in_angle_one_side in Habs; Col.
(* Goal: False *)
  apply l9_9_bis in Habs.
(* Goal: False *)
  apply Habs.
  apply invert_two_sides; apply l9_2.
(* Goal: @TS Tn B A C P' *)
  apply (l9_8_2 _ _ P); Side.
(* Goal: @TS Tn B A P P' *)
  repeat split; Col; exists B; split; Col; Between.
Qed.

Lemma os2__inangle : forall A B C P, OS B A C P -> OS B C A P -> InAngle P A B C.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : @OS Tn B A C P) (_ : @OS Tn B C A P), @InAngle Tn P A B C *)
  intros A B C P Hos1 Hos2.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply os_ts__inangle; auto.
(* Goal: @TS Tn B P A C *)
  apply l9_31; Side.
Qed.

Lemma acute_conga__acute : forall A B C D E F, Acute A B C -> CongA A B C D E F -> Acute D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Acute Tn A B C) (_ : @CongA Tn A B C D E F), @Acute Tn D E F *)
  intros A B C D E F Hacute HConga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (acute_lea_acute _ _ _ A B C); auto.
(* Goal: @LeA Tn A B C D E F *)
  apply conga__lea.
(* Goal: @CongA Tn D E F A B C *)
  apply conga_sym; assumption.
Qed.

Lemma acute_out2__acute : forall A B C A' C', Out B A' A -> Out B C' C -> Acute A B C ->
  Acute A' B C'.
Proof.
(* Goal: forall (A B C A' C' : @Tpoint Tn) (_ : @Out Tn B A' A) (_ : @Out Tn B C' C) (_ : @Obtuse Tn A B C), @Obtuse Tn A' B C' *)
  intros A B C A' C' HA HC HB.
(* Goal: @Acute Tn A' B C' *)
  apply (acute_conga__acute A B C).
(* Goal: @CongA Tn D E F A B C *)
    assumption.
(* Goal: @CongA Tn D E F A B C *)
  apply out2__conga; assumption.
Qed.

Lemma conga_obtuse__obtuse : forall A B C D E F, Obtuse A B C -> CongA A B C D E F -> Obtuse D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Obtuse Tn A B C) (_ : @CongA Tn A B C D E F), @Obtuse Tn D E F *)
  intros A B C D E F Hobtuse HConga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (obtuse_gea_obtuse _ _ _ A B C); auto.
(* Goal: @CongA Tn D E F A B C *)
  apply conga__lea; assumption.
Qed.

Lemma obtuse_out2__obtuse : forall A B C A' C', Out B A' A -> Out B C' C -> Obtuse A B C ->
  Obtuse A' B C'.
Proof.
(* Goal: forall (A B C A' C' : @Tpoint Tn) (_ : @Out Tn B A' A) (_ : @Out Tn B C' C) (_ : @Obtuse Tn A B C), @Obtuse Tn A' B C' *)
  intros A B C A' C' HA HC HB.
(* Goal: @Obtuse Tn A' B C' *)
  apply (conga_obtuse__obtuse A B C).
(* Goal: @CongA Tn D E F A B C *)
    assumption.
(* Goal: @CongA Tn D E F A B C *)
  apply out2__conga; assumption.
Qed.

Lemma bet_lea__bet : forall A B C D E F, Bet A B C -> LeA A B C D E F -> Bet D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @LeA Tn A B C D E F), @Bet Tn D E F *)
  intros A B C D E F HBet Hlea.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (bet_conga__bet A B C); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply lea_asym; auto.
(* Goal: @CongA Tn D E F D E F *)
  apply lea_distincts in Hlea.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_31_2; auto.
Qed.

Lemma out_lea__out : forall A B C D E F, Out E D F -> LeA A B C D E F -> Out B A C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Out Tn E D F) (_ : @LeA Tn A B C D E F), @Out Tn B A C *)
  intros A B C D E F Hout Hlea.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (l11_21_a D E F); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply lea_asym; auto.
(* Goal: @CongA Tn D E F D E F *)
  apply lea_distincts in Hlea.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_31_1; auto.
Qed.


Lemma bet2_lta__lta : forall A B C D E F A' D',
  LtA A B C D E F -> Bet A B A' -> A' <> B -> Bet D E D' -> D' <> E ->
  LtA D' E F A' B C.
Proof.
(* Goal: forall (A B C D E F A' D' : @Tpoint Tn) (_ : @LtA Tn A B C D E F) (_ : @Bet Tn A B A') (_ : not (@eq (@Tpoint Tn) A' B)) (_ : @Bet Tn D E D') (_ : not (@eq (@Tpoint Tn) D' E)), @LtA Tn D' E F A' B C *)
  intros A B C D E F A' D' Hlta.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @Lt Tn E F B C *)
  assert (Hd := Hlta).
(* Goal: @Lt Tn E F B C *)
  apply lta_distincts in Hd.
(* Goal: @LtA Tn D' E F A' B C *)
  unfold LtA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (l11_36 A _ _ D); auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  assert(CongA A B C D E F); auto.
(* Goal: @CongA Tn A B C D E F *)
  apply (l11_13 A' _ _ D'); try (apply conga_sym); Between.
Qed.


Lemma lta__lea : forall A B C D E F, LtA A B C D E F -> LeA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @LeA Tn A B C D E F *)
  destruct H.
(* Goal: @CongA Tn D E F A B C *)
  assumption.
Qed.

Lemma lea123456_lta__lta : forall A B C D E F G H I, LeA A B C D E F -> LtA D E F G H I ->
   LtA A B C G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @LeA Tn A B C D E F) (_ : @LtA Tn D E F G H I), @LtA Tn A B C G H I *)
  intros A B C D E F G H I Hlea Hlta.
(* Goal: @LtA Tn A B P A B C *)
  split.
  - apply (lea_trans _ _ _ D E F).
(* Goal: @CongA Tn D E F A B C *)
    assumption.
(* Goal: @CongA Tn D E F A B C *)
    apply lta__lea; assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: False *)
    destruct Hlta as [Hlea' HNConga].
(* Goal: False *)
    apply HNConga.
(* Goal: @CongA Tn D E F G H I *)
    apply lea_asym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (l11_30 A B C D E F); auto.
(* Goal: @CongA Tn D E F D E F *)
    apply lea_distincts in Hlea.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    apply conga_refl; assumption.
Qed.

Lemma lea456789_lta__lta : forall A B C D E F G H I, LtA A B C D E F -> LeA D E F G H I ->
   LtA A B C G H I.
Proof.
  intros A B C D E F G H I Hlta Hlea.
(* Goal: @LtA Tn A B P A B C *)
  split.
  - apply (lea_trans _ _ _ D E F).
(* Goal: @CongA Tn D E F A B C *)
    apply lta__lea; assumption.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: False *)
    destruct Hlta as [Hlea' HNConga].
(* Goal: False *)
    apply HNConga.
(* Goal: @CongA Tn D E F G H I *)
    apply lea_asym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (l11_30 D E F G H I); auto.
(* Goal: @CongA Tn D E F A B C *)
    2: apply conga_sym; assumption.
(* Goal: @CongA Tn D E F D E F *)
    apply lea_distincts in Hlea.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @CongA Tn D E F A B C *)
    apply conga_refl; assumption.
Qed.

Lemma acute_per__lta : forall A B C D E F, Acute A B C -> D <> E -> E <> F -> Per D E F ->
   LtA A B C D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Acute Tn A B C) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)) (_ : @Per Tn D E F), @LtA Tn A B C D E F *)
  intros A B C D E F Hacute HDE HEF HPer.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @LtA Tn A B C D E F *)
  destruct Hacute as [G [H [I [HPer2 Hlta]]]].
(* Goal: @LtA Tn A B C D E F *)
  assert(Hdiff := lta_distincts A B C G H I Hlta).
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (conga_preserves_lta A B C G H I); try (apply conga_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_16; auto.
Qed.

Lemma obtuse_per__lta : forall A B C D E F, Obtuse A B C -> D <> E -> E <> F -> Per D E F ->
   LtA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Obtuse Tn A B C) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)) (_ : @Per Tn D E F), @LtA Tn D E F A B C *)
  intros A B C D E F Hobtuse HDE HEF HPer.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @LtA Tn D E F A B C *)
  destruct Hobtuse as [G [H [I [HPer2 Hgta]]]].
(* Goal: @LtA Tn D E F A B C *)
  assert(Hdiff := gta_distincts A B C G H I Hgta).
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (conga_preserves_lta G H I A B C); try (apply conga_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_16; auto.
Qed.

Lemma acute_obtuse__lta : forall A B C D E F, Acute A B C -> Obtuse D E F -> LtA A B C D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Acute Tn A B C) (_ : @Obtuse Tn D E F), @LtA Tn A B C D E F *)
  intros A B C D E F Hacute Hobtuse.
(* Goal: @LtA Tn A B C D E F *)
  destruct Hacute as [G [H [I [HPer Hlta]]]].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (lta_trans _ _ _ G H I); auto.
(* Goal: @LtA Tn G H I D E F *)
  apply lta_distincts in Hlta.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply obtuse_per__lta; auto.
Qed.

Lemma lea_in_angle : forall A B C P, LeA A B P A B C -> OS A B C P ->
   InAngle P A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
    assert(H1 := H0).
    clear H0.
    assert(H0 : CongA A B P A B P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { assert(~ Col A B P) by (apply (one_side_not_col123 _ _ _ C); Side).
(* Goal: @SuppA Tn A B C A B B' *)
      assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply conga_refl; auto.
    }
    unfold LeA in H.
    ex_and H T.
    eapply conga_preserves_in_angle.
(* Goal: False *)
(* Goal: @Cong Tn B A B C *)
      3: apply H.
(* Goal: @CongA Tn A B P1 A B P1 *)
(* Goal: @OS Tn B A P1 P2 *)
(* Goal: and (@CongA Tn A B P1 A B P2) (@OS Tn B A P2 P2) *)
      apply conga_refl.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) F E)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun D' : @Tpoint Tn => @ex (@Tpoint Tn) (fun F' : @Tpoint Tn => and (@Bet Tn B A A') (and (@Cong Tn A A' E D) (and (@Bet Tn B C C') (and (@Cong Tn C C' E F) (and (@Bet Tn E D D') (and (@Cong Tn D D' B A) (and (@Bet Tn E F F') (and (@Cong Tn F F' B C) (@Cong Tn A' C' D' F')))))))))))))))) *)
        assert(HH0:=H0).
        unfold CongA in HH0.
(* Goal: @LtA Tn F E D0 C B A0 *)
        spliter.
        clear H6.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        repeat split; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Lt Tn A C A' C' *)
(* Goal: @Lt Tn A C A' C' *)
      subst C.
      unfold OS in H1.
      ex_and H1 X.
      unfold TS in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: False *)
      apply H1.
(* Goal: False *)
      Col.
(* Goal: @CongA Tn A' B C A B C *)
      eapply conga_trans; apply conga_sym.
(* Goal: False *)
        apply H2.
(* Goal: False *)
      apply H0.
    apply one_side_symmetry.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma acute_bet__obtuse : forall A B C A', Bet A B A' -> A' <> B -> Acute A B C -> Obtuse A' B C.
Proof.
  intros A B C A' HBet HA'B Hacute.
  assert(Hd := acute_distincts A B C Hacute).
  destruct Hd.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    elim(bet_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    - intro.
(* Goal: @Out Tn B C T' *)
      exfalso.
      assert(Hlta : LtA A B C A B C) by (apply acute_obtuse__lta; auto; apply bet__obtuse; auto).
      destruct Hlta as [_ HNConga].
(* Goal: False *)
      apply HNConga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply conga_refl; auto.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    - intro.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply bet__obtuse; auto.
(* Goal: @Bet Tn A A C *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Out Tn B A P) *)
(* Goal: @InAngle Tn P A B C *)
      apply between_symmetry.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (l6_2 A); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply not_bet_out; auto.
  }
  intro HNCol1.
  assert(HD := l10_15 A B B C).
(* Goal: False *)
  destruct HD as [D []]; Col.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  assert(HNCol2 : ~ Col C B D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
    assert(Hlta : LtA A B C A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    2: destruct Hlta as [_ HNConga]; apply HNConga; apply conga_refl; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply acute_per__lta; auto.
(* Goal: False *)
    apply (per_col _ _ D); Perp; Col.
  }
  assert(OS B A' C D) by (apply (col_one_side _ A); Side; Col).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
  exists A.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
  exists B.
(* Goal: @LeA Tn G E D G E F *)
  exists D.
(* Goal: and (@Per Tn A B D) (@GtA Tn A B C A B D) *)
  split; Perp.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @LeA Tn G E D G E F *)
  - exists D.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    2: apply conga_comm; apply l11_18_1; Perp.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply os2__inangle; auto.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { repeat split; Col.
      intro; apply HNCol1; ColR.
      exists B; Col; Between.
    }
(* Goal: @TS Tn B P A C *)
    apply invert_two_sides.
(* Goal: False *)
    apply in_angle_two_sides; Col.
(* Goal: @InAngle Tn Q C B A *)
    apply l11_24.
    apply lea_in_angle; try (apply conga_refl); Side.
    apply lta__lea.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    apply acute_per__lta; Perp.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
    apply HNCol2.
    assert(HUn := conga_cop__or_out_ts A' B D C).
(* Goal: @LtA Tn F G E F E G *)
    destruct HUn.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      Cop.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (conga_trans _ _ _ A B D); auto.
(* Goal: False *)
      apply l11_16; auto; apply (l8_3 A); Perp; Col.
(* Goal: False *)
      assert_cols; Col.
    exfalso; assert(~ TS A' B D C); auto; apply l9_9_bis; Side.
Qed.

Lemma bet_obtuse__acute : forall A B C A', Bet A B A' -> A' <> B -> Obtuse A B C -> Acute A' B C.
Proof.
  intros A B C A' HBet HA'B Hobtuse.
  assert(Hd := obtuse_distincts A B C Hobtuse).
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    elim(bet_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    - intro.
      apply out__acute.
      apply (l6_2 _ _ A); Between.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    - intro.
(* Goal: @Out Tn B C T' *)
      exfalso.
      assert(Hlta : LtA A B C A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      2: destruct Hlta as [_ HNConga]; apply HNConga; apply conga_refl; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply acute_obtuse__lta; auto.
      apply out__acute.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply not_bet_out; auto.
  }
  intro HNCol1.
  assert(HD := l10_15 A B B C).
(* Goal: False *)
  destruct HD as [D []]; Col.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  assert(HNCol2 : ~ Col C B D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
    assert(Hlta : LtA A B C A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    2: destruct Hlta as [_ HNConga]; apply HNConga; apply conga_refl; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply obtuse_per__lta; auto.
(* Goal: False *)
    apply (per_col _ _ D); Perp; Col.
  }
  assert(OS B A' C D) by (apply (col_one_side _ A); Side; Col).
  assert(~ Col A B D) by (apply per_not_col; Perp).
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
  exists A'.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
  exists B.
(* Goal: @LeA Tn G E D G E F *)
  exists D.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: False *)
  apply (l8_3 A); Perp; Col.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
  - exists C.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    split; try (apply conga_refl); auto.
(* Goal: @InAngle Tn P A B C *)
    apply os2__inangle; Side.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    { repeat split; auto.
      apply (one_side_not_col123 _ _ _ C); Side.
      exists B; Col; Between.
    }
(* Goal: @TS Tn B P A C *)
    apply invert_two_sides.
(* Goal: False *)
    apply in_angle_two_sides; Col.
(* Goal: @InAngle Tn Q C B A *)
    apply l11_24.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply lea_in_angle; try (apply conga_refl); auto.
    apply lta__lea.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    apply obtuse_per__lta; Perp.

  - intro Habs.
    apply HNCol2.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    assert (HCop : Coplanar A' B C D) by Cop.
    assert(HUn := conga_cop__or_out_ts A' B C D HCop Habs).
(* Goal: @LtA Tn F G E F E G *)
    destruct HUn.
(* Goal: False *)
    assert_cols; Col.
    exfalso; assert(~ TS A' B C D); auto; apply l9_9_bis; Side.
Qed.


Lemma inangle_dec : forall A B C P, InAngle P A B C \/ ~ InAngle P A B C.
Proof.
(* Goal: forall A B C P : @Tpoint Tn, or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
  intros A B C P.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
  elim(cop_dec A B C P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { intro HCop.
(* Goal: @Le Tn A C A D *)
    elim(eq_dec_points A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      intro; subst; right; unfold InAngle; intro; spliter; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    elim(eq_dec_points C B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      intro; subst; right; unfold InAngle; intro; spliter; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    elim(eq_dec_points P B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      intro; subst; right; unfold InAngle; intro; spliter; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    elim(col_dec A B C).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { intro HColB.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
      elim(bet_dec A B C).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
      { intro HBBet.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
        exists B.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        split; auto.
      }
(* Goal: forall _ : not (@Bet Tn A B C), or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
      intro HBNBet.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
      elim(out_dec B A P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
      { left.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
        exists A; Between.
      }
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: not (@CongA Tn A B P A B C) *)
      intro Habs.
(* Goal: False *)
      destruct Habs as [_ [_ [_ [X [HXBet HUn]]]]].
(* Goal: False *)
      destruct HUn as [|HoutBXP].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        subst; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      assert(HInter := out2_bet_out A B C X P); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      destruct HInter; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply not_bet_out; auto.
    }
(* Goal: forall _ : not (@Col Tn A B C), or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
    intro HNColB.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    assert(HP' := symmetric_point_construction P B).
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    destruct HP' as [P'].
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    elim(two_sides_dec B P A C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    { intro.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
      assert(HUn := two_sides_in_angle A B C P P').
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
      destruct HUn as [HInAngle|HInAngle]; Between.
      - destruct HInAngle as [_ [_ [_ [X [HXBet HUn]]]]].
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
        destruct HUn as [HXB|HBout].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
          left; repeat split; auto; exists X; split; auto.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
        right.
(* Goal: not (@CongA Tn A B P A B C) *)
        intro Habs.
(* Goal: False *)
        destruct Habs as [_ [_ [_ [X' [HX'Bet HUn]]]]].
(* Goal: False *)
        assert(Col B X' P) by (destruct HUn; subst; assert_cols; Col).
(* Goal: False *)
        assert(X = X') by (apply (l6_21 A C B P); Col; ColR).
(* Goal: False *)
        subst X'.
(* Goal: @SuppA Tn A B C A B B' *)
        assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        destruct HUn as [|HBout']; auto.
(* Goal: False *)
        assert(Col P B P' /\ ~ Bet P B P'); spliter; Between.
(* Goal: and (@Col Tn P B P') (not (@Bet Tn P B P')) *)
        apply l6_4_1.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply (l6_7 _ _ X); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply l6_6; auto.
    }
(* Goal: forall _ : not (@TS Tn B P A C), or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    intro HNts.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    elim(col_dec B A P).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    { intro.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
      elim(out_dec B A P).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      { intro.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
        exists A; Between.
      }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: not (@CongA Tn A B P A B C) *)
      intro Habs.
(* Goal: False *)
      destruct Habs as [_ [_ [_ [X [HXBet HUn]]]]].
(* Goal: False *)
      assert(Col B X P) by (destruct HUn; subst; assert_cols; Col).
(* Goal: False *)
      assert(X = A) by (apply (l6_21 A C B P); Col; ColR).
(* Goal: False *)
      subst X.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      destruct HUn; auto.
    }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
    elim(col_dec B C P).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    { intro.
(* Goal: or (@InAngle Tn P A B C) (not (@InAngle Tn P A B C)) *)
      elim(out_dec B C P).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      { intro.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        left.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
        exists C; Between.
      }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
      right.
(* Goal: not (@CongA Tn A B P A B C) *)
      intro Habs.
(* Goal: False *)
      destruct Habs as [_ [_ [_ [X [HXBet HUn]]]]].
(* Goal: False *)
      assert(Col B X P) by (destruct HUn; subst; assert_cols; Col).
(* Goal: False *)
      assert(X = C) by (apply (l6_21 A C B P); Col; ColR).
(* Goal: False *)
      subst X.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      destruct HUn; auto.
    }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply HNts.
(* Goal: @TS Tn B P A C *)
    apply invert_two_sides.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply in_angle_two_sides; auto.
  }
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intro HNCop.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  right.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  apply HNCop; Cop.
Qed.

Lemma lea_dec : forall A B C D E F, LeA A B C D E F \/ ~ LeA A B C D E F.
Proof.
(* Goal: forall A B C D E F : @Tpoint Tn, or (@GtA Tn A B C D E F) (not (@GtA Tn A B C D E F)) *)
  intros A B C D E F.
(* Goal: @Le Tn A C A D *)
  elim(eq_dec_points A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; right; intro Hlea; apply lea_distincts in Hlea; spliter; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
  elim(eq_dec_points B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; right; intro Hlea; apply lea_distincts in Hlea; spliter; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
  elim(eq_dec_points D E).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; right; intro Hlea; apply lea_distincts in Hlea; spliter; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
  elim(eq_dec_points E F).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; right; intro Hlea; apply lea_distincts in Hlea; spliter; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    elim(out_dec B A C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      intro; left; apply l11_31_1; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
    elim(bet_dec D E F).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      intro; left; apply l11_31_2; auto.
(* Goal: forall _ : not (@Bet Tn D E F), or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
    intro HENBet.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply HENBet.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (bet_lea__bet A B C); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply not_out_bet; auto.
  }
(* Goal: forall _ : not (@Col Tn A B C), or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
  intro HNColB.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  elim(col_dec D E F).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
    elim(bet_dec D E F).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      intro; left; apply l11_31_2; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply HNColB.
(* Goal: @Col Tn A B C *)
    apply col_permutation_4.
(* Goal: @Col Tn B A C *)
    apply out_col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (out_lea__out _ _ _ D E F); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply not_bet_out; auto.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
  assert(HP := angle_construction_1 A B C D E F).
(* Goal: False *)
  destruct HP as [P []]; Col.
(* Goal: or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
  elim(inangle_dec D E F P).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; left; exists P; auto.
(* Goal: forall _ : not (@InAngle Tn P D E F), or (@LeA Tn A B C D E F) (not (@LeA Tn A B C D E F)) *)
  intro HNInAngle.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  right.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: False *)
  apply HNInAngle.
(* Goal: @InAngle Tn P D E F *)
  apply lea_in_angle; try (apply conga_sym); Side.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (l11_30 A B C D E F); auto; apply conga_refl; auto.
Qed.

Lemma gea_dec : forall A B C D E F, GeA A B C D E F \/ ~ GeA A B C D E F.
Proof.
(* Goal: forall A B C D E F : @Tpoint Tn, or (@GtA Tn A B C D E F) (not (@GtA Tn A B C D E F)) *)
  intros A B C D E F.
(* Goal: or (@GeA Tn A B C D E F) (not (@GeA Tn A B C D E F)) *)
  unfold GeA.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  elim(lea_dec D E F A B C); auto.
Qed.

Lemma lta_dec : forall A B C D E F, LtA A B C D E F \/ ~ LtA A B C D E F.
Proof.
(* Goal: forall A B C D E F : @Tpoint Tn, or (@GtA Tn A B C D E F) (not (@GtA Tn A B C D E F)) *)
  intros A B C D E F.
(* Goal: or (@LtA Tn A B C D E F) (not (@LtA Tn A B C D E F)) *)
  elim(conga_dec A B C D E F).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    right.
(* Goal: @LtA Tn A B A A B C *)
    unfold LtA.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    auto.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  elim(lea_dec A B C D E F).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    left.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    split; auto.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  right.
(* Goal: @LtA Tn A B A A B C *)
  unfold LtA.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  auto.
Qed.

Lemma gta_dec : forall A B C D E F, GtA A B C D E F \/ ~ GtA A B C D E F.
Proof.
(* Goal: forall A B C D E F : @Tpoint Tn, or (@GtA Tn A B C D E F) (not (@GtA Tn A B C D E F)) *)
  intros A B C D E F.
(* Goal: @GtA Tn A B C D E F *)
  unfold GtA.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  elim(lta_dec D E F A B C); auto.
Qed.

Lemma lea_total : forall A B C D E F, A <> B -> B <> C -> D <> E -> E <> F ->
   LeA A B C D E F \/ LeA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)), or (@GeA Tn A B C D E F) (@GeA Tn D E F A B C) *)
  intros A B C D E F HAB HBC HDE HEF.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    elim(out_dec B A C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    - intro; left; apply l11_31_1; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    - intro; right; apply l11_31_2; auto; apply not_out_bet; auto.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  elim(col_dec D E F).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
    elim(out_dec E D F).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    - intro; right; apply l11_31_1; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    - intro; left; apply l11_31_2; auto; apply not_out_bet; auto.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  elim(lea_dec A B C D E F).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; left; auto.
(* Goal: forall _ : not (@LeA Tn A B C D E F), or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  intro HNlea.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  right.
(* Goal: @LeA Tn D E F A B C *)
  assert(HP := angle_construction_1 D E F A B C).
(* Goal: False *)
  destruct HP as [P []]; Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  exists P.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  split; auto.
(* Goal: @InAngle Tn P A B C *)
  apply os2__inangle; Side.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  apply cop__not_two_sides_one_side; Col; Cop.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: False *)
    apply HNlea.
(* Goal: @LeA Tn A B C D E F *)
    apply conga__lea.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (out_conga A B P D E F); try (apply out_trivial); try (apply conga_sym); auto.
(* Goal: @Out Tn B P C *)
    apply (col_one_side_out _ A); Col; Side.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: False *)
    apply HNlea.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (l11_30 A B C A B P); try (apply conga_refl); try (apply conga_sym); auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
    exists C.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    split; try (apply conga_refl); auto.
(* Goal: @InAngle Tn C A B P *)
    apply os_ts__inangle; Side.
Qed.

Lemma gea_total : forall A B C D E F, A <> B -> B <> C -> D <> E -> E <> F ->
   GeA A B C D E F \/ GeA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)), or (@GeA Tn A B C D E F) (@GeA Tn D E F A B C) *)
  intros A B C D E F HAB HBC HDE HEF.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  elim(lea_total A B C D E F); auto.
Qed.

Lemma or_lta_conga_gta : forall A B C D E F,
 A <> B -> C <> B -> D <> E -> F <> E ->
 LtA A B C D E F \/ GtA A B C D E F \/ CongA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: or (@LtA Tn A B C D E F) (or (@GtA Tn A B C D E F) (@CongA Tn A B C D E F)) *)
    assert(HH:=lea_total A B C D E F).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    induction HH; auto.
(* Goal: or (@LtA Tn A B C D E F) (or (@GtA Tn A B C D E F) (@CongA Tn A B C D E F)) *)
      induction(conga_dec A B C D E F).
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
        right; right.
(* Goal: @CongA Tn D E F A B C *)
        assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      left.
(* Goal: @LtA Tn A B A A B C *)
      unfold LtA.
(* Goal: @CongA Tn D E F A B C *)
      split; assumption.
(* Goal: or (@LtA Tn A B C D E F) (or (@GtA Tn A B C D E F) (@CongA Tn A B C D E F)) *)
    induction(conga_dec A B C D E F).
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
      right; right.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
    right; left.
(* Goal: @GtA Tn A B C D E F *)
    unfold GtA.
(* Goal: @LtA Tn A B A A B C *)
    unfold LtA.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @CongA Tn D E F A B C *)
      assumption.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply H4.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
Qed.

Lemma angle_partition : forall A B C, A <> B -> B <> C ->
   Acute A B C \/ Per A B C \/ Obtuse A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)), or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  intros A B C HAB HBC.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  assert(Hl := lower_dim_ex).
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  destruct Hl as [A' [B' [D']]].
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  assert(~ Col A' B' D') by (unfold Col; auto).
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  assert(HC' := l10_15 A' B' B' D').
(* Goal: False *)
  destruct HC' as [C' [HC'Right _]]; Col.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (or_lta_conga_gta A B C A' B' C') as [|[|]]; auto.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  - left.
(* Goal: @Obtuse Tn A B C *)
    exists A', B', C'.
(* Goal: and (@Per Tn A' B' C') (@GtA Tn A B C A' B' C') *)
    repeat (split; Perp).
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  - right; right.
(* Goal: @Obtuse Tn A B C *)
    exists A', B', C'.
(* Goal: and (@Per Tn A' B' C') (@GtA Tn A B C A' B' C') *)
    repeat (split; Perp).
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  - right; left.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    apply (l11_17 A' B' C'); try (apply conga_sym); Perp.
Qed.

Lemma acute_chara : forall A B C A', Bet A B A' -> B <> A' -> (Acute A B C <-> LtA A B C A' B C).
Proof.
(* Goal: forall (A B C A' : @Tpoint Tn) (_ : @Bet Tn A B A') (_ : not (@eq (@Tpoint Tn) B A')), iff (@Obtuse Tn A B C) (@LtA Tn A' B C A B C) *)
  intros A B C A' HBet HBA'.
(* Goal: @LtA Tn A B P A B C *)
  split.
  - intro Hacute.
(* Goal: @LtA Tn A B C A' B C *)
    assert(Hdiff := acute_distincts A B C Hacute).
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply acute_obtuse__lta; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (acute_bet__obtuse A); auto.

  - intro Hlta.
(* Goal: @Lt Tn E F B C *)
    assert (Hd := Hlta).
(* Goal: @Lt Tn E F B C *)
    apply lta_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    elim(angle_partition A B C); auto.
(* Goal: not (@CongA Tn A B P A B C) *)
    intro Habs.
(* Goal: @Out Tn B C T' *)
    exfalso.
    assert(Hlta1 : LtA A B C A B C);
    [|destruct Hlta1 as [_ HNConga]; apply HNConga; apply conga_refl; auto].
(* Goal: @LtA Tn A B C A B C *)
    destruct Habs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    { apply (conga_preserves_lta A B C A' B C); try (apply conga_refl); auto.
(* Goal: @CongA Tn A' B C A B C *)
      apply conga_sym.
(* Goal: @CongA Tn A B C A' B C *)
      apply conga_comm.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
      apply l11_18_1; Perp.
    }
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (lta_trans _ _ _ A' B C); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply acute_obtuse__lta; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (bet_obtuse__acute A); auto.
Qed.

Lemma obtuse_chara : forall A B C A', Bet A B A' -> B <> A' -> (Obtuse A B C <-> LtA A' B C A B C).
Proof.
(* Goal: forall (A B C A' : @Tpoint Tn) (_ : @Bet Tn A B A') (_ : not (@eq (@Tpoint Tn) B A')), iff (@Obtuse Tn A B C) (@LtA Tn A' B C A B C) *)
  intros A B C A' HBet HBA'.
(* Goal: @LtA Tn A B P A B C *)
  split.
  - intro Hobtuse.
(* Goal: @LtA Tn A' B C A B C *)
    assert(Hdiff := obtuse_distincts A B C Hobtuse).
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply acute_obtuse__lta; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (bet_obtuse__acute A); auto.

  - intro Hlta.
(* Goal: @Lt Tn E F B C *)
    assert (Hd := Hlta).
(* Goal: @Lt Tn E F B C *)
    apply lta_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    elim(angle_partition A B C); auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    { intro.
(* Goal: @Out Tn B C T' *)
      exfalso.
      assert(Hlta1 : LtA A B C A B C);
      [|destruct Hlta1 as [_ HNConga]; apply HNConga; apply conga_refl; auto].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (lta_trans _ _ _ A' B C); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply acute_obtuse__lta; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (acute_bet__obtuse A); auto.
    }
(* Goal: forall _ : or (@Per Tn A B C) (@Obtuse Tn A B C), @Obtuse Tn A B C *)
    intro HUn.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    destruct HUn; auto.
(* Goal: @Out Tn B C T' *)
    exfalso.
    assert(Hlta1 : LtA A B C A B C);
    [|destruct Hlta1 as [_ HNConga]; apply HNConga; apply conga_refl; auto].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (conga_preserves_lta A' B C A B C); try (apply conga_refl); auto.
(* Goal: @CongA Tn A' B C A B C *)
    apply conga_sym.
(* Goal: @CongA Tn A B C A' B C *)
    apply conga_comm.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    apply l11_18_1; Between; Perp.
Qed.

Lemma conga__acute : forall A B C, CongA A B C A C B -> Acute A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @CongA Tn A B C A C B), @Acute Tn A B C *)
  intros A B C HCongA.
(* Goal: @Out Tn B P Q *)
  destruct (col_dec A B C).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { apply out__acute, not_bet_out; trivial.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    absurd (B = C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply conga_distinct in HCongA; spliter; auto.
(* Goal: @eq (@Tpoint Tn) B C *)
    apply between_equality with A; apply between_symmetry; trivial.
(* Goal: @CongA Tn D E F A B C *)
    apply (bet_conga__bet A B C); assumption.
  }
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
  destruct (segment_construction C B C B) as [C' []].
(* Goal: @LtA Tn F E D0 C B A0 *)
  apply conga_distinct in HCongA; spliter.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply acute_sym, acute_chara with C'; auto.
(* Goal: False *)
  destruct (l11_41 B C A C'); Col.
(* Goal: @LtA Tn C B A C' B A *)
  apply (conga_preserves_lta B C A A B C'); trivial.
(* Goal: @CongA Tn D E F A B C *)
    apply conga_comm, conga_sym; assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply conga_pseudo_refl; auto.
Qed.

Lemma cong__acute : forall A B C, A <> B -> B <> C -> Cong A B A C -> Acute A B C.
Proof.
(* Goal: @Cong Tn A' C' C' A' *)
  intros A B C HAB HBC HCong.
(* Goal: @Acute Tn A B C *)
  apply conga__acute.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Cong Tn A' C' C' A' *)
  destruct (l11_51 A B C A C B) as [_ []]; Cong.
Qed.


Lemma nlta : forall A B C, ~ LtA A B C A B C.
Proof.
(* Goal: forall A B C : @Tpoint Tn, not (@LtA Tn A B C A B C) *)
  intros A B C.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: False *)
  apply (not_and_lta A B C A B C).
(* Goal: @CongA Tn D E F A B C *)
  split; assumption.
Qed.

Lemma lea__nlta : forall A B C D E F, LeA A B C D E F -> ~ LtA D E F A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: not (@LtA Tn D E F A B C) *)
  intro Hlta.
(* Goal: False *)
  destruct Hlta as [Hlea HNConga].
(* Goal: False *)
  apply HNConga.
(* Goal: @CongA Tn D E F A B C *)
  apply lea_asym; assumption.
Qed.

Lemma lta__nlea : forall A B C D E F, LtA A B C D E F -> ~ LeA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LtA Tn A B C D E F), not (@LeA Tn D E F A B C) *)
  intros A B C D E F Hlta.
(* Goal: False *)
  destruct Hlta as [Hlea HNConga].
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: False *)
  apply HNConga.
(* Goal: @CongA Tn D E F A B C *)
  apply lea_asym; assumption.
Qed.

Lemma nlta__lea : forall A B C D E F, ~ LtA A B C D E F -> A <> B -> B <> C -> D <> E -> E <> F ->
   LeA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@LtA Tn A B C D E F)) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)), @LeA Tn D E F A B C *)
  intros A B C D E F HNlta.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @LeA Tn D E F A B C *)
  elim(conga_dec D E F A B C).
(* Goal: @LeA Tn A B C D E F *)
    apply conga__lea.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  elim(lea_total D E F A B C); auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: @Out Tn B C T' *)
  exfalso.
(* Goal: False *)
  apply HNlta.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  split; auto.
(* Goal: @CongA Tn D E F A B C *)
  apply not_conga_sym; assumption.
Qed.

Lemma nlea__lta : forall A B C D E F, ~ LeA A B C D E F  -> A <> B -> B <> C -> D <> E -> E <> F ->
   LtA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@LeA Tn A B C D E F)) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)), @LtA Tn D E F A B C *)
  intros A B C D E F HNlea.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  - elim(lea_total D E F A B C); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; exfalso; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: False *)
    apply HNlea.
(* Goal: @LeA Tn A B C D E F *)
    apply conga__lea.
(* Goal: @CongA Tn D E F A B C *)
    apply conga_sym; assumption.
Qed.


(** The following lemmas express the triangle inequality only with predicates from Tarski :
AC <= AB + BC, and AC = AB + BC <-> Bet A B C
 *)

Lemma triangle_strict_inequality : forall A B C D, Bet A B D -> Cong B C B D -> ~ Bet A B C ->
   Lt A C A D.
Proof.
  intros A B C D HBet HCong HNBet.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
    assert(A <> B) by (intro; Between).
    assert(B <> C) by (intro; Between).
(* Goal: False *)
    apply not_bet_out in HNBet; Col.
    destruct HNBet as [_ [_ [HBAC|HBCA]]].
(* Goal: @LtA Tn A B P A B C *)
    - split.
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
      { apply (le_transitivity _ _ B C).
(* Goal: @Cong Tn A' C' C' A' *)
        apply le_comm; exists A; split; Between; Cong.
(* Goal: @Cong Tn A' C' C' A' *)
        apply (l5_6 D B D A); Cong; exists B; split; Between; Cong.
      }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      assert(A = B); auto.
      apply between_symmetry in HBAC.
(* Goal: @Cong Tn A' C' C' A' *)
      apply (l7_17 C D); split; Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply (outer_transitivity_between _ _ B); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply (outer_transitivity_between2 _ A); auto.

    - assert(Bet A C D) by (apply (between_exchange4 _ _ B); Between).
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Cong Tn A' C' C' A' *)
        exists C; split; Cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      assert(C = D) by (apply (between_cong A); auto).
      subst D.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      assert(B = C); auto.
      apply (between_equality _ _ A); Between.
  }
(* Goal: False *)
  intro HNCol.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  assert(A <> D) by (intro; treat_equalities; auto).
  assert(~ Col A C D) by (intro; apply HNCol; ColR).
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  apply between_symmetry in HBet.
(* Goal: False *)
  apply l11_44_2; Col.
  assert(CongA C D A D C B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  { apply (out_conga C D B D C B); try (apply out_trivial); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    2: apply bet_out; auto.
(* Goal: @CongA Tn A B C A' B C *)
    apply conga_comm.
(* Goal: @Cong Tn A' C' C' A' *)
    apply l11_44_1; Cong.
    intro; apply HNCol; ColR.
  }
(* Goal: @LtA Tn A B P A B C *)
  split.
  - apply lea_comm.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
    exists B.
    repeat (split; auto).
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
    exists B.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    split; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    right; apply out_trivial; auto.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
    assert(Habs := conga_cop__or_out_ts D C A B).
    destruct Habs as [Hout|Hts].
(* Goal: False *)
      exists D; left; split; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (conga_trans _ _ _ C D A); auto; apply conga_sym; apply conga_comm; auto.
(* Goal: False *)
    apply HNCol; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    assert(~ TS D C A B); auto.
(* Goal: not (@TS Tn E G F D) *)
    apply l9_9_bis.
(* Goal: False *)
    apply out_one_side; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_6; apply bet_out; auto.
Qed.

Lemma triangle_inequality : forall A B C D, Bet A B D -> Cong B C B D -> Le A C A D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Bet Tn A B D) (_ : @Cong Tn B C B D), @Le Tn A C A D *)
  intros A B C D HCong HBet.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(bet_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: @Le Tn A C A D *)
    elim(eq_dec_points A B).
(* Goal: forall _ : @eq (@Tpoint Tn) A B, @Le Tn A C A D *)
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @Le Tn A C A D *)
      intro; subst; Le.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: @Le Tn A C A D *)
    assert(C = D).
(* Goal: @Cong Tn A' C' C' A' *)
    apply (construction_uniqueness A B B D); Cong.
(* Goal: @Le Tn A C A D *)
    subst; Le.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: @Le Tn A C A D *)
    assert(Hlt := triangle_strict_inequality A B C D).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    destruct Hlt; auto.
Qed.

Lemma triangle_strict_inequality_2 : forall A B C A' B' C',
   Bet A' B' C' -> Cong A B A' B' -> Cong B C B' C' -> ~ Bet A B C ->
   Lt A C A' C'.
Proof.
(* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @Bet Tn A' B' C') (_ : @Cong Tn A B A' B') (_ : @Cong Tn B C B' C') (_ : not (@Bet Tn A B C)), @Lt Tn A C A' C' *)
  intros A B C A' B' C' HBet HCongA HCongB HNBet.
(* Goal: @Le Tn A C A' C' *)
  destruct (segment_construction A B B C) as [D [HBetD HCongD]].
(* Goal: @Cong Tn A' C' C' A' *)
  apply (cong2_lt__lt A C A D); Cong.
(* Goal: @Cong Tn A' C' C' A' *)
    apply (triangle_strict_inequality _ B); Cong.
(* Goal: @Cong Tn A' C' C' A' *)
  apply (l2_11 _ B _ _ B'); Cong.
(* Goal: @Cong Tn B D B' C' *)
  apply cong_transitivity with B C; trivial.
Qed.

Lemma triangle_inequality_2 : forall A B C A' B' C',
   Bet A' B' C' -> Cong A B A' B' -> Cong B C B' C' ->
   Le A C A' C'.
Proof.
(* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @Bet Tn A' B' C') (_ : @Cong Tn A B A' B') (_ : @Cong Tn B C B' C'), @Le Tn A C A' C' *)
  intros A B C A' B' C' HBet HCongA HCongB.
(* Goal: @Le Tn A C A' C' *)
  destruct (segment_construction A B B C) as [D [HBetD HCongD]].
(* Goal: @Cong Tn A' C' C' A' *)
  apply (l5_6 A C A D); Cong.
(* Goal: @Cong Tn A' C' C' A' *)
    apply (triangle_inequality _ B); Cong.
(* Goal: @Cong Tn A' C' C' A' *)
  apply (l2_11 _ B _ _ B'); Cong.
(* Goal: @Cong Tn B D B' C' *)
  apply cong_transitivity with B C; trivial.
Qed.


(** The following lemmas express the reverse triangle inequality only with predicates from Tarski :
BC >= |AC - AB|, and BC = |AC - AB| <-> (A = B \/ A = C \/ Out A B C)
 *)

Lemma triangle_strict_reverse_inequality : forall A B C D,
  Out A B D -> Cong A C A D -> ~ Out A B C -> Lt B D B C.
Proof.
  intros A B C D HABD HCong HNout.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: False *)
    apply not_out_bet in HNout; Col.
    assert(Bet D A C) by (apply (l6_2 B); auto).
    assert(C <> D) by (intro; treat_equalities; auto).
(* Goal: @LtA Tn A B P A B C *)
    split.
    2: intro; assert(A = B); auto; apply (l7_17 D C); split; Cong; apply l7_20_bis; auto; ColR.
    destruct HABD as [_ [_ [HABD|HADB]]].
    - apply (le_transitivity _ _ A D).
(* Goal: @Cong Tn A' C' C' A' *)
        apply le_comm; exists B; split; Between; Cong.
(* Goal: @Cong Tn A' C' C' A' *)
      apply (l5_6 C A C B); Cong.
(* Goal: @Cong Tn A' C' C' A' *)
      exists A; split; Between; Cong.

(* Goal: @LeA Tn G E D G E F *)
    - exists D.
(* Goal: @Cong Tn A' C' C' A' *)
      split; Cong.
      apply (outer_transitivity_between _ _ A); Between.
  }
(* Goal: False *)
  intro HNCol.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  elim(eq_dec_points B D).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: False *)
    subst.
    split; Le.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    intro; treat_equalities; auto.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  assert(HNCol2 : ~ Col B C D) by (intro; apply HNCol; ColR).
  assert(HNCol3 : ~ Col A C D) by (intro; apply HNCol; ColR).
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: False *)
  apply l11_44_2; Col.
  assert(CongA A C D A D C) by (apply l11_44_1; Cong; Col).
  destruct HABD as [_ [_ [HABD|HADB]]].
  - apply between_symmetry in HABD.
    apply (conga_preserves_lta D C B D C A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply conga_pseudo_refl; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (out_conga D C A A D C); try (apply out_trivial); try (apply conga_left_comm); auto; apply l6_6; apply bet_out; auto.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { exists B.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      split; try (apply conga_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
      exists B.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      split; auto.
      right; finish.
    }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(~ TS D C B A).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { apply l9_9_bis.
(* Goal: False *)
      apply out_one_side; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply bet_out; auto.
    }
    assert(Habs := conga_cop__or_out_ts D C B A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    destruct Habs as [Hout|Hts]; auto.
(* Goal: False *)
      exists D; left; split; Col.
(* Goal: False *)
    apply HNCol; Col.

  - assert(HE := symmetric_point_construction B C).
    destruct HE as [E []].
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    apply (bet2_lta__lta A _ _ E); Between.
    assert (OS D C A E).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { exists B.
(* Goal: False *)
        repeat split; Col.
(* Goal: False *)
        exists D; Col.
        intro; apply HNCol2; ColR.
        exists C; split; finish.
    }
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (conga_preserves_lta A C D E C D); try (apply conga_refl); auto.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { apply lea_comm.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      exists A.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      2: apply conga_refl; auto.
(* Goal: @InAngle Tn P A B C *)
      apply os2__inangle; Side.
(* Goal: False *)
      apply (col_one_side _ B); Col.
(* Goal: @OS Tn F D G G0 *)
      apply invert_one_side.
(* Goal: False *)
      apply out_one_side; Col.
      apply bet_out; Between.
    }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    assert(Habs := conga_cop__or_out_ts D C A E).
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    destruct Habs as [Hout|Hts]; try (apply conga_comm); Cop.
      apply HNCol; ColR.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      assert(~ TS D C A E); try (apply l9_9_bis); auto.
Qed.

Lemma triangle_reverse_inequality : forall A B C D, Out A B D -> Cong A C A D -> Le B D B C.
Proof.
(* Goal: @Cong Tn A' C' C' A' *)
  intros A B C D HABD HCong.
  elim(out_dec A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  2: apply triangle_strict_reverse_inequality; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  assert(C = D) by (apply (l6_11_uniqueness A A C B); Cong; apply l6_6; auto).
(* Goal: @Le Tn A C A D *)
  subst; Le.
Qed.

(** This is half of Euclid Book I, Proposition 21:
  if D is inside the triangle ABC then BAC < BDC.
 *)

Lemma os3__lta : forall A B C D, OS A B C D -> OS B C A D -> OS A C B D ->
   LtA B A C B D C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @OS Tn A B C D) (_ : @OS Tn B C A D) (_ : @OS Tn A C B D), @LtA Tn B A C B D C *)
  intros A B C D HosC HosA HosB.
(* Goal: @LtA Tn B A C B D C *)
  assert(HE : InAngle D A B C) by (apply os2__inangle; Side).
(* Goal: @LtA Tn B A C B D C *)
  destruct HE as [_ [_ [_ [E [HEBet HUn]]]]].
(* Goal: @LtA Tn B A C B D C *)
  assert(HNCol : ~ Col A B C) by (apply (one_side_not_col123 _ _ _ D); auto).
(* Goal: @LtA Tn B A C B D C *)
  assert_ncols.
(* Goal: @LtA Tn B A C B D C *)
  destruct HUn as [|HBout].
(* Goal: False *)
    exfalso; subst; Col.
(* Goal: @LtA Tn B A C B D C *)
  assert(A <> E) by (intro; subst; assert_cols; Col).
(* Goal: @LtA Tn B A C B D C *)
  assert(C <> E) by (intro; subst; assert_cols; Col).
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @LtA Tn B A C B D C *)
  apply (lta_trans _ _ _ B E C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  - destruct (l11_41 E A B C); auto.
      intro; apply HNCol; ColR.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (conga_preserves_lta E A B B E C); try (apply conga_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (out_conga E A B B A E); try (apply out_trivial); try (apply conga_pseudo_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply bet_out; auto.

  - assert(Out E D B).
(* Goal: @Out Tn E D B *)
(* Goal: @LtA Tn B E C B D C *)
      apply (col_one_side_out _ A); Col; apply invert_one_side; apply (col_one_side _ C); Col; Side.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    destruct (l11_41 D E C B); auto.
      intro; apply HNCol; ColR.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply out2__bet; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (conga_preserves_lta D E C C D B); try (apply conga_pseudo_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (out_conga D E C D E C); try (apply out_trivial); try (apply conga_refl); auto.
Qed.

(** This is Theorem 18.17 from Martin *)

Lemma bet_le__lt : forall A B C D, Bet A D B -> A <> D -> D <> B -> Le A C B C -> Lt D C B C.
Proof.
  intros A B C D HBet HAD HBD Hle.
  assert(HAB : B <> A) by (intro; treat_equalities; auto).
(* Goal: @Lt Tn A' C0 A' C' *)
  apply lt_comm.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
    elim(bet_dec C D B).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    { intro.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Cong Tn A' C' C' A' *)
      exists D; Cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      apply HBD.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (between_cong C); auto.
    }
    intro HNBet.
    apply not_bet_out in HNBet; try ColR.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    assert(Bet C D A) by (apply (l6_2 B); try (apply l6_6); Between).
    assert(A <> C) by (intro; treat_equalities; auto).
    assert(Hout : Out A C B) by (apply (l6_7 _ _ D); [apply l6_6|]; apply bet_out; Between).
    assert(~ Bet A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    { intro.
      apply HAB.
      apply (between_cong C); Between.
      apply le_anti_symmetry; Le.
    }
    destruct Hout as [_ [_ [HACB|]]].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    2: exfalso; auto.
    assert(B <> C) by (intro; subst; Between).
    assert(HC' := symmetric_point_construction A C).
    destruct HC' as [C'].
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    assert(Bet C C' B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { apply l6_13_1.
      apply (l6_2 _ _ A); Between.
(* Goal: @Cong Tn A' C' C' A' *)
      apply (l5_6 A C B C); Cong.
    }
    apply (le3456_lt__lt _ _ C A).
    2: exists C'; split;auto with cong.
(* Goal: @LtA Tn A B P A B C *)
    split.
    exists D; auto with cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
    apply HAD.
    symmetry.
    apply (between_cong C); Between.
  }
(* Goal: False *)
  intro HNCol.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  apply l11_44_2.
    intro; apply HNCol; ColR.
  apply (lea123456_lta__lta _ _ _ C A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  - apply (l11_30 C B A C A B); try apply (conga_refl); auto.
    2: apply (out_conga C B D C B D); try apply (out_trivial); try (apply conga_refl); auto; apply bet_out; Between.
    elim (cong_dec A C B C).
(* Goal: @Cong Tn A' C' C' A' *)
      intro; apply conga__lea; apply l11_44_1; Col; Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      intro; apply lta__lea; apply l11_44_2; Col; apply lt_comm; split; auto.

  - assert(~ Col D A C) by (intro; apply HNCol; ColR).
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    assert(HInter := l11_41 D A C B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    destruct HInter; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (conga_preserves_lta D A C C D B); try (apply conga_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (out_conga D A C C A D); try (apply out_trivial); try (apply conga_pseudo_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply bet_out; auto.
Qed.

Lemma t18_18_aux : forall A B C D E F,
  Cong A B D E -> Cong A C D F -> LtA F D E C A B -> ~ Col A B C -> ~ Col D E F -> Le D F D E ->
  Lt E F B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Cong Tn A B D E) (_ : @Cong Tn A C D F) (_ : @LtA Tn F D E C A B) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn D E F)) (_ : @Le Tn D F D E), @Lt Tn E F B C *)
  intros A B C D E F HCongAB HCongAC Hlta HNCol1 HNCol2 Hle.
(* Goal: @Lt Tn E F B C *)
  assert (Hd := Hlta).
(* Goal: @Lt Tn E F B C *)
  apply lta_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Lt Tn E F B C *)
  assert(HG0 := angle_construction_1 C A B F D E).
(* Goal: False *)
  destruct HG0 as [G0 []]; Col.
(* Goal: @Lt Tn E F B C *)
  assert(~ Col F D G0) by (apply (one_side_not_col123 _ _ _ E); auto).
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Lt Tn E F B C *)
  assert(HG := segment_construction_3 D G0 A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct HG as [G []]; auto.
(* Goal: @Lt Tn E F B C *)
  assert(CongA C A B F D G) by (apply (out_conga C A B F D G0); try (apply out_trivial); auto).
(* Goal: @Lt Tn E F B C *)
  assert(OS F D G E).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  { apply (one_side_transitivity _ _ _ G0); auto.
(* Goal: @OS Tn F D G G0 *)
    apply invert_one_side.
(* Goal: False *)
    apply out_one_side; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_6; auto.
  }
(* Goal: @Lt Tn E F B C *)
  assert(HNCol3 : ~ Col F D G) by (apply (one_side_not_col123 _ _ _ E); auto).
(* Goal: @Lt Tn E F B C *)
  clear dependent G0.

(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Lt Tn E F B C *)
  assert(HSAS := l11_49 C A B F D G).
(* Goal: @Cong Tn A' C' C' A' *)
  destruct HSAS as [HCongBC _]; Cong.
(* Goal: @Cong Tn A' C' C' A' *)
  apply (cong2_lt__lt F E F G); Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (conga_preserves_lta _ _ _ _ _ _ F D E F D G) in Hlta; try (apply conga_refl); auto.
(* Goal: @Lt Tn F E F G *)
  assert(Cong D G D E) by (apply (cong_transitivity _ _ A B); auto).
(* Goal: @Lt Tn F E F G *)
  clear dependent A.
(* Goal: @Lt Tn F E F G *)
  clear dependent B.

(* Goal: @Lt Tn F E F G *)
  assert(~ Col E F G).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: False *)
    destruct Hlta as [Hlea HNConga].
(* Goal: False *)
    apply HNConga.
(* Goal: @CongA Tn F D E F D G *)
    assert (HSSA := l11_52 E F D G F D).
(* Goal: @CongA Tn F D E F D G *)
    destruct HSSA as [_[]]; Cong; Le.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (out_conga G F D G F D); try (apply out_trivial); try (apply conga_refl); auto.
(* Goal: False *)
    apply (col_one_side_out _ D); Col.
  }
(* Goal: @Lt Tn F E F G *)
  assert(~ Col D E G).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
(* Goal: False *)
    destruct Hlta as [Hlea HNConga].
(* Goal: False *)
    apply HNConga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (out_conga F D G F D G); try (apply out_trivial); try (apply conga_refl); auto.
(* Goal: @Out Tn D G E *)
    apply (col_one_side_out _ F); Col; Side.
  }
(* Goal: False *)
  apply l11_44_2; Col.
(* Goal: @LtA Tn F G E F E G *)
  assert(HInAngle : InAngle E F D G) by (apply lea_in_angle; destruct Hlta; auto).
(* Goal: @LtA Tn F G E F E G *)
  rename H into HFD.
(* Goal: @LtA Tn F G E F E G *)
  destruct HInAngle as [_ [_ [_ [H [HH HUn]]]]].
(* Goal: @LtA Tn F G E F E G *)
  destruct HUn.
(* Goal: False *)
    exfalso; subst; Col.
(* Goal: @LtA Tn F G E F E G *)
  assert(H <> F) by (intro; subst; assert_cols; Col).
(* Goal: @LtA Tn F G E F E G *)
  assert(H <> G) by (intro; subst; assert_cols; Col).
(* Goal: @LtA Tn F G E F E G *)
  assert(Hlt : Lt D H D E).
(* Goal: @Cong Tn A' C' C' A' *)
  { apply (cong2_lt__lt H D G D); Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (bet_le__lt F); auto.
(* Goal: @Cong Tn A' C' C' A' *)
    apply (l5_6 D F D E); Cong.
  }
(* Goal: @LtA Tn F G E F E G *)
  destruct Hlt.
(* Goal: @LtA Tn F G E F E G *)
  assert(H <> E) by (intro; subst; Cong).
(* Goal: @LtA Tn F G E F E G *)
  assert(Bet D H E) by (apply l6_13_1; Le).
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @LtA Tn F G E F E G *)
  assert(~ TS E G F D).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { apply l9_9_bis.
    apply (one_side_transitivity _ _ _ H);
    [apply invert_one_side; apply one_side_symmetry|];
    apply out_one_side; Col;
    apply bet_out; Between.
  }
(* Goal: @LtA Tn F G E F E G *)
  apply (lta_trans _ _ _ D E G).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  - apply(conga_preserves_lta F G E D G E); try (apply conga_refl); auto.
(* Goal: False *)
      apply l11_44_1; Col.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { apply lea_comm.
(* Goal: @LeA Tn E G F E G D *)
      exists F.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      split; try (apply conga_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn G X F) (or (@eq (@Tpoint Tn) X E) (@Out Tn E X D))) *)
      exists H.
(* Goal: and (@Bet Tn G H F) (or (@eq (@Tpoint Tn) H E) (@Out Tn E H D)) *)
      split; Between.
      right; apply bet_out; Between.
    }
(* Goal: not (@CongA Tn G E D G E F) *)
    intro HConga.
(* Goal: False *)
    apply conga_comm in HConga.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    assert (HCop : Coplanar E G F D) by Cop.
(* Goal: False *)
    assert(Habs := conga_cop__or_out_ts E G F D HCop HConga).
(* Goal: False *)
    destruct Habs as [Hout|Hts]; assert_cols; Col.

(* Goal: @LtA Tn D E G F E G *)
  - apply lta_comm.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { exists D.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      split; try (apply conga_refl); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn G X F) (or (@eq (@Tpoint Tn) X E) (@Out Tn E X D))) *)
      exists H.
(* Goal: and (@Bet Tn G H F) (or (@eq (@Tpoint Tn) H E) (@Out Tn E H D)) *)
      split; Between.
      right; apply bet_out; Between.
    }
(* Goal: not (@CongA Tn G E D G E F) *)
    intro HConga.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    assert (HCop : Coplanar G E D F) by Cop.
(* Goal: False *)
    assert(Habs := conga_cop__or_out_ts G E D F HCop HConga).
(* Goal: False *)
    destruct Habs as [Hout|Hts]; assert_cols; Col; Side.
Qed.

(** This is Euclid Book I, Proposition 24. *)

Lemma t18_18 : forall A B C D E F, Cong A B D E -> Cong A C D F -> LtA F D E C A B -> Lt E F B C.
Proof.
  intros A B C D E F HCongAB HCongAC Hlta.
(* Goal: @Lt Tn E F B C *)
  assert (Hd := Hlta).
(* Goal: @Lt Tn E F B C *)
  apply lta_distincts in Hd.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim(col_dec A B C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
    elim(bet_dec B A C).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    - intro.
      assert(HC' := segment_construction E D A C).
      destruct HC' as [C' []].
(* Goal: @Cong Tn A' C' C' A' *)
      apply (cong2_lt__lt E F E C'); Cong.
(* Goal: @Cong Tn A' C' C' A' *)
      2: apply (l2_11 _ D _ _ A); Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (triangle_strict_inequality _ D); auto.
(* Goal: @Cong Tn A' C' C' A' *)
      apply (cong_transitivity _ _ A C); Cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
      intro.
      destruct Hlta as [_ HNConga].
(* Goal: False *)
      apply HNConga.
      apply conga_line; Between.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    - intro.
(* Goal: @Out Tn B C T' *)
      exfalso.
      apply (nlta C A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (lea123456_lta__lta _ _ _ F D E); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l11_31_1; auto.
      apply not_bet_out; Col; Between.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  elim(col_dec D E F).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  { intro.
    elim(bet_dec F D E).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    - intro.
(* Goal: @Out Tn B C T' *)
      exfalso.
      apply (nlta F D E).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (lea456789_lta__lta _ _ _ C A B); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l11_31_2; auto.

    - intro HNBet.
(* Goal: False *)
      apply not_bet_out in HNBet; Col.
      assert(HF' := segment_construction_3 A B A C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      destruct HF' as [F' []]; auto.
(* Goal: @Cong Tn A' C' C' A' *)
      apply (cong2_lt__lt B F' B C); Cong.
(* Goal: @Cong Tn A' C' C' A' *)
      { apply (triangle_strict_reverse_inequality A); Cong.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
        intro.
        destruct Hlta as [_ HNConga].
(* Goal: False *)
        apply HNConga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply l11_21_b; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply l6_6; auto.
      }
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (out_cong_cong A _ _ D); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l6_6; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply (cong_transitivity _ _ A C); auto.
  }
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  elim(le_cases D F D E); intro; [|apply lt_comm; apply lta_comm in Hlta];
(* Goal: False *)
  apply (t18_18_aux A _ _ D); Cong; Col.
Qed.

Lemma t18_19 : forall A B C D E F, A <> B -> A <> C -> Cong A B D E -> Cong A C D F -> Lt E F B C ->
   LtA F D E C A B.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A C)) (_ : @Cong Tn A B D E) (_ : @Cong Tn A C D F) (_ : @Lt Tn E F B C), @LtA Tn F D E C A B *)
  intros A B C D E F HAB HAC HCongAB HCongAC Hlt.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply nlea__lta; auto.
(* Goal: not (@LeA Tn C A B F D E) *)
  intro Hlea.
(* Goal: False *)
  elim(conga_dec C A B F D E).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: @Out Tn B C T' *)
    exfalso.
(* Goal: False *)
    destruct Hlt as [Hle HNCong].
(* Goal: @Cong Tn A' C' C' A' *)
    apply HNCong.
(* Goal: @Cong Tn E F B C *)
    assert(HSAS := l11_49 C A B F D E).
(* Goal: @Cong Tn A' C' C' A' *)
    destruct HSAS; Cong.

(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  - intro.
(* Goal: False *)
    apply (not_and_lt E F B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    split; auto.
(* Goal: @Cong Tn A' C' C' A' *)
    apply (t18_18 D _ _ A); Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    split; auto.
Qed.

Lemma acute_trivial : forall A B, A <> B -> Acute A B A.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: @Acute Tn A B A *)
    assert(HH:= not_col_exists A B H).
(* Goal: @Acute Tn A B A *)
    ex_and HH P.
(* Goal: @Acute Tn A B A *)
    assert(exists C : Tpoint, Per C B A /\ Cong C B A B /\ OS A B C P).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      apply(ex_per_cong A B B P A B H H); Col; exists A.
(* Goal: @Acute Tn A B A *)
    ex_and H1 C.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @Acute Tn A B A *)
    unfold Acute.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
    exists A.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Per Tn A B' C') (@LtA Tn A B A A B' C'))) *)
    exists B.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
    exists C.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @Per Tn A B C *)
(* Goal: @LtA Tn A B A A B C *)
      apply l8_2.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: @LtA Tn A B A A B C *)
    unfold LtA.
(* Goal: @LtA Tn A B P A B C *)
    split.
(* Goal: @LeA Tn A B A A B C *)
(* Goal: not (@CongA Tn A B A A B C) *)
      unfold LeA.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn A B A A B P)) *)
(* Goal: not (@CongA Tn A B A A B C) *)
      exists A.
(* Goal: @LtA Tn A B P A B C *)
      split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply inangle1123; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply conga_refl; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    assert(Out B A C).
(* Goal: @Out Tn B A C *)
(* Goal: False *)
      apply(l11_21_a A B A A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply out_trivial; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: False *)
    assert(Perp C B B A).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply per_perp_in in H1; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply perp_in_perp_bis in H1.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      induction H1.
(* Goal: @Perp Tn C B B A *)
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply perp_not_eq_1 in H1.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        tauto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      auto.
(* Goal: False *)
    apply perp_comm in H10.
(* Goal: False *)
    apply perp_not_col in H10.
(* Goal: False *)
    apply out_col in H8.
(* Goal: False *)
    Col.
Qed.

Lemma acute_not_per : forall A B C, Acute A B C -> ~ Per A B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
    intros.
(* Goal: not (@Per Tn A B C) *)
    unfold Acute in H.
(* Goal: not (@Per Tn A B C) *)
    ex_and H A'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H0 B'.
(* Goal: not (@Per Tn A B C) *)
    ex_and H C'.
(* Goal: not (@Per Tn A B C) *)
    unfold LtA in H0.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
    apply H1.
(* Goal: @CongA Tn A B C A' B' C' *)
    assert(A <> B /\ C <> B /\ A' <> B' /\ C' <> B').
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
      unfold LeA in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) A' B')) (not (@eq (@Tpoint Tn) C' B')))) *)
(* Goal: @CongA Tn A B C A' B' C' *)
      ex_and H0 X.
(* Goal: @CongA Tn C B A' C B A'' *)
      apply conga_distinct in H3.
(* Goal: @LtA Tn F E D0 C B A0 *)
      spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) C' B') *)
(* Goal: @CongA Tn A B C A' B' C' *)
      unfold InAngle in H0.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      spliter; auto.
(* Goal: @LtA Tn F E D0 C B A0 *)
    spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply(l11_16 A B C A' B' C'); auto.
Qed.

Lemma angle_bisector : forall A B C, A <> B -> C <> B ->
  exists P, InAngle P A B C /\ CongA P B A P B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) C B)), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  intros A B C HAB HCB.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  elim (col_dec A B C).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { intro HCol.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
    elim (bet_dec A B C).
    - intro HBet; destruct (not_col_exists A B) as [Q HNCol]; trivial.
(* Goal: False *)
      destruct (l10_15 A B B Q) as [P [HPerp HOS]]; Col.
(* Goal: @LtA Tn A B P A B C *)
      assert_diffs; exists P; split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply in_angle_line; auto.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
      apply l11_18_1; Perp.
(* Goal: @SuppA Tn A B C A B B' *)
    - intro HOut; apply not_bet_out in HOut; trivial; assert_diffs.
(* Goal: @LtA Tn A B P A B C *)
      exists C; split.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        repeat split; auto.
(* Goal: and (@Bet Tn G H F) (or (@eq (@Tpoint Tn) H E) (@Out Tn E H D)) *)
       exists C; split; Between.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        right; apply out_trivial; auto.
(* Goal: @CongA Tn C B A C B C *)
      apply l11_21_b.
(* Goal: @Out Tn B C A *)
(* Goal: @Out Tn B C C *)
        apply l6_6; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply out_trivial; auto.
  }
(* Goal: False *)
  intro HNCol.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (l6_11_existence B B A C) as [C0 [HOut HCong]]; auto.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  destruct (midpoint_existence A C0) as [P HP].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@InAngle Tn P A B C) (@CongA Tn P B A P B C)) *)
  exists P.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn P B A P B C) *)
  assert (HNCol1 : ~ Col A B C0) by (intro; apply HNCol; ColR).
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn P B A P B C) *)
  assert (P <> B) by (intro; subst P; apply HNCol1; Col).
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @InAngle Tn P A B C *)
(* Goal: @CongA Tn P B A P B C *)
    apply (l11_25 P A B C0); try (apply out_trivial); auto; [|apply l6_6; trivial].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    repeat split; auto.
(* Goal: and (@Bet Tn G H F) (or (@eq (@Tpoint Tn) H E) (@Out Tn E H D)) *)
    exists P; split; Between.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    right; apply out_trivial; auto.
  destruct (l11_51 B P A B P C0); auto with cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (out_conga P B A P B C0); try (apply out_trivial); auto.
Qed.

Lemma reflectl__conga : forall A B P P', A <> B -> B <> P -> ReflectL P P' A B -> CongA A B P A B P'.
Proof.
(* Goal: forall (A B P P' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B P)) (_ : @ReflectL Tn P P' A B), @CongA Tn A B P A B P' *)
  intros A B P P' HAB HBP HRefl.
(* Goal: @CongA Tn A B P A B P' *)
  destruct HRefl as [[A' [HMid HCol]] [HPerp|Heq]]; [|subst; apply conga_refl; auto].
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @CongA Tn A B P A B P' *)
  destruct (eq_dec_points A' B).
(* Goal: @CongA Tn A B P A B P' *)
(* Goal: @CongA Tn A B P A B P' *)
    subst A'.
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
    apply l11_16; auto; apply perp_per_1;
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    [apply perp_col1 with P'|apply perp_col1 with P]; Col; Perp.
(* Goal: @CongA Tn A B P A B P' *)
  destruct HMid as [HBet HCong].
(* Goal: @Cong Tn A' C' C' A' *)
  destruct (l11_49 B A' P B A' P') as [HCong1 [HConga1 HConga2]]; Cong.
    apply l11_16; auto;
    apply perp_per_1, perp_left_comm, perp_col with A; Col;
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
    [apply perp_col1 with P'|apply perp_col1 with P]; Col; Perp.
(* Goal: @CongA Tn A B P A B P' *)
  destruct (bet_dec A' B A) as [HBBet|HBOut].
(* Goal: @CongA Tn D E F A B C *)
    apply l11_13 with A' A'; assumption.
(* Goal: False *)
  apply not_bet_out in HBOut; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply out_conga with A' P A' P'; trivial; apply out_trivial; assert_diffs; auto.
Qed.

Lemma conga_cop_out_reflectl__out : forall A B C P T T',
  ~ Out B A C -> Coplanar A B C P -> CongA P B A P B C -> Out B A T -> ReflectL T T' B P ->
  Out B C T'.
Proof.
(* Goal: forall (A B C P T T' : @Tpoint Tn) (_ : not (@Out Tn B A C)) (_ : @Coplanar Tn A B C P) (_ : @CongA Tn P B A P B C) (_ : @Out Tn B A T) (_ : @ReflectL Tn T T' B P), @Out Tn B C T' *)
  intros A B C P T T' HNOut HCop HConga HOut HRefl.
(* Goal: @Out Tn B C T' *)
  apply conga_distinct in HConga; spliter; clean.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Out Tn B C T' *)
  assert (HConga1 : CongA P B T P B T') by (apply reflectl__conga; auto; apply is_image_spec_rev, HRefl).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply is_image_is_image_spec in HRefl; auto.
(* Goal: @Out Tn B C T' *)
  apply conga_distinct in HConga1; spliter; clean.
(* Goal: @Out Tn B C T' *)
  destruct (conga_cop__or_out_ts P B C T'); trivial.
  - apply coplanar_trans_1 with T; [..|Cop].
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    { intro.
(* Goal: False *)
      apply HNOut.
      assert (HCol : Col A B P) by ColR.
(* Goal: @Out Tn B A C *)
      destruct (bet_dec A B P) as [HBet|HOut1].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
        apply l6_2 with P; auto.
(* Goal: @CongA Tn D E F A B C *)
        apply (bet_conga__bet A B P); [|apply conga_comm]; assumption.
(* Goal: @Out Tn B A C *)
      apply not_bet_out in HOut1; trivial.
(* Goal: @Out Tn B A C *)
      apply l6_7 with P; trivial.
(* Goal: @CongA Tn D E F A B C *)
      apply (l11_21_a P B A); [apply l6_6|]; assumption.
    }
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    apply coplanar_perm_19, col_cop__cop with A; Col; Cop.
  - apply conga_trans with P B A.
(* Goal: @CongA Tn D E F A B C *)
    apply conga_sym; assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_6 in HOut; apply out_conga with P T P T'; try (apply out_trivial); auto.
(* Goal: @Out Tn B C T' *)
  - exfalso.
(* Goal: False *)
    apply (l9_9_bis P B C T'); trivial.
    exists A; split; apply l9_2.
(* Goal: @Out Tn O B C *)
      destruct (conga_cop__or_out_ts P B A C); Cop; contradiction.
(* Goal: False *)
    apply out_two_sides_two_sides with T B; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply invert_two_sides, l10_14; auto.
    intro; subst T'.
(* Goal: False *)
    apply HNOut.
(* Goal: @Out Tn B A C *)
    assert (Col T B P) by (apply l10_8, HRefl).
    assert (Col P B A) by ColR.
(* Goal: False *)
(* Goal: @Acute Tn P B Q *)
    assert (Col P B C) by (apply (col_conga_col P B A); assumption).
    apply not_bet_out; try ColR.
(* Goal: not (@Bet Tn A B C) *)
    intro HBet.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply (per_not_col P B A); auto.
(* Goal: @CongA Tn D E F A B C *)
    apply l11_18_2 with C; assumption.
Qed.

Lemma col_conga_cop_reflectl__col : forall A B C P T T',
  ~ Out B A C -> Coplanar A B C P -> CongA P B A P B C -> Col B A T -> ReflectL T T' B P ->
  Col B C T'.
Proof.
(* Goal: forall (A B C P T T' : @Tpoint Tn) (_ : not (@Out Tn B A C)) (_ : @Coplanar Tn A B C P) (_ : @CongA Tn P B A P B C) (_ : @Col Tn B A T) (_ : @ReflectL Tn T T' B P), @Col Tn B C T' *)
  intros A B C P T T' HNOut HCop HConga HCol HRefl.
(* Goal: @Col Tn B C T' *)
  destruct (eq_dec_points B T).
(* Goal: False *)
    subst; assert (T = T'); subst; Col.
(* Goal: False *)
    apply (l10_6_uniqueness_spec T P T); trivial; apply col__refl; Col.
(* Goal: @Col Tn B C T' *)
  destruct (out_dec B A T).
(* Goal: @CongA Tn D E F A B C *)
    apply out_col, conga_cop_out_reflectl__out with A P T; assumption.
(* Goal: @Col Tn B C T' *)
  destruct (segment_construction A B A B) as [A' [HA'1 HA'2]].
(* Goal: @Col Tn B C T' *)
  destruct (segment_construction C B C B) as [C' [HC'1 HC'2]].
  assert (Out B C' T'); try ColR.
(* Goal: @SuppA Tn A B C A B B' *)
  apply conga_distinct in HConga; spliter; assert_diffs.
(* Goal: @Out Tn B C' T' *)
  apply conga_cop_out_reflectl__out with A' P T; trivial.
  - intro; apply HNOut.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_2 with A'; auto.
(* Goal: @Bet Tn C B A' *)
    apply between_symmetry, l6_2 with C'; try (apply l6_6); Between.
(* Goal: @Out Tn B P Q *)
  - destruct (col_dec A B C).
      exists C'; left; split; ColR.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    apply coplanar_pseudo_trans with A B C; Cop.
(* Goal: @CongA Tn D E F A B C *)
  - apply conga_comm, l11_13 with A C; auto; apply conga_comm; assumption.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  - apply l6_2 with A; try (apply between_symmetry); auto.
(* Goal: False *)
    apply not_out_bet; Col.
Qed.

Lemma conga2_cop2__col : forall A B C P P', ~ Out B A C ->
  CongA P B A P B C -> CongA P' B A P' B C ->
  Coplanar A B P P' -> Coplanar B C P P' ->
  Col B P P'.
Proof.
(* Goal: forall (A B C P P' : @Tpoint Tn) (_ : not (@Out Tn B A C)) (_ : @CongA Tn P B A P B C) (_ : @CongA Tn P' B A P' B C) (_ : @Coplanar Tn A B P P') (_ : @Coplanar Tn B C P P'), @Col Tn B P P' *)
  intros A B C P P' HNOut HP HP' HCopA HCopC.
(* Goal: @Col Tn B P P' *)
  apply conga_distinct in HP; apply conga_distinct in HP'; spliter; clean.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  destruct (l6_11_existence B B A C) as [C' [HC'1 HC'2]]; auto.
(* Goal: @Cong Tn A' C' C' A' *)
  destruct (l11_49 P B A P B C'); Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with P A P C; try (apply out_trivial); try (apply l6_6); auto.
(* Goal: @Cong Tn A' C' C' A' *)
  destruct (l11_49 P' B A P' B C'); Cong.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with P' A P' C; try (apply out_trivial); try (apply l6_6); auto.
(* Goal: @Cong Tn A' C' C' A' *)
  apply cong3_cop2__col with A C'; Cong.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    Cop.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    apply coplanar_perm_12, col_cop__cop with C; Col; Cop.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  intro; subst; auto.
Qed.

Lemma conga2_cop2__col_1 : forall A B C P P', ~ Col A B C ->
  CongA P B A P B C -> CongA P' B A P' B C ->
  Coplanar A B C P -> Coplanar A B C P' ->
  Col B P P'.
Proof.
(* Goal: forall (A B C P P' : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @CongA Tn P B A P B C) (_ : @CongA Tn P' B A P' B C) (_ : @Coplanar Tn A B C P) (_ : @Coplanar Tn A B C P'), @Col Tn B P P' *)
  intros A B C P P' HNCol HP HP' HCop HCop'.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  apply conga2_cop2__col with A C; trivial; [|apply coplanar_pseudo_trans with A B C; Cop..].
(* Goal: False *)
  intro; apply HNCol; Col.
Qed.

Lemma col_conga__conga : forall A B C P P', CongA P B A P B C -> Col B P P' -> B <> P' ->
  CongA P' B A P' B C.
Proof.
(* Goal: forall (A B C P P' : @Tpoint Tn) (_ : @CongA Tn P B A P B C) (_ : @Col Tn B P P') (_ : not (@eq (@Tpoint Tn) B P')), @CongA Tn P' B A P' B C *)
  intros A B C P P' HConga HCol HBP'.
(* Goal: @CongA Tn P' B A P' B C *)
  destruct (bet_dec P B P') as [HBet|HNBet].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_13 with P P; auto.
(* Goal: False *)
  apply not_bet_out in HNBet; Col.
(* Goal: @LtA Tn F E D0 C B A0 *)
  apply conga_distinct in HConga; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply out_conga with P A P C; try (apply out_trivial); auto.
Qed.

Lemma cop_inangle__ex_col_inangle : forall A B C P Q,
  ~ Out B A C -> InAngle P A B C -> Coplanar A B C Q ->
  exists R, InAngle R A B C /\ P <> R /\ Col P Q R.
Proof.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  intros A B C P Q HNOut HIn HCop.
(* Goal: @LtA Tn F E D0 C B A0 *)
  assert (h := inangle_distincts A B C P HIn); spliter.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
  assert (A <> C) by (intro; subst; apply HNOut, out_trivial; auto).
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
  destruct (eq_dec_points P Q).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { subst Q.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P P R))) *)
    destruct (eq_dec_points A P).
(* Goal: False *)
      subst P; exists C; split; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply inangle3123; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    exists A; split; Col; apply inangle1123; auto.
  }
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
  destruct (col_dec B P Q) as [HCol|HNCol1].
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { destruct (segment_construction B P B P) as [R [HR1 HR2]].
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    exists R.
(* Goal: and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R)) *)
    assert_diffs; split; [|split; ColR].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_25 with P A C; try (apply out_trivial); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_6, bet_out; auto.
  }
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
  destruct (col_dec A B C) as [HCol|HNCol2].
(* Goal: False *)
    exists Q; split; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply in_angle_line; auto.
(* Goal: @CongA Tn D E F A B C *)
    apply not_out_bet; assumption.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
  destruct (col_dec B C P) as [HCol|HNCol3].
  - assert (HNCol3 : ~ Col B A P) by (intro; apply HNCol2; ColR).
(* Goal: False *)
    destruct (cop_not_par_same_side B P Q P P A) as [Q0 [HCol1 HOS]]; Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      apply coplanar_perm_16, col_cop__cop with C; Cop.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    assert (Hd := os_distincts B P A Q0 HOS); spliter; clean.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    destruct (one_side_dec B A P Q0).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { assert (HIn' : InAngle Q0 A B P) by (apply os2__inangle; assumption).
(* Goal: False *)
      exists Q0; split; Col.
(* Goal: @InAngle Tn Q0 A B C *)
      apply in_angle_trans with P; trivial.
    }
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    assert (HR : exists R, Bet P R Q0 /\ Col P Q R /\ Col B A R).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { destruct (col_dec B A Q0).
(* Goal: False *)
        exists Q0; split; Between; Col.
(* Goal: @SuppA Tn A B C A B B' *)
      assert_diffs.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      destruct (cop__not_one_side_two_sides B A P Q0) as [_ [_ [R [HCol' HBet]]]]; Col; Cop.
      exists R; split; trivial; split; ColR.
    }
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    destruct HR as [R [HR1 [HR2 HR3]]].
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    assert (P <> R) by (intro; subst; apply HNCol3, HR3).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    exists R; split; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out321__inangle; auto.
(* Goal: @Out Tn B C R *)
    apply col_one_side_out with P; trivial.
(* Goal: @OS Tn B P C R *)
    apply one_side_transitivity with Q0; trivial.
(* Goal: @OS Tn B P Q0 R *)
    apply one_side_not_col124 in HOS.
(* Goal: False *)
    apply invert_one_side, out_one_side; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_6, bet_out; auto.
(* Goal: False *)
  - destruct (cop_not_par_same_side B P Q P P C) as [Q0 [HCol1 HOS]]; Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      apply coplanar_perm_3, coplanar_trans_1 with A; Cop.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    assert (Hd := os_distincts B P C Q0 HOS); spliter; clean.
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    destruct (one_side_dec B C P Q0).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { assert (HIn' : InAngle Q0 C B P) by (apply os2__inangle; assumption).
(* Goal: False *)
      exists Q0; split; Col.
(* Goal: @InAngle Tn Q0 A B C *)
      apply l11_24, in_angle_trans with P; trivial.
(* Goal: @InAngle Tn P C B A *)
      apply l11_24, HIn.
    }
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    assert (HR : exists R, Bet P R Q0 /\ Col P Q R /\ Col B C R).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
    { destruct (col_dec B C Q0).
(* Goal: False *)
        exists Q0; split; Between; Col.
(* Goal: @SuppA Tn A B C A B B' *)
      assert_diffs.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
      destruct (cop__not_one_side_two_sides B C P Q0) as [_ [_ [R [HCol' HBet]]]]; Col; Cop.
      exists R; split; trivial; split; ColR.
    }
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    destruct HR as [R [HR1 [HR2 HR3]]].
(* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@InAngle Tn R A B C) (and (not (@eq (@Tpoint Tn) P R)) (@Col Tn P Q R))) *)
    assert (P <> R) by (intro; subst; apply HNCol3, HR3).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    exists R; split; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_24, out321__inangle; auto.
(* Goal: @Out Tn B C R *)
    apply col_one_side_out with P; trivial.
(* Goal: @OS Tn B P C R *)
    apply one_side_transitivity with Q0; trivial.
(* Goal: @OS Tn B P Q0 R *)
    apply one_side_not_col124 in HOS.
(* Goal: False *)
    apply invert_one_side, out_one_side; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_6, bet_out; auto.
Qed.

Lemma col_inangle2__out : forall A B C P Q,
  ~ Bet A B C -> InAngle P A B C -> InAngle Q A B C -> Col B P Q ->
  Out B P Q.
Proof.
(* Goal: False *)
  intros A B C P Q HNBet HP HQ HCol.
  assert (Hd := inangle_distincts A B C P HP);
  assert (Hd' := inangle_distincts A B C Q HQ);
  spliter; clean.
(* Goal: @Out Tn B P Q *)
  destruct (col_dec A B C).
(* Goal: @Out Tn B P Q *)
    assert (Out B A C) by (apply not_bet_out; assumption).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_7 with A; [apply l6_6|]; apply out_in_angle_out with C; auto.
(* Goal: @Out Tn B P Q *)
  destruct (col_dec B A P) as [HCol1|HNCol1].
    apply l6_7 with A; [apply l6_6|]; apply col_in_angle_out with C; ColR.
(* Goal: @Out Tn B P Q *)
  apply col_one_side_out with A; trivial.
  apply one_side_transitivity with C; [|apply one_side_symmetry];
(* Goal: False *)
    apply invert_one_side, in_angle_one_side; Col.
  intro; apply HNCol1; ColR.
Qed.

Lemma inangle2__lea : forall A B C P Q, InAngle P A B C -> InAngle Q A B C ->
  LeA P B Q A B C.
Proof.
(* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @InAngle Tn P A B C) (_ : @InAngle Tn Q A B C), @LeA Tn P B Q A B C *)
  intros A B C P Q HP HQ.
(* Goal: @LeA Tn P B Q A B C *)
  assert (HP' := l11_24 P A B C HP).
(* Goal: @Acute Tn P B Q *)
  assert (HQ' := l11_24 Q A B C HQ).
  assert (Hd := inangle_distincts A B C P HP);
  assert (Hd' := inangle_distincts A B C Q HQ);
  spliter; clean.
(* Goal: @LeA Tn P B Q A B C *)
  destruct (col_dec A B C) as [HCol|HNCol].
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { destruct (bet_dec A B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
      apply l11_31_2; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_31_1; auto.
(* Goal: @Out Tn B P Q *)
    assert (Out B A C) by (apply not_bet_out; assumption).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l6_7 with A; [apply l6_6|]; apply out_in_angle_out with C; auto.
  }
(* Goal: @LeA Tn P B Q A B C *)
  destruct (col_dec B P Q) as [HCol1|HNCol1].
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_31_1; auto; apply col_inangle2__out with A C; auto.
(* Goal: False *)
    intro; apply HNCol; Col.
(* Goal: @LeA Tn P B Q A B C *)
  destruct (col_dec B A P) as [HCol2|HNCol2].
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { assert (Out B A P) by (apply col_in_angle_out with C; auto; intro; apply HNCol; Col).
(* Goal: @LeA Tn P B Q C B A *)
    exists Q; split; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with A Q A Q; try (apply out_trivial); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply conga_refl; auto.
  }
(* Goal: @LeA Tn P B Q A B C *)
  destruct (col_dec B C P) as [HCol3|HNCol3].
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { assert (Out B C P).
(* Goal: False *)
      apply col_in_angle_out with A; auto; intro; apply HNCol; Col.
(* Goal: @LeA Tn P B Q A B C *)
    apply lea_right_comm.
(* Goal: @LeA Tn P B Q C B A *)
    exists Q; split; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with C Q C Q; try (apply out_trivial); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply conga_refl; auto.
  }
(* Goal: @LeA Tn P B Q A B C *)
  destruct (col_dec B A Q) as [HCol4|HNCol4].
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { assert (Out B A Q) by (apply col_in_angle_out with C; auto; intro; apply HNCol; Col).
(* Goal: @LeA Tn P B Q A B C *)
    apply lea_left_comm.
(* Goal: @LeA Tn Q B P C B A *)
    exists P; split; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with A P A P; try (apply out_trivial); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply conga_refl; auto.
  }
(* Goal: @LeA Tn P B Q A B C *)
  destruct (col_dec B C Q) as [HCol5|HNCol5].
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  { assert (Out B C Q).
(* Goal: False *)
      apply col_in_angle_out with A; auto; intro; apply HNCol; Col.
(* Goal: @LeA Tn P B Q A B P *)
    apply lea_comm.
(* Goal: @LeA Tn Q B P C B A *)
    exists P; split; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with C P C P; try (apply out_trivial); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply conga_refl; auto.
  }
(* Goal: False *)
  destruct (cop__one_or_two_sides B P A Q) as [HOS|HTS]; Col.
(* Goal: False *)
    apply coplanar_perm_2, coplanar_trans_1 with C; Cop; Col.
  - apply lea_trans with P B C; [|apply lea_comm]; apply inangle__lea; trivial.
(* Goal: @OS Tn F D G G0 *)
    apply os2__inangle; apply invert_one_side.
(* Goal: False *)
      exists A; split; Side; apply in_angle_two_sides; Col.
    apply one_side_transitivity with A; [|apply one_side_symmetry];
(* Goal: False *)
    apply in_angle_one_side; Col.
  - apply lea_trans with A B P; [apply lea_right_comm|]; apply inangle__lea; trivial.
(* Goal: @InAngle Tn Q P B A *)
    apply os2__inangle; trivial.
    apply invert_one_side, one_side_transitivity with C; [|apply one_side_symmetry];
(* Goal: False *)
    apply in_angle_one_side; Col.
Qed.

Lemma conga_inangle_per__acute : forall A B C P,
  Per A B C -> InAngle P A B C -> CongA P B A P B C ->
  Acute A B P.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : @Per Tn A B C) (_ : @InAngle Tn P A B C) (_ : @CongA Tn P B A P B C), @Acute Tn A B P *)
  intros A B C P HPer HP1 HP2.
(* Goal: @Acute Tn A B P *)
  assert (Hd := inangle_distincts A B C P HP1); spliter; clean.
(* Goal: @Acute Tn P B Q *)
  assert (HNCol : ~ Col A B C) by (apply per_not_col; auto).
(* Goal: @Acute Tn A B P *)
  exists A, B, C; split; trivial.
(* Goal: @LtA Tn A B P A B C *)
  split.
(* Goal: @LeA Tn A B P A B C *)
(* Goal: not (@CongA Tn A B P A B C) *)
    apply inangle__lea, HP1.
(* Goal: not (@CongA Tn A B P A B C) *)
  intro Habs.
(* Goal: False *)
  assert (Per A B P) by (apply l11_17 with A B C, conga_sym; trivial).
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  apply HNCol, col_permutation_1, cop_per2__col with P; Cop.
(* Goal: @Per Tn C B P *)
  apply l11_17 with A B P; trivial.
(* Goal: @CongA Tn A B P C B P *)
  apply conga_comm, HP2.
Qed.

Lemma conga_inangle2_per__acute : forall A B C P Q, Per A B C ->
  InAngle P A B C -> CongA P B A P B C -> InAngle Q A B C ->
  Acute P B Q.
Proof.
(* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @Per Tn A B C) (_ : @InAngle Tn P A B C) (_ : @CongA Tn P B A P B C) (_ : @InAngle Tn Q A B C), @Acute Tn P B Q *)
  intros A B C P Q HPer HP1 HP2 HQ.
(* Goal: @Acute Tn P B Q *)
  assert (HP' := l11_24 P A B C HP1).
(* Goal: @Acute Tn P B Q *)
  assert (HQ' := l11_24 Q A B C HQ).
  assert (Hd := inangle_distincts A B C P HP1);
  assert (Hd' := inangle_distincts A B C Q HQ);
  spliter; clean.
(* Goal: @Acute Tn P B Q *)
  assert (HNCol : ~ Col A B C) by (apply per_not_col; auto).
(* Goal: @Acute Tn P B Q *)
  assert (HAcute : Acute A B P) by (apply conga_inangle_per__acute with C; assumption).
(* Goal: @Acute Tn P B Q *)
  assert (HNCol1 : ~ Col P B A).
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
    intro.
(* Goal: False *)
(* Goal: @Acute Tn P B Q *)
    assert (Col P B C) by (apply (col_conga_col P B A); assumption).
    apply HNCol; ColR.
(* Goal: @Acute Tn P B Q *)
  assert (HNCol2 : ~ Col P B C) by (apply (ncol_conga_ncol P B A); assumption).
(* Goal: @Acute Tn P B Q *)
  assert (~ Bet A B C) by (intro; apply HNCol; Col).
(* Goal: @Acute Tn P B Q *)
  destruct (col_dec B A Q).
(* Goal: @Acute Tn P B Q *)
(* Goal: @Acute Tn P B Q *)
    assert (Out B A Q) by (apply col_in_angle_out with C; Col).
(* Goal: @Acute Tn P B Q *)
(* Goal: @Acute Tn P B Q *)
    apply (acute_conga__acute A B P); trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with A P P A; try (apply out_trivial); auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply conga_pseudo_refl; auto.
(* Goal: @Acute Tn P B Q *)
  destruct (col_dec B C Q).
(* Goal: @Acute Tn P B Q *)
(* Goal: @Acute Tn P B Q *)
    assert (Out B C Q) by (apply col_in_angle_out with A; Between; Col).
(* Goal: @Acute Tn P B Q *)
(* Goal: @Acute Tn P B Q *)
    apply (acute_conga__acute A B P); trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply out_conga with A P P C; try (apply out_trivial); auto.
(* Goal: @CongA Tn A B P P B C *)
(* Goal: @Acute Tn P B Q *)
    apply conga_left_comm, HP2.
(* Goal: @Acute Tn P B Q *)
  destruct (col_dec B P Q).
(* Goal: @CongA Tn D E F A B C *)
    apply out__acute, col_inangle2__out with A C; assumption.
(* Goal: False *)
  destruct (cop__one_or_two_sides B P A Q) as [HOS|HTS]; Col.
(* Goal: False *)
    apply coplanar_perm_2, coplanar_trans_1 with C; Cop; Col.
  - apply acute_lea_acute with P B C.
(* Goal: @CongA Tn D E F A B C *)
      apply (acute_conga__acute A B P); try (apply conga_left_comm); assumption.
(* Goal: @LeA Tn P B Q P B C *)
    exists Q; split; [|apply conga_refl; auto].
(* Goal: @OS Tn F D G G0 *)
    apply os2__inangle; apply invert_one_side.
(* Goal: False *)
      exists A; split; Side; apply in_angle_two_sides; Col.
    apply one_side_transitivity with A; [|apply one_side_symmetry];
(* Goal: False *)
    apply in_angle_one_side; Col.
  - apply acute_lea_acute with A B P; trivial.
(* Goal: @LeA Tn P B Q A B P *)
    apply lea_comm.
(* Goal: @LeA Tn Q B P P B A *)
    exists Q; split; [|apply conga_pseudo_refl; auto].
(* Goal: @InAngle Tn Q P B A *)
    apply os2__inangle; trivial.
    apply invert_one_side, one_side_transitivity with C; [|apply one_side_symmetry];
(* Goal: False *)
    apply in_angle_one_side; Col.
Qed.

Lemma lta_os__ts : forall A O B P, ~ Col A O P -> LtA A O P A O B -> OS O A B P ->
  TS O P A B.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @LtA Tn D' E F A' B C *)
unfold LtA in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
(* Goal: @LeA Tn C B A D E F *)
unfold LeA in *.
ex_and H0 P'.
assert(~Col A O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  unfold OS in H1.
  ex_and H1 R.
  unfold TS in H1.
(* Goal: False *)
  spliter; Col.
}
(* Goal: @TS Tn P B A C *)
(* Goal: @TS Tn P B A C *)
unfold TS.
(* Goal: False *)
repeat split; Col.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
intro.
(* Goal: @TS Tn P B A C *)
induction H5.
assert(TS O A B P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: False *)
  repeat split; Col.
  exists O.
(* Goal: False *)
  split; Col.
}
apply l9_9 in H6.
(* Goal: @Out Tn O B C *)
contradiction.
(* Goal: False *)
apply H2.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
apply(out_conga A O B A O B A P A B);
try(apply out_trivial; auto).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply conga_refl; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
repeat split; auto.
(* Goal: @TS Tn P B A C *)
induction H5.
right; Between.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
left; auto.
Between.
unfold InAngle in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
ex_and H7 T.
exists T.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
induction H8.
(* Goal: False *)
treat_equalities; Col.
assert(HCop : Coplanar A O P P').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: False *)
  apply coplanar_trans_1 with B; Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
    Cop.
  exists T.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  left.
(* Goal: False *)
  split; Col.
}
assert(HH:= conga_cop__or_out_ts A O P P' HCop H3).
(* Goal: @Lt Tn B C B A *)
induction HH.
assert(Out O P T) by (apply (l6_7) with P'; finish).
(* Goal: False *)
Col.
(* Goal: @Out Tn B C T' *)
exfalso.
assert(A <> T).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  treat_equalities.
  unfold TS in H9.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
  apply H9.
(* Goal: False *)
  Col.
}
assert(OS O A T P').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  apply out_one_side.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
  left.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
(* Goal: False *)
  apply H4.
  ColR.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  auto.
}
assert(OS A O B T).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  apply out_one_side.
(* Goal: False *)
  left; Col.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  treat_equalities.
(* Goal: False *)
  apply H4; Col.
}
assert(OS O A B P').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  apply (one_side_transitivity _ _ _  T); finish.
}
assert(TS O A B P) by (apply(l9_8_2 _ _ P');finish).
apply l9_9 in H14.
(* Goal: @Out Tn O B C *)
contradiction.
Qed.

Lemma conga_os__out : forall O A B C, CongA A O B A O C -> OS O A B C -> Out O B C.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Out Tn O B C *)
assert(HH:= conga_cop__or_out_ts A O B C).
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
induction HH; Cop.
(* Goal: @Out Tn O B C *)
apply invert_two_sides in H1.
(* Goal: @Out Tn O B C *)
apply l9_9 in H1.
(* Goal: @Out Tn O B C *)
contradiction.
Qed.


Lemma ex_suppa : forall A B C, A <> B -> B <> C -> exists D E F, SuppA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @SuppA Tn A B C D E F))) *)
destruct (segment_construction A B A B) as [A' []].
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @SuppA Tn A B C D E F))) *)
exists C, B, A'.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
exists A'.
(* Goal: and (@Bet Tn A B C) (@CongA Tn C B C C B C) *)
split; trivial.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply conga_refl; auto.
Qed.

Lemma suppa_distincts : forall A B C D E F, SuppA A B C D E F ->
  A <> B /\ B <> C /\ D <> E /\ E <> F.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Per Tn A B C *)
ex_and H0 A'.
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H1; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
repeat split; auto.
Qed.

Lemma suppa_right_comm : forall A B C D E F, SuppA A B C D E F -> SuppA A B C F E D.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @Per Tn A B C *)
ex_and H0 A'.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn F E D C B A')) *)
exists A'.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @CongA Tn C B A C B A' *)
apply conga_left_comm, H1.
Qed.

Lemma suppa_left_comm : forall A B C D E F, SuppA A B C D E F -> SuppA C B A D E F.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Per Tn A B C *)
ex_and H0 A'.
(* Goal: and (not (@eq (@Tpoint Tn) C B)) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A'))) *)
apply conga_distinct in H1.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
destruct (segment_construction C B C B) as [C' []].
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn C B A') (@CongA Tn D E F A B A')) *)
exists C'.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @CongA Tn D E F D' E' F' *)
apply conga_trans with C B A'; trivial.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
apply conga_left_comm, l11_14; Between.
Qed.

Lemma suppa_comm : forall A B C D E F, SuppA A B C D E F -> SuppA C B A F E D.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @SuppA Tn C B A F E D *)
apply suppa_left_comm, suppa_right_comm, H.
Qed.

Lemma suppa_sym : forall A B C D E F, SuppA A B C D E F -> SuppA D E F A B C.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Per Tn A B C *)
ex_and H0 A'.
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H1; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
destruct (segment_construction D E D E) as [D' []].
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn D E A') (@CongA Tn A B C F E A')) *)
exists D'.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
apply conga_right_comm, l11_13 with A' D; Between.
(* Goal: @CongA Tn A' B C D E F *)
apply conga_sym, conga_right_comm, H1.
Qed.

Lemma conga2_suppa__suppa : forall A B C D E F A' B' C' D' E' F',
  CongA A B C A' B' C' -> CongA D E F D' E' F' -> SuppA A B C D E F ->
  SuppA A' B' C' D' E' F'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
assert (SuppA A B C D' E' F').
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @LtA Tn F E D0 C B A0 *)
  unfold SuppA in *; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D' E' F' C B A')) *)
  ex_and H2 A0.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D' E' F' C B A')) *)
  exists A0.
(* Goal: and (@Bet Tn A B C) (@CongA Tn C B C C B C) *)
  split; trivial.
(* Goal: @CongA Tn D E F A B C *)
  apply conga_trans with D E F; [apply conga_sym|]; assumption.
}
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
apply suppa_sym.
(* Goal: @SuppA Tn D' E' F' A' B' C' *)
apply suppa_sym in H2.
(* Goal: @LtA Tn F E D0 C B A0 *)
unfold SuppA in H2; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
ex_and H3 D0.
(* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => and (@Bet Tn D' E' A'0) (@CongA Tn A' B' C' F' E' A'0)) *)
exists D0.
(* Goal: and (@Bet Tn A B C) (@CongA Tn C B C C B C) *)
split; trivial.
(* Goal: @CongA Tn D E F A B C *)
apply conga_trans with A B C; [apply conga_sym|]; assumption.
Qed.

Lemma suppa2__conga456 : forall A B C D E F D' E' F',
  SuppA A B C D E F -> SuppA A B C D' E' F' -> CongA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @CongA Tn D E F D' E' F' *)
ex_and H2 A'.
(* Goal: @CongA Tn D E F D' E' F' *)
ex_and H1 A''.
(* Goal: @CongA Tn D E F D' E' F' *)
apply conga_trans with C B A'; trivial.
(* Goal: @CongA Tn C B A' D' E' F' *)
apply conga_trans with C B A''; [|apply conga_sym, H4].
(* Goal: @CongA Tn C B A' C B A'' *)
apply conga_distinct in H3.
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
(* Goal: @CongA Tn C B A' C B A'' *)
apply out2__conga.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply out_trivial; auto.
  apply l6_2 with A; Between.
Qed.

Lemma suppa2__conga123 : forall A B C D E F A' B' C',
  SuppA A B C D E F -> SuppA A' B' C' D E F -> CongA A B C A' B' C'.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @CongA Tn D E F A B C *)
apply (suppa2__conga456 D E F); apply suppa_sym; assumption.
Qed.

Lemma bet_out__suppa : forall A B C D E F, A <> B -> B <> C ->
  Bet A B C -> Out E D F -> SuppA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
exists C.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @CongA Tn D E F C B C *)
apply l11_21_b; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply out_trivial; auto.
Qed.

Lemma bet_suppa__out : forall A B C D E F,
  Bet A B C -> SuppA A B C D E F -> Out E D F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Out Tn E D F *)
assert (Hd := H0).
(* Goal: @LtA Tn F E D0 C B A0 *)
apply suppa_distincts in Hd; spliter.
(* Goal: @Out Tn E D F *)
apply (l11_21_a C B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply out_trivial; auto.
(* Goal: @CongA Tn A B B' D E F *)
apply (suppa2__conga456 A B C); trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn C B C C B A')) *)
exists C.
(* Goal: and (@Bet Tn A B C) (@CongA Tn C B C C B C) *)
split; trivial.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply conga_refl; auto.
Qed.

Lemma out_suppa__bet : forall A B C D E F,
  Out B A C -> SuppA A B C D E F -> Bet D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Bet Tn D E F *)
destruct (segment_construction A B A B) as [B' []].
(* Goal: @Bet Tn D E F *)
apply (bet_conga__bet A B B'); trivial.
(* Goal: @CongA Tn A B B' D E F *)
apply (suppa2__conga456 A B C); trivial.
(* Goal: @SuppA Tn A B C A B B' *)
assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply suppa_sym, bet_out__suppa; auto.
Qed.

Lemma per_suppa__per : forall A B C D E F,
  Per A B C -> SuppA A B C D E F -> Per D E F.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Acute Tn D E F *)
ex_and H1 A'.
(* Goal: @Per Tn D E F *)
apply (l11_17 C B A'); [|apply conga_sym, H2].
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H2; spliter.
(* Goal: False *)
apply per_col with A; Perp; Col.
Qed.

Lemma per2__suppa : forall A B C D E F, A <> B -> B <> C -> D <> E -> E <> F ->
  Per A B C -> Per D E F -> SuppA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
destruct (ex_suppa A B C) as [D' [E' [F']]]; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply (conga2_suppa__suppa A B C D' E' F'); try apply conga_refl; auto.
(* Goal: @CongA Tn D' E' F' D E F *)
assert (Hd := H5).
(* Goal: @LtA Tn F E D0 C B A0 *)
apply suppa_distincts in Hd; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply l11_16; auto.
(* Goal: @CongA Tn D E F A B C *)
apply (per_suppa__per A B C); assumption.
Qed.

Lemma suppa__per : forall A B C, SuppA A B C A B C -> Per A B C.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Per Tn A B C *)
ex_and H0 A'.
(* Goal: @Per Tn A B C *)
apply l8_2, l11_18_2 with A'; trivial.
(* Goal: @CongA Tn C B A C B A' *)
apply conga_left_comm, H1.
Qed.

Lemma acute_suppa__obtuse : forall A B C D E F,
  Acute A B C -> SuppA A B C D E F -> Obtuse D E F.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Acute Tn D E F *)
ex_and H1 A'.
(* Goal: @Obtuse Tn D E F *)
apply (conga_obtuse__obtuse C B A'); [|apply conga_sym, H2].
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H2; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply obtuse_sym, (acute_bet__obtuse A); auto.
Qed.

Lemma obtuse_suppa__acute : forall A B C D E F,
  Obtuse A B C -> SuppA A B C D E F -> Acute D E F.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @Acute Tn D E F *)
ex_and H1 A'.
(* Goal: @Acute Tn D E F *)
apply (acute_conga__acute C B A'); [|apply conga_sym, H2].
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H2; spliter.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply acute_sym, (bet_obtuse__acute A); auto.
Qed.

Lemma lea_suppa2__lea : forall A B C D E F A' B' C' D' E' F',
  SuppA A B C A' B' C' -> SuppA D E F D' E' F' -> LeA A B C D E F ->
  LeA D' E' F' A' B' C'.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @LtA Tn D' E' F' A' B' C' *)
ex_and H3 A0.
(* Goal: @LtA Tn D' E' F' A' B' C' *)
ex_and H2 D0.
(* Goal: @CongA Tn D E F A B C *)
apply (l11_30 F E D0 C B A0); [|apply conga_sym; assumption..].
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
apply lea_comm, l11_36 with D A; Between.
Qed.

Lemma lta_suppa2__lta : forall A B C D E F A' B' C' D' E' F',
  SuppA A B C A' B' C' -> SuppA D E F D' E' F' -> LtA A B C D E F ->
  LtA D' E' F' A' B' C'.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @LtA Tn A B C D E F), @LtA Tn D' E' F' A' B' C' *)
unfold SuppA.
(* Goal: @LtA Tn F E D0 C B A0 *)
intros; spliter.
(* Goal: @LtA Tn D' E' F' A' B' C' *)
ex_and H3 A0.
(* Goal: @LtA Tn D' E' F' A' B' C' *)
ex_and H2 D0.
(* Goal: @CongA Tn D E F A B C *)
apply (conga_preserves_lta F E D0 C B A0); [apply conga_sym; assumption..|].
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
apply conga_distinct in H5.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
apply lta_comm, bet2_lta__lta with A D; Between.
Qed.

Lemma suppa_dec : forall A B C D E F, SuppA A B C D E F \/ ~ SuppA A B C D E F.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: or (@SuppA Tn A B C D E F) (not (@SuppA Tn A B C D E F)) *)
induction (eq_dec_points A B).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  right; intros []; auto.
(* Goal: or (@SuppA Tn A B C D E F) (not (@SuppA Tn A B C D E F)) *)
induction (eq_dec_points B C).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  right; intro Habs; apply suppa_distincts in Habs; spliter; auto.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
destruct (ex_suppa A B C) as [D' [E' [F']]]; auto.
(* Goal: or (@SuppA Tn A B C D E F) (not (@SuppA Tn A B C D E F)) *)
induction (conga_dec D' E' F' D E F).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  left; apply (conga2_suppa__suppa A B C D' E' F'); try apply conga_refl; auto.
(* Goal: @CongA Tn D E F A B C *)
  right; intro; apply H2, (suppa2__conga456 A B C); assumption.
Qed.

End T11_2.

Ltac not_exist_hyp4 A B C D E F G H := first [not_exist_hyp_comm A B | not_exist_hyp_comm C D | not_exist_hyp_comm E F | not_exist_hyp_comm G H].

Ltac not_exist_hyp5 A B C D E F G H I J := first [not_exist_hyp_comm A B | not_exist_hyp_comm C D | not_exist_hyp_comm E F | not_exist_hyp_comm G H | not_exist_hyp_comm I J].

Ltac not_exist_hyp6 A B C D E F G H I J K L := first [not_exist_hyp_comm A B | not_exist_hyp_comm C D | not_exist_hyp_comm E F | not_exist_hyp_comm G H | not_exist_hyp_comm I J | not_exist_hyp_comm K L].

Ltac assert_diffs :=
repeat
 match goal with
      | H:(~Col ?X1 ?X2 ?X3) |- _ =>
      let h := fresh in
      not_exist_hyp3 X1 X2 X1 X3 X2 X3;
      assert (h := not_col_distincts X1 X2 X3 H);decompose [and] h;clear h;clean_reap_hyps

      | H:(~Bet ?X1 ?X2 ?X3) |- _ =>
      let h := fresh in
      not_exist_hyp2 X1 X2 X2 X3;
      assert (h := not_bet_distincts X1 X2 X3 H);decompose [and] h;clear h;clean_reap_hyps
      | H:Bet ?A ?B ?C, H2 : ?A <> ?B |-_ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= bet_neq12__neq A B C H H2);clean_reap_hyps
      | H:Bet ?A ?B ?C, H2 : ?B <> ?A |-_ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= bet_neq21__neq A B C H H2);clean_reap_hyps
      | H:Bet ?A ?B ?C, H2 : ?B <> ?C |-_ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= bet_neq23__neq A B C H H2);clean_reap_hyps
      | H:Bet ?A ?B ?C, H2 : ?C <> ?B |-_ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= bet_neq32__neq A B C H H2);clean_reap_hyps

      | H:Cong ?A ?B ?C ?D, H2 : ?A <> ?B |-_ =>
      let T:= fresh in (not_exist_hyp_comm C D);
        assert (T:= cong_diff A B C D H2 H);clean_reap_hyps
      | H:Cong ?A ?B ?C ?D, H2 : ?B <> ?A |-_ =>
      let T:= fresh in (not_exist_hyp_comm C D);
        assert (T:= cong_diff_2 A B C D H2 H);clean_reap_hyps
      | H:Cong ?A ?B ?C ?D, H2 : ?C <> ?D |-_ =>
      let T:= fresh in (not_exist_hyp_comm A B);
        assert (T:= cong_diff_3 A B C D H2 H);clean_reap_hyps
      | H:Cong ?A ?B ?C ?D, H2 : ?D <> ?C |-_ =>
      let T:= fresh in (not_exist_hyp_comm A B);
        assert (T:= cong_diff_4 A B C D H2 H);clean_reap_hyps

      | H:Le ?A ?B ?C ?D, H2 : ?A <> ?B |-_ =>
      let T:= fresh in (not_exist_hyp_comm C D);
        assert (T:= le_diff A B C D H2 H);clean_reap_hyps
      | H:Le ?A ?B ?C ?D, H2 : ?B <> ?A |-_ =>
      let T:= fresh in (not_exist_hyp_comm C D);
        assert (T:= le_diff A B C D (swap_diff B A H2) H);clean_reap_hyps
      | H:Lt ?A ?B ?C ?D |-_ =>
      let T:= fresh in (not_exist_hyp_comm C D);
        assert (T:= lt_diff A B C D H);clean_reap_hyps

      | H:Midpoint ?I ?A ?B, H2 : ?A<>?B |- _ =>
      let T:= fresh in (not_exist_hyp2 I B I A);
       assert (T:= midpoint_distinct_1 I A B H2 H);
       decompose [and] T;clear T;clean_reap_hyps
      | H:Midpoint ?I ?A ?B, H2 : ?B<>?A |- _ =>
      let T:= fresh in (not_exist_hyp2 I B I A);
       assert (T:= midpoint_distinct_1 I A B (swap_diff B A H2) H);
       decompose [and] T;clear T;clean_reap_hyps

      | H:Midpoint ?I ?A ?B, H2 : ?I<>?A |- _ =>
      let T:= fresh in (not_exist_hyp2 I B A B);
       assert (T:= midpoint_distinct_2 I A B H2 H);
       decompose [and] T;clear T;clean_reap_hyps
      | H:Midpoint ?I ?A ?B, H2 : ?A<>?I |- _ =>
      let T:= fresh in (not_exist_hyp2 I B A B);
       assert (T:= midpoint_distinct_2 I A B (swap_diff A I H2) H);
       decompose [and] T;clear T;clean_reap_hyps

      | H:Midpoint ?I ?A ?B, H2 : ?I<>?B |- _ =>
      let T:= fresh in (not_exist_hyp2 I A A B);
       assert (T:= midpoint_distinct_3 I A B H2 H);
       decompose [and] T;clear T;clean_reap_hyps
      | H:Midpoint ?I ?A ?B, H2 : ?B<>?I |- _ =>
      let T:= fresh in (not_exist_hyp2 I A A B);
       assert (T:= midpoint_distinct_3 I A B (swap_diff B I H2) H);
       decompose [and] T;clear T;clean_reap_hyps

      | H:Per ?A ?B ?C, H2 : ?A<>?B |- _ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= per_distinct A B C H H2); clean_reap_hyps
      | H:Per ?A ?B ?C, H2 : ?B<>?A |- _ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= per_distinct A B C H (swap_diff B A H2)); clean_reap_hyps
      | H:Per ?A ?B ?C, H2 : ?B<>?C |- _ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= per_distinct_1 A B C H H2); clean_reap_hyps
      | H:Per ?A ?B ?C, H2 : ?C<>?B |- _ =>
      let T:= fresh in (not_exist_hyp_comm A C);
        assert (T:= per_distinct_1 A B C H (swap_diff C B H2)); clean_reap_hyps

      | H:Perp ?A ?B ?C ?D |- _ =>
      let T:= fresh in (not_exist_hyp2 A B C D);
       assert (T:= perp_distinct A B C D H);
       decompose [and] T;clear T;clean_reap_hyps
      | H:Perp_at ?X ?A ?B ?C ?D |- _ =>
      let T:= fresh in (not_exist_hyp2 A B C D);
       assert (T:= perp_in_distinct X A B C D H);
       decompose [and] T;clear T;clean_reap_hyps
      | H:Out ?A ?B ?C |- _ =>
      let T:= fresh in (not_exist_hyp2 A B A C);
       assert (T:= out_distinct A B C H);
       decompose [and] T;clear T;clean_reap_hyps

      | H:TS ?A ?B ?C ?D |- _ =>
      let h := fresh in
      not_exist_hyp6 A B A C A D B C B D C D;
      assert (h := ts_distincts A B C D H);decompose [and] h;clear h;clean_reap_hyps
      | H:OS ?A ?B ?C ?D |- _ =>
      let h := fresh in
      not_exist_hyp5 A B A C A D B C B D;
      assert (h := os_distincts A B C D H);decompose [and] h;clear h;clean_reap_hyps
      | H:~ Coplanar ?A ?B ?C ?D |- _ =>
      let h := fresh in
      not_exist_hyp6 A B A C A D B C B D C D;
      assert (h := ncop_distincts A B C D H);decompose [and] h;clear h;clean_reap_hyps

      | H:CongA ?A ?B ?C ?A' ?B' ?C' |- _ =>
      let T:= fresh in (not_exist_hyp_comm A B);
        assert (T:= conga_diff1 A B C A' B' C' H);clean_reap_hyps
      | H:CongA ?A ?B ?C ?A' ?B' ?C' |- _ =>
      let T:= fresh in (not_exist_hyp_comm B C);
        assert (T:= conga_diff2 A B C A' B' C' H);clean_reap_hyps
      | H:CongA ?A ?B ?C ?A' ?B' ?C' |- _ =>
      let T:= fresh in (not_exist_hyp_comm A' B');
        assert (T:= conga_diff45 A B C A' B' C' H);clean_reap_hyps
      | H:CongA ?A ?B ?C ?A' ?B' ?C' |- _ =>
      let T:= fresh in (not_exist_hyp_comm B' C');
        assert (T:= conga_diff56 A B C A' B' C' H);clean_reap_hyps

      | H:(InAngle ?P ?A ?B ?C) |- _ =>
      let h := fresh in
      not_exist_hyp3 A B C B P B;
      assert (h := inangle_distincts A B C P H);decompose [and] h;clear h;clean_reap_hyps
      | H:LeA ?A ?B ?C ?D ?E ?F |- _ =>
      let h := fresh in
      not_exist_hyp4 A B B C D E E F;
      assert (h := lea_distincts A B C D E F H);decompose [and] h;clear h;clean_reap_hyps
      | H:LtA ?A ?B ?C ?D ?E ?F |- _ =>
      let h := fresh in
      not_exist_hyp4 A B B C D E E F;
      assert (h := lta_distincts A B C D E F H);decompose [and] h;clear h;clean_reap_hyps
      | H:(Acute ?A ?B ?C) |- _ =>
      let h := fresh in
      not_exist_hyp2 A B B C;
      assert (h := acute_distincts A B C H);decompose [and] h;clear h;clean_reap_hyps
      | H:(Obtuse ?A ?B ?C) |- _ =>
      let h := fresh in
      not_exist_hyp2 A B B C;
      assert (h := obtuse_distincts A B C H);decompose [and] h;clear h;clean_reap_hyps
      | H:SuppA ?A ?B ?C ?D ?E ?F |- _ =>
      let h := fresh in
      not_exist_hyp4 A B B C D E E F;
      assert (h := suppa_distincts A B C D E F H);decompose [and] h;clear h;clean_reap_hyps

      | H:(Orth_at ?X ?A ?B ?C ?U ?V) |- _ =>
      let h := fresh in
      not_exist_hyp4 A B A C B C U V;
      assert (h := orth_at_distincts A B C U V X H);decompose [and] h;clear h;clean_reap_hyps
      | H:(Orth ?A ?B ?C ?U ?V) |- _ =>
      let h := fresh in
      not_exist_hyp4 A B A C B C U V;
      assert (h := orth_distincts A B C U V H);decompose [and] h;clear h;clean_reap_hyps
 end.

Hint Resolve conga_refl conga_sym cong3_conga conga_pseudo_refl conga_trivial_1
             conga_right_comm conga_left_comm conga_comm : conga.

Ltac CongA := auto with conga.

Hint Resolve l11_31_1 l11_31_2 lta__lea lea_comm lea_right_comm lea_left_comm
             lea_asym lea121345 inangle__lea conga__lea conga__lea456123 lea_refl
             acute_per__lta obtuse_per__lta acute_obtuse__lta : lea.

Ltac Lea := auto with lea.


Section T11_3.

Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.

Lemma acute_one_side_aux : forall P A O B, 
 OS O A P B -> Acute A O P -> Perp O A B O ->
 OS O B A P.
Proof.
intros P A O B HOS.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
(* Goal: not (@Per Tn A B C) *)
unfold Acute in H.
(* Goal: not (@Per Tn A B C) *)
ex_and H A'.
ex_and H1 B'.
(* Goal: not (@Per Tn A B C) *)
ex_and H C'.

assert(Per A O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  apply perp_perp_in in H0.
  apply perp_in_comm in H0.
  apply perp_in_per in H0.
(* Goal: @CongA Tn D E F A B C *)
  assumption.
}
assert(CongA A' B' C' A O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l11_16; auto.
}
assert(LtA A O P A O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply(conga_preserves_lta A O P A' B' C' A O P A O B); auto.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply conga_refl; auto.
}

assert(~Col P O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  assert(Per A O P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  {
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: False *)
    apply (per_col A O B P); Col.
  }
  unfold LtA in H4.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: @Out Tn B P1 P2 *)
  apply H7.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply(l11_16); auto.
}

assert(NC:~Col A O P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  unfold OS in HOS.
  ex_and HOS R.
  unfold TS in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
  spliter.
(* Goal: False *)
  Col.
}

assert(TS O B A P \/ OS O B A P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  apply(cop__one_or_two_sides O B A P); Cop.
(* Goal: False *)
  apply perp_not_col in H0; Col.
}
induction H6.
unfold TS in H6.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
ex_and H8 T.

assert(O <> T).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  treat_equalities.
  assert(LeA A O B A O P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  {
(* Goal: @SuppA Tn A B C A B B' *)
    assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply(l11_31_2 A O B A O P); auto.
  }
  assert(~LtA A O P A O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  {
    apply lea__nlta.
(* Goal: @CongA Tn D E F A B C *)
    assumption.
  }
(* Goal: @Out Tn O B C *)
  contradiction.
}

assert(InAngle T A O P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: forall (P A B C : @Tpoint Tn) (_ : @InAngle Tn P A B C), @InAngle Tn P C B A *)
  unfold InAngle.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
  exists T.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  split; auto.
(* Goal: or (@LeA Tn A B C D E F) (@LeA Tn D E F A B C) *)
  right.
  finish.
}


assert(OS O A T P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @OS Tn F D G G0 *)
  apply invert_one_side.
  apply out_one_side.
(* Goal: False *)
  right; Col.
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
  apply perp_not_col in H0.
  intro;  treat_equalities.
(* Goal: False *)
  apply H0; Col.
}

assert(OS O A T B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply (one_side_transitivity _ _ _ P); auto.
}

(* Goal: False *)
destruct(l9_19 O A T B O); Col.
apply H14 in H13.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
assert(InAngle B A O P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
  apply(l11_25 T A O P A P B H11); auto;
  try(apply out_trivial; auto).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply l6_6; auto.
}

apply inangle__lea in H17.

apply lea__nlta in H17.
(* Goal: @Out Tn O B C *)
contradiction.
(* Goal: @CongA Tn D E F A B C *)
assumption.
Qed.

Lemma acute_one_side_aux0 : forall P A O B, Col A O P -> Acute A O P -> Perp O A B O -> OS O B A P.

Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
assert(LtA A O P A O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply(acute_per__lta A O P A O B H0); auto.
  apply perp_perp_in in H1.
  apply perp_in_comm in H1.
  apply perp_in_per in H1.
(* Goal: @CongA Tn D E F A B C *)
  assumption.
}

assert(Out O A P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @SuppA Tn A B C A B B' *)
  assert_diffs.
(* Goal: @CongA Tn A B C A' B' C' *)
  induction H.
  assert(LeA A O B A O P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
  {
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
    apply l11_31_2; auto.
  }
  apply lea__nlta in H3.
(* Goal: @Out Tn O B C *)
  contradiction.
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  repeat split; auto.
(* Goal: @CongA Tn A B C A' B' C' *)
  induction H.
  right; Between.
  left; Between.
}

(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply(out_one_side O B A P); auto.
(* Goal: or (@Acute Tn A B C) (or (@Per Tn A B C) (@Obtuse Tn A B C)) *)
left.
apply perp_not_col in H1.
(* Goal: False *)
Col.
Qed.

Lemma acute_cop_perp__one_side :
  forall P A O B, Acute A O P -> Perp O A B O -> Coplanar A B O P -> OS O B A P.

Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
intros.
induction(col_dec A O P).
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply(acute_one_side_aux0); auto.
assert(~Col A O B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  apply perp_not_col in H0.
(* Goal: False *)
  Col.
}
assert(TS O A P B \/ OS O A P B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: False *)
  apply(cop__one_or_two_sides O A P B); Col.
(* Goal: @Coplanar Tn B P P' A *)
(* Goal: @Coplanar Tn B P P' C' *)
(* Goal: not (@eq (@Tpoint Tn) A C') *)
  Cop.
}

(* Goal: @Lt Tn B C B A *)
induction H4.
assert(HC:=symmetric_point_construction B O).
ex_and HC Bs.
unfold Midpoint in *.
(* Goal: @LtA Tn F E D0 C B A0 *)
spliter.
assert(TS O A Bs B).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: False *)
  repeat split; Col.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  apply H3.
  ColR.
  exists O.
(* Goal: and (@Bet Tn G H F) (or (@eq (@Tpoint Tn) H E) (@Out Tn E H D)) *)
  split; Between.
}
assert(OS O A P Bs).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply(l9_8_1 _ _ _ _ B); auto.
}
assert(Perp O A Bs O ).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
  apply perp_sym.
  apply perp_comm.
(* Goal: @Per Tn D' D E *)
(* Goal: @Per Tn P D D' *)
  apply (perp_col _ B); Perp.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
  intro.
  treat_equalities.
(* Goal: False *)
  apply H3; Col.
(* Goal: False *)
  Col.
}
assert(OS O Bs A P).
(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
{
(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
  apply(acute_one_side_aux P A O Bs); auto.
}
(* Goal: False *)
apply(col_one_side _ Bs); Col.
(* Goal: not (@Col Tn P B A) *)
(* Goal: @Acute Tn P B Q *)
intro.
treat_equalities.
(* Goal: False *)
apply H3; Col.

(* Goal: @Perp Tn C B B A *)
(* Goal: False *)
apply(acute_one_side_aux P A O B); auto.
Qed.

End T11_3.

Section T11_2D.

(* Goal: @SuppA Tn A B C D' E' F' *)
(* Goal: @SuppA Tn A' B' C' D' E' F' *)
Context `{T2D:Tarski_2D}.

Lemma conga__or_out_ts : forall A B C C',
 CongA A B C A B C' -> Out B C C' \/ TS A B C C'.
Proof.
(* Goal: forall (A B C C' : @Tpoint Tn) (_ : @CongA Tn A B C A B C'), or (@Out Tn B C C') (@TS Tn A B C C') *)
  intros A B C C'.
(* Goal: forall _ : @CongA Tn A B C A B C', or (@Out Tn B C C') (@TS Tn A B C C') *)
  apply conga_cop__or_out_ts, all_coplanar.
Qed.

Lemma conga_out_reflectl__out : forall A B C P T T',
  ~ Out B A C -> CongA P B A P B C -> Out B A T -> ReflectL T T' B P -> Out B C T'.
Proof.
(* Goal: forall (A B C P T T' : @Tpoint Tn) (_ : not (@Out Tn B A C)) (_ : @CongA Tn P B A P B C) (_ : @Col Tn B A T) (_ : @ReflectL Tn T T' B P), @Col Tn B C T' *)
  intros A B C P T T' H.
(* Goal: forall (_ : @CongA Tn P B A P B C) (_ : @Col Tn B A T) (_ : @ReflectL Tn T T' B P), @Col Tn B C T' *)
  assert (H1 := all_coplanar A B C P).
(* Goal: @CongA Tn D E F A B C *)
  apply conga_cop_out_reflectl__out; assumption.
Qed.

Lemma col_conga_reflectl__col : forall A B C P T T',
  ~ Out B A C -> CongA P B A P B C -> Col B A T -> ReflectL T T' B P -> Col B C T'.
Proof.
(* Goal: forall (A B C P T T' : @Tpoint Tn) (_ : not (@Out Tn B A C)) (_ : @CongA Tn P B A P B C) (_ : @Col Tn B A T) (_ : @ReflectL Tn T T' B P), @Col Tn B C T' *)
  intros A B C P T T' H.
(* Goal: forall (_ : @CongA Tn P B A P B C) (_ : @Col Tn B A T) (_ : @ReflectL Tn T T' B P), @Col Tn B C T' *)
  assert (H1 := all_coplanar A B C P).
(* Goal: @CongA Tn D E F A B C *)
  apply col_conga_cop_reflectl__col; assumption.
Qed.

Lemma conga2__col : forall A B C P P',
  ~ Out B A C -> CongA P B A P B C -> CongA P' B A P' B C -> Col B P P'.
Proof.
(* Goal: forall (A B C P P' : @Tpoint Tn) (_ : not (@Out Tn B A C)) (_ : @CongA Tn P B A P B C) (_ : @CongA Tn P' B A P' B C), @Col Tn B P P' *)
  intros A B C P P' H H1 H2.
(* Goal: @Col Tn B P P' *)
  assert (H3 := all_coplanar A B P P').
(* Goal: @Col Tn B P P' *)
  assert (H4 := all_coplanar B C P P').
(* Goal: @CongA Tn D E F A B C *)
  apply conga2_cop2__col with A C; assumption.
Qed.

Lemma inangle__ex_col_inangle : forall A B C P Q, ~ Out B A C -> InAngle P A B C ->
  exists R, InAngle R A B C /\ P <> R /\ Col P Q R.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @CongA Tn D E F A B C *)
  apply cop_inangle__ex_col_inangle; [assumption..|].
(* Goal: @Coplanar Tn A B O P *)
  apply all_coplanar.
Qed.

Lemma acute_perp__one_side : forall P A O B, Acute A O P -> Perp O A B O -> OS O B A P.
Proof.
(* Goal: forall (P A O B : @Tpoint Tn) (_ : @Acute Tn A O P) (_ : @Perp Tn O A B O), @OS Tn O B A P *)
  intros.
(* Goal: @CongA Tn D E F A B C *)
  apply acute_cop_perp__one_side; [assumption..|].
(* Goal: @Coplanar Tn A B O P *)
  apply all_coplanar.
Qed.

End T11_2D.