Require Export GeoCoq.Tarski_dev.Ch11_angles.

Section Suma_1.

Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.

Lemma suma_distincts : forall A B C D E F G H I, SumA A B C D E F G H I ->
   A<>B /\ B<>C /\ D<>E /\ E<>F /\ G<>H /\ H<>I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I), @SumA Tn C B A F E D I H G *)
  intros A B C D E F G H I Hsuma.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) D E)) (and (not (@eq (@Tpoint Tn) E F)) (and (not (@eq (@Tpoint Tn) G H)) (not (@eq (@Tpoint Tn) H I)))))) *)
  destruct Hsuma as [J HJ].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C A B C *)
  repeat split; auto.
Qed.

Lemma trisuma_distincts : forall A B C D E F, TriSumA A B C D E F ->
  A <> B /\ B <> C /\ A <> C /\ D <> E /\ E <> F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) E F))))) *)
  intros A B C D E F HTri.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) E F))))) *)
  destruct HTri as [G [H [I [HSuma HSuma1]]]].
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) E F))))) *)
  apply suma_distincts in HSuma.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) E F))))) *)
  apply suma_distincts in HSuma1.
(* Goal: @SAMS Tn A B C A B C *)
  spliter; repeat split; auto.
Qed.

Lemma ex_suma : forall A B C D E F, A<>B -> B<>C -> D<>E -> E<>F ->
   exists G H I, SumA A B C D E F G H I.
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)), @ex (@Tpoint Tn) (fun G : @Tpoint Tn => @ex (@Tpoint Tn) (fun H : @Tpoint Tn => @ex (@Tpoint Tn) (fun I : @Tpoint Tn => @SumA Tn A B C D E F G H I))) *)
  intros A B C D E F HAB HBC HDE HEF.
(* Goal: @ex (@Tpoint Tn) (fun G : @Tpoint Tn => @ex (@Tpoint Tn) (fun H : @Tpoint Tn => @ex (@Tpoint Tn) (fun I : @Tpoint Tn => @SumA Tn A B C D E F G H I))) *)
  exists A.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C1) (@Bet Tn C T C0)) *)
  exists B.
(* Goal: @LeA Tn B C A C B A' *)
  elim (col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB.
(* Goal: @ex (@Tpoint Tn) (fun I : @Tpoint Tn => @SumA Tn A B C D E F A B I) *)
    destruct (angle_construction_4 D E F C B A) as [J [HConga HCop]]; auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: @SumA Tn A B C' D' E F G H I *)
    exists J.
(* Goal: @SumA Tn A B C' D' E F G H I *)
    exists J.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
    repeat (split; CongA); Cop.
(* Goal: not (@OS Tn B C A A) *)
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
      apply (col123__nos); Col.
  }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
  intro HNColB.
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim (col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim (bet_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HEBet.
(* Goal: @ex (@Tpoint Tn) (fun I : @Tpoint Tn => @SumA Tn A B C D E F A B I) *)
      assert (HJ : exists J, Midpoint B C J) by (apply symmetric_point_construction).
(* Goal: @ex (@Tpoint Tn) (fun I : @Tpoint Tn => @SumA Tn A B C D E F A B I) *)
      destruct HJ as [J HMid].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
      assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun I : @Tpoint Tn => @SumA Tn A B C D E F A B I) *)
      destruct HMid as [HJBet HCong].
(* Goal: @SumA Tn A B C' D' E F G H I *)
      exists J.
(* Goal: @SumA Tn A B C' D' E F G H I *)
      exists J.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: @CongA Tn C B J D E F *)
(* Goal: and (not (@OS Tn B C A J)) (and (@Coplanar Tn A B C J) (@CongA Tn A B J A B J)) *)
      apply conga_line; Between; repeat split; auto; intro; treat_equalities; absurde.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
        apply col124__nos; Col.
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
      split; CongA; Cop.
    }
(* Goal: forall _ : not (@Bet Tn D E F), @CongA Tn D E K A B J *)
    intro HENBet.
(* Goal: @CongA Tn D E K A B J *)
    assert (HEOut : Out E D F) by (apply l6_4_2; auto).
(* Goal: @LeA Tn A B C A B J *)
    exists C.
(* Goal: @LeA Tn A B C A B J *)
    exists C.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: @CongA Tn C B C D E F *)
(* Goal: and (not (@OS Tn B C A C)) (and (@Coplanar Tn A B C C) (@CongA Tn A B C A B C)) *)
    apply (out_conga C B C D E D); auto; try (apply out_trivial); CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
      apply col124__nos; Col.
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
    split; CongA; Cop.
  }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
  intro HNColE.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert (HJ : exists J, CongA D E F C B J /\ TS C B J A) by (apply ex_conga_ts; Col).
(* Goal: @ex (@Tpoint Tn) (fun I : @Tpoint Tn => @SumA Tn A B C D E F A B I) *)
  destruct HJ as [J [HConga HTwo]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SumA Tn A B C' D' E F G H I *)
  exists J.
(* Goal: @SumA Tn A B C' D' E F G H I *)
  exists J.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
  repeat (split; CongA); Cop.
(* Goal: not (@OS Tn B C A J) *)
(* Goal: and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J) *)
  apply l9_9; apply l9_2; apply invert_two_sides; auto.
Qed.

(** Unicity of the sum. *)

Lemma suma2__conga : forall A B C D E F G H I G' H' I',
   SumA A B C D E F G H I -> SumA A B C D E F G' H' I' -> CongA G H I G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I G' H' I' : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A B C D E F G' H' I'), @CongA Tn G H I G' H' I' *)
  intros A B C D E F G H I G' H' I' Hsuma Hsuma'.
(* Goal: @SumA Tn A B C D' E' F' G' H' I' *)
  destruct Hsuma as [J [HJ1 [HJ2 [HJ3 HCop]]]].
(* Goal: @CongA Tn G H I G' H' I' *)
  destruct Hsuma' as [J' [HJ'1 [HJ'2 [HJ'3 HCop']]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn G H I G' H' I' *)
  assert (HcongaC : CongA C B J C B J') by (apply (conga_trans C B J D E F); auto; apply conga_sym; auto).
(* Goal: @CongA Tn G H I G' H' I' *)
  assert (HcongaA : CongA A B J A B J').
(* Goal: @LeA Tn B C A C B A' *)
  { elim (col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      elim (bet_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { intro HBBet.
(* Goal: @CongA Tn A B J A B J' *)
        apply (l11_13 C B J C B J'); Between.
      }
(* Goal: forall _ : not (@Bet Tn A B C), and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
      intro HBNBet.
(* Goal: @SumA Tn D E F A B C G H I *)
      assert (HBOut : Out B A C) by (apply l6_4_2; auto).
(* Goal: @CongA Tn A B J A B J' *)
      apply (l11_10 C B J C B J'); try (apply out_trivial); auto.
    }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
    intro HNColB.
(* Goal: @SAMS Tn A B C D' E' F' *)
    elim (col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HColE.
(* Goal: @CongA Tn A B J A B J' *)
      apply (out_conga A B J A B J); try (apply out_trivial); CongA.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      elim (bet_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { intro HEBet.
(* Goal: @SAMS Tn A B C A B C *)
        apply l6_3_2; repeat split; auto.
(* Goal: @LeA Tn A B C A B J *)
        exists C.
(* Goal: and (not (@eq (@Tpoint Tn) C B)) (and (@Bet Tn J B C) (@Bet Tn J' B C)) *)
        split; auto; split; apply (bet_conga__bet D E F); CongA.
      }
(* Goal: forall _ : not (@Bet Tn D E F), @CongA Tn D E K A B J *)
      intro HENBet.
(* Goal: @CongA Tn D E K A B J *)
      assert (HEOut : Out E D F) by (apply l6_4_2; auto).
(* Goal: @Out Tn B J J' *)
      apply (l6_7 B J C); apply (l11_21_a D E F); CongA.
    }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
    intro HNColE.
(* Goal: @CongA Tn A B J A B J' *)
    apply (l11_22a A B J C A B J' C); auto.
    repeat (split; try (apply cop__not_one_side_two_sides); CongA); Cop;
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (ncol_conga_ncol D E F); CongA.
  }
(* Goal: @CongA Tn G H I G' H' I' *)
  apply (conga_trans G H I A B J).
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  CongA.
(* Goal: @CongA Tn A B J G' H' I' *)
  apply (conga_trans A B J A B J'); auto.
Qed.

(** Commutativity of the sum. *)

Lemma suma_sym : forall A B C D E F G H I, SumA A B C D E F G H I -> SumA D E F A B C G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I), @SumA Tn C B A F E D I H G *)
  intros A B C D E F G H I Hsuma.
(* Goal: @SumA Tn D E F A B C G H I *)
  destruct Hsuma as [J [HCongaBCJ [HNOne [HCongaABJ HCop]]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn B C A C B A' *)
  elim (col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim (bet_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HBBet.
(* Goal: @SumA Tn D E F A B C G H I *)
      assert (HK : exists K, Midpoint E F K) by (apply symmetric_point_construction).
(* Goal: @SumA Tn D E F A B C G H I *)
      destruct HK as [K [HKBet HCong]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
      assert_diffs.
(* Goal: @SumA Tn D E F A B C G H I *)
      exists K.
(* Goal: and (@CongA Tn F E K A B C) (and (not (@OS Tn E F D K)) (and (@Coplanar Tn D E F K) (@CongA Tn D E K G H I))) *)
      split; try (apply conga_line; auto).
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: not (@OS Tn E F D K) *)
(* Goal: and (@Coplanar Tn D E F K) (@CongA Tn D E K G H I) *)
        intro HOne.
(* Goal: False *)
(* Goal: and (@Coplanar Tn D E F K) (@CongA Tn D E K G H I) *)
        assert (~ Col E F K) by (apply (one_side_not_col123 E F K D); apply one_side_symmetry; auto).
(* Goal: False *)
(* Goal: False *)
        assert_cols; Col.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
      split; Cop.
(* Goal: @CongA Tn D E K G H I *)
      apply (conga_trans D E K A B J); auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply conga_left_comm; apply (l11_13 F E D C B J); Between; CongA.
    }
(* Goal: forall _ : not (@Bet Tn A B C), and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
    intro HBNBet.
(* Goal: @SumA Tn D E F A B C G H I *)
    assert (HBOut : Out B A C) by (apply l6_4_2; auto).
(* Goal: @SumA Tn D E F A B C G H I *)
    exists F.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (l11_10 F E F C B C); try (apply out_trivial); CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
    apply col124__nos; Col.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
    split; Cop.
(* Goal: @CongA Tn D E F G H I *)
    apply (conga_trans D E F A B J); auto.
(* Goal: @CongA Tn G H I A B C *)
    apply conga_sym.
(* Goal: @CongA Tn A B J D E F *)
    apply (l11_10 C B J D E F); try (apply out_trivial); auto.
  }

(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
  intro HNColB.
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim (col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE.
(* Goal: @SumA Tn D E F A B C G H I *)
    assert (HK : exists K, CongA A B C F E K) by (apply angle_construction_3; auto).
(* Goal: @SumA Tn D E F A B C G H I *)
    destruct HK as [K HConga].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: @SumA Tn D E F A B C G H I *)
    exists K.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    split; CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: not (@OS Tn E F D K) *)
(* Goal: and (@Coplanar Tn D E F K) (@CongA Tn D E K G H I) *)
    intro HOne; assert (~ Col E F D) by (apply (one_side_not_col123 E F D K); auto); Col.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
    split; Cop.
(* Goal: @CongA Tn D E K G H I *)
    apply (conga_trans D E K A B J); auto.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim (bet_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HEBet.
(* Goal: @CongA Tn D E K A B J *)
      apply conga_sym; apply conga_left_comm.
(* Goal: @CongA Tn J B A D E K *)
      apply (l11_13 C B A F); CongA; Between.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (bet_conga__bet D E F); CongA.
    }
(* Goal: forall _ : not (@Bet Tn D E F), @CongA Tn D E K A B J *)
    intro HENBet.
(* Goal: @CongA Tn D E K A B J *)
    assert (HEOut : Out E D F) by (apply l6_4_2; auto).
(* Goal: @CongA Tn G H I A B C *)
    apply conga_sym.
(* Goal: @CongA Tn A B J D E K *)
    apply (l11_10 A B C F E K); try (apply out_trivial); auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (l11_21_a D E F); CongA.
  }

(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
  intro HNColE.
(* Goal: @SumA Tn D E F A B C G H I *)
  assert (HK : exists K, CongA A B C F E K /\ TS F E K D) by (apply ex_conga_ts; Col).
(* Goal: @SumA Tn D E F A B C G H I *)
  destruct HK as [K [HConga HTwo]].
(* Goal: @SumA Tn D E F A B C G H I *)
  exists K.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  split; CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: not (@OS Tn B C A J) *)
(* Goal: and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J) *)
  apply l9_9; apply l9_2; apply invert_two_sides; auto.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
  split; Cop.
(* Goal: @CongA Tn D E K G H I *)
  apply (conga_trans D E K A B J); auto.
(* Goal: @CongA Tn D E K A B J *)
  apply conga_sym; apply conga_right_comm.
(* Goal: @CongA Tn A B J K E D *)
  apply (l11_22a A B J C K E D F).
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @TS Tn B C A C1 *)
  apply cop__not_one_side_two_sides; Col; Cop.
(* Goal: not (@Col Tn J B C) *)
(* Goal: and (@TS Tn E F K D) (and (@CongA Tn A B C K E F) (@CongA Tn C B J F E D)) *)
    intro; assert (Col D E F) by (apply (col_conga_col C B J D E F); Col); Col.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @TS Tn E F K D *)
(* Goal: and (@CongA Tn A B C K E F) (@CongA Tn C B J F E D) *)
    apply invert_two_sides; auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  split; CongA.
Qed.

(* Goal: @SumA Tn C B A B A C C2 A2 B2 *)
(* Goal: @SumA Tn C2 A2 B2 A C B D E F *)
(** CongA preserves SumA. *)

Lemma conga3_suma__suma : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   SumA A B C D E F G H I ->
   CongA A B C A' B' C' ->
   CongA D E F D' E' F' ->
   CongA G H I G' H' I' ->
   SumA A' B' C' D' E' F' G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @CongA Tn A B C A' B' C') (_ : @CongA Tn D E F D' E' F') (_ : @CongA Tn G H I G' H' I'), @SumA Tn A' B' C' D' E' F' G' H' I' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I' Hsuma HCongaB HCongaE HCongaH.
(* Goal: @SumA Tn A' B' C' D' E' F' G' H' I' *)
  assert (Hsuma' : SumA D' E' F' A B C G' H' I').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply suma_sym.
(* Goal: @SumA Tn A B C D' E' F' G' H' I' *)
    destruct Hsuma as [J [HJ1 [HJ2 [HJ3 HCop]]]].
(* Goal: @SumA Tn A B C' D' E F G H I *)
    exists J.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: @CongA Tn C B J D' E' F' *)
(* Goal: and (not (@OS Tn B C A J)) (and (@Coplanar Tn A B C J) (@CongA Tn A B J G' H' I')) *)
    apply (conga_trans C B J D E F); auto.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
    split; auto.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
    split; auto.
(* Goal: @CongA Tn A B J G' H' I' *)
    apply (conga_trans A B J G H I); auto.
  }
(* Goal: @SumA Tn B2 C2 A2 A B C D E F *)
  apply suma_sym.
(* Goal: @SumA Tn D' E' F' A' B' C' G' H' I' *)
  destruct Hsuma' as [J [HJ1 [HJ2 [HJ3 HCop]]]].
(* Goal: @SumA Tn A B C' D' E F G H I *)
  exists J.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @CongA Tn F' E' J A' B' C' *)
(* Goal: and (not (@OS Tn E' F' D' J)) (and (@Coplanar Tn D' E' F' J) (@CongA Tn D' E' J G' H' I')) *)
    apply (conga_trans F' E' J A B C); auto.
(* Goal: and (@CongA Tn C B F1 D E F) (and (not (@OS Tn B C A F1)) (and (not (@TS Tn A B C F1)) (@Coplanar Tn A B C F1))) *)
  repeat (split; auto).
Qed.

(* Goal: @SumA Tn C B A B A C C2 A2 B2 *)
(* Goal: @SumA Tn C2 A2 B2 A C B D E F *)
(** Out preserves SumA. *)

Lemma out6_suma__suma : forall A B C D E F G H I A' C' D' F' G' I',
   SumA A B C D E F G H I -> Out B A A' -> Out B C C' -> Out E D D' ->
   Out E F F' -> Out H G G' -> Out H I I' -> SumA A' B C' D' E F' G' H I'.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SumA Tn A' B C' D' E F' G' H I' *)
  apply (conga3_suma__suma A B C D E F G H I); auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (out_conga A B C A B C); try (apply out_trivial); CongA.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (out_conga D E F D E F); try (apply out_trivial); CongA.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (out_conga G H I G H I); try (apply out_trivial); CongA.
Qed.

(** ABC + 0 =  ABC (two lemmas) *)

Lemma out546_suma__conga : forall A B C D E F G H I, SumA A B C D E F G H I ->
   Out E D F -> CongA A B C G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @Out Tn B A C), @CongA Tn D E F G H I *)
  intros A B C D E F G H I Hsuma Hout.
(* Goal: @CongA Tn A B C G H I *)
  assert(A<>B/\B<>C/\D<>E/\E<>F/\G<>H/\H<>I) by (apply suma_distincts; auto).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @CongA Tn A B C G H I *)
  apply (suma2__conga A B C D E F A B C); auto.
(* Goal: @LeA Tn A B C A B J *)
  exists C.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (out_conga C B C D E D); try (apply out_trivial); CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
    apply col124__nos; Col.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  split; Cop; CongA.
Qed.

Lemma out546__suma : forall A B C D E F, A <> B -> B <> C -> Out E D F -> SumA A B C 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)) (_ : @Out Tn E D F), @SumA Tn A B C D E F A B C *)
  intros A B C D E F HAB HBC Hout.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SumA Tn A B C D E F A B C *)
  destruct (ex_suma A B C D E F) as [G [H [I Hsuma]]]; auto.
(* Goal: @SumA Tn A B C D E F A B C *)
  apply (conga3_suma__suma A B C D E F G H I); try (apply conga_refl); auto.
(* Goal: @CongA Tn G H I A B C *)
  apply conga_sym, out546_suma__conga with D E F; auto.
Qed.

(** 0 + DEF = DEF (two lemmas) *)

Lemma out213_suma__conga : forall A B C D E F G H I, SumA A B C D E F G H I ->
   Out B A C -> CongA D E F G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @Out Tn B A C), @CongA Tn D E F G H I *)
  intros A B C D E F G H I Hsuma Hout.
(* Goal: @CongA Tn D E F G H I *)
  apply (out546_suma__conga D E F A B C); auto.
(* Goal: @SumA Tn D E F A B C G H I *)
  apply suma_sym; auto.
Qed.

Lemma out213__suma : forall A B C D E F, D <> E -> E <> F -> Out B A C -> SumA A B C D E F D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)) (_ : @Out Tn B A C), @SumA Tn A B C D E F D E F *)
  intros; apply suma_sym, out546__suma; auto.
Qed.

(** Some permutation properties:*)

Lemma suma_left_comm : forall A B C D E F G H I,
   SumA A B C D E F G H I -> SumA C B A D E F G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I), @SumA Tn C B A F E D I H G *)
  intros A B C D E F G H I Hsuma.
(* Goal: @SumA Tn C B A F E D I H G *)
  assert(Hd := suma_distincts A B C D E F G H I Hsuma).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma A B C D E F G H I); CongA.
Qed.

Lemma suma_middle_comm : forall A B C D E F G H I,
   SumA A B C D E F G H I -> SumA A B C F E D G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I), @SumA Tn C B A F E D I H G *)
  intros A B C D E F G H I Hsuma.
(* Goal: @SumA Tn C B A F E D I H G *)
  assert(Hd := suma_distincts A B C D E F G H I Hsuma).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma A B C D E F G H I); CongA.
Qed.

Lemma suma_right_comm : forall A B C D E F G H I,
   SumA A B C D E F G H I -> SumA A B C D E F I H G.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I), @SumA Tn C B A F E D I H G *)
  intros A B C D E F G H I Hsuma.
(* Goal: @SumA Tn C B A F E D I H G *)
  assert(Hd := suma_distincts A B C D E F G H I Hsuma).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma A B C D E F G H I); CongA.
Qed.

Lemma suma_comm : forall A B C D E F G H I,
   SumA A B C D E F G H I -> SumA C B A F E D I H G.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I), @SumA Tn C B A F E D I H G *)
  intros A B C D E F G H I Hsuma.
(* Goal: @SumA Tn C B A F E D I H G *)
  assert(Hd := suma_distincts A B C D E F G H I Hsuma).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma A B C D E F G H I); CongA.
Qed.

(** Basic cases of sum *)

Lemma ts__suma : forall A B C D, TS A B C D -> SumA C B A A B D C B D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @TS Tn A B C D), @SumA Tn C B A A B D C B D *)
  intros A B C D HTS.
(* Goal: @SumA Tn C B A A B D C B D *)
  exists D.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  split; CongA.
(* Goal: and (not (@OS Tn B C A P)) (and (not (@TS Tn A B C P)) (@Coplanar Tn A B C P)) *)
  split; Side.
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
  split; CongA; Cop.
Qed.

Lemma inangle__suma : forall A B C P, InAngle P A B C -> SumA A B P P B C A B C.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : @InAngle Tn P A B C), @SAMS Tn A B P P B C *)
  intros A B C P HInangle.
(* Goal: @SumA Tn A B P P B C A B C *)
  assert (Hcopy := HInangle); destruct Hcopy as [HAB [HCB [HPB _]]].
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
  exists C; repeat (split; CongA); Cop.
(* Goal: not (@OS Tn B P A C) *)
  elim (col_dec B P A).
(* Goal: forall _ : @Col Tn B P A, not (@OS Tn B P A C) *)
(* Goal: forall _ : not (@Col Tn B P A), not (@OS Tn B P A C) *)
    apply col123__nos.
(* Goal: forall _ : not (@Col Tn B P A), not (@OS Tn B P A C) *)
  intro HNCol.
(* Goal: not (@OS Tn B P A C) *)
  elim (col_dec B P C).
(* Goal: forall _ : @Col Tn B P C, not (@OS Tn B P A C) *)
(* Goal: forall _ : not (@Col Tn B P C), not (@OS Tn B P A C) *)
    apply col124__nos.
(* Goal: forall _ : not (@Col Tn B P C), not (@OS Tn B P A C) *)
  intro HNCol2.
(* Goal: not (@OS Tn B P A C) *)
  apply l9_9, invert_two_sides, in_angle_two_sides; Col.
Qed.

Lemma bet__suma : forall A B C P, A <> B -> B <> C -> P <> B -> Bet A B C ->
  SumA A B P P B C A B C.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) P B)) (_ : @Bet Tn A B C), @SAMS Tn A B P P B C *)
  intros A B C P HAB HBC HPB HBet.
(* Goal: @SumA Tn A B P P B C A B C *)
  apply inangle__suma.
(* Goal: @InAngle Tn P A B C *)
  apply in_angle_line; auto.
Qed.


(** Characterization of SAMS using LeA. *)

Lemma sams_chara : forall A B C D E F A', A<>B -> A'<>B -> Bet A B A' ->
   (SAMS A B C D E F <-> LeA D E F C B A').
Proof.
(* Goal: forall (A B C D E F A' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A' B)) (_ : @Bet Tn A B A'), iff (@SAMS Tn A B C D E F) (@LeA Tn D E F C B A') *)
  intros A B C D E F A' HAB HA'B HABA'.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
  - intro Hint.
(* Goal: @LeA Tn D E F C B A' *)
    destruct Hint as [_ [HUn [J [HJ1 [HJ2 [HJ3 HJ4]]]]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: @LeA Tn D E F C B A' *)
    destruct HUn as [HEOut | HBNBet].
(* Goal: @LeA Tn B C A C B A' *)
    apply l11_31_1; auto.
(* Goal: @LeA Tn B C A C B A' *)
    elim (col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HColB.
(* Goal: forall _ : @Bet Tn G' H' I', @LeA Tn G H I G' H' I' *)
(* Goal: forall _ : not (@Bet Tn G' H' I'), @LeA Tn G H I G' H' I' *)
      apply l11_31_2; auto.
(* Goal: @Bet Tn C B A' *)
      apply (bet_out_out_bet A B A'); try (apply out_trivial); auto.
(* Goal: @Out Tn B A C *)
      apply l6_4_2; auto.
    }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
    intro HNColB.
(* Goal: @SAMS Tn A B C D' E' F' *)
    elim (col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HColE.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      elim (bet_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { intro HDEF.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
        exfalso.
(* Goal: False *)
        apply HJ3.
(* Goal: @TS Tn A B C J *)
        assert (HCBJ : Bet C B J) by (apply (bet_conga__bet D E F); CongA; Between); assert_cols.
(* Goal: @TS Tn B C A A' *)
        repeat split; Col.
(* Goal: not (@Col Tn J A B) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T J)) *)
        intro; apply HNColB; apply (l6_16_1 B J C A); Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C1) (@Bet Tn C T C0)) *)
        exists B.
(* Goal: and (@Col Tn B B C1) (@Bet Tn C B C0) *)
        split; Col; Between.
      }
(* Goal: @Out Tn B A C *)
      intro; apply l11_31_1; auto; apply l6_4_2; auto.
    }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
    intro HNColE.
(* Goal: @LeA Tn D E F C B A' *)
    apply (l11_30 C B J C B A'); try (apply conga_refl); auto.
(* Goal: @SumA Tn A B C' D' E F G H I *)
    exists J.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    split; CongA.
(* Goal: @InAngle Tn J C B A' *)
    apply l11_24; apply (in_angle_reverse A); auto.
(* Goal: @InAngle Tn C A B J *)
    assert (HTwo : TS B C A J).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { apply cop__not_one_side_two_sides; Cop.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (ncol_conga_ncol D E F); CongA.
    }
(* Goal: @InAngle Tn C A B J *)
    destruct HTwo as [_ [_ [X [HXCol HXBet]]]].
(* Goal: @SAMS Tn A B C A B C *)
    repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn F'1 X A) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X C))) *)
    exists X.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
    split; auto.
(* Goal: or (@eq (@Tpoint Tn) X B) (@Out Tn B X C) *)
    elim (eq_dec_points B X); auto.
(* Goal: forall _ : not (@eq (@Tpoint Tn) B X), or (@eq (@Tpoint Tn) X B) (@Out Tn B X C) *)
    intro HBX.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    right.
(* Goal: @Out Tn B X C *)
    apply (col_one_side_out B A X C); Col.
(* Goal: @OS Tn B C C1 J *)
    apply invert_one_side.
(* Goal: @OS Tn A B X C *)
    apply (one_side_transitivity A B X J).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { apply out_one_side.
(* Goal: or (not (@Col Tn A B X)) (not (@Col Tn A B J)) *)
(* Goal: @Out Tn A X J *)
      left; intro; apply HNColB; apply (l6_16_1 B X); Col.
(* Goal: @Out Tn A X J *)
      assert (HAX : A<>X) by (intro; treat_equalities; Col).
(* Goal: @SAMS Tn A B C A B C *)
      repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) J A) *)
      intro; treat_equalities; auto.
    }
(* Goal: @OS Tn B C1 C A *)
    apply one_side_symmetry.
(* Goal: @OS Tn C B C1 J *)
    apply cop__not_two_sides_one_side; Col; Cop.
(* Goal: not (@Col Tn J A B) *)
    intro; apply HNColB; apply (l6_16_1 B X); Col; apply (col_transitivity_2 J); Col.
(* Goal: not (@eq (@Tpoint Tn) J A) *)
    intro; treat_equalities; auto.

  - intro Hlea.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
    split; auto.
(* Goal: @LeA Tn B C A C B A' *)
    elim (col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      elim (bet_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { intro HBBet.
(* Goal: and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
        assert (HEOut : Out E D F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
        { assert (Out B C A') by (apply (l6_3_2); repeat split; auto; exists A; repeat split; Between).
(* Goal: @Out Tn E D F *)
          apply (l11_21_a C B A'); auto.
(* Goal: @CongA Tn C B A' D E F *)
          apply lea_asym; auto.
(* Goal: @LeA Tn B C A C B A' *)
          apply l11_31_1; auto.
        }
(* Goal: and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
        split; try left; auto.
(* Goal: @LeA Tn A B C A B J *)
        exists C.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
        split.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
        apply (out_conga C B C D E D); try (apply out_trivial); CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
        split.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
        apply col124__nos; Col.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
        split; Cop.
(* Goal: not (@TS Tn D' E' F' F') *)
        apply not_two_sides_id.
      }
(* Goal: forall _ : not (@Bet Tn A B C), and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
      intro HBNBet.
(* Goal: and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
      assert (HBOut : Out B A C) by (apply not_bet_out; auto).
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: or (@Out Tn E F D) (not (@Bet Tn A B C)) *)
      right; auto.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
      assert (HJ : exists J : Tpoint, CongA D E F C B J) by (apply (angle_construction_3 D E F C B); auto).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
      destruct HJ as [J HJ].
(* Goal: @SumA Tn A B C' D' E F G H I *)
      exists J.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      split; CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: not (@OS Tn B C A A) *)
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
      apply col123__nos; Col.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
      split; Cop.
(* Goal: not (@TS Tn A B C J) *)
      intro HTwo; destruct HTwo as [HBA [HNCol _]]; Col.
    }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
    intro HNColB.
(* Goal: and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
    assert (HNColB' : ~ Col A' B C) by (intro; apply HNColB; apply (l6_16_1 B A'); Col).
(* Goal: @SAMS Tn A B C D' E' F' *)
    elim (col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HNColE.
(* Goal: and (or (@Out Tn E D F) (not (@Bet Tn A B C))) (@ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))))) *)
      assert (HEOut : Out E D F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { apply not_bet_out; auto.
(* Goal: forall _ : @Bet Tn D E F, @SumA Tn A B C D' E' F' K L M *)
        intro HEBet.
(* Goal: False *)
        apply HNColB'.
(* Goal: @Col Tn A' B C *)
        apply bet_col; apply between_symmetry.
(* Goal: @Bet Tn C B A' *)
        apply (bet_lea__bet D E F); auto.
      }
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: or (@Out Tn E D F) (not (@Bet Tn A B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
      left; auto.
(* Goal: @LeA Tn A B C A B J *)
      exists C.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (out_conga C B C D E D); try (apply out_trivial); CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
      apply col124__nos; Col.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
      split; Cop.
(* Goal: not (@TS Tn D' E' F' F') *)
      apply not_two_sides_id.
    }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
    intro HNColE.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: or (@Out Tn B A C) (not (@Bet Tn A B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J A B C) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    right; intro; Col.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    assert (HJ : exists J, CongA D E F C B J /\ TS C B J A) by (apply ex_conga_ts; Col).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    destruct HJ as [J [HCongaJ HTwo]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: @SumA Tn A B C' D' E F G H I *)
    exists J.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    split; CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: not (@OS Tn B C A J) *)
(* Goal: and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J) *)
    apply l9_9; apply l9_2; apply invert_two_sides; auto.
(* Goal: not (@TS Tn A B C J) *)
    elim (col_dec A B J).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HColJ.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
      split; Cop.
(* Goal: not (@TS Tn A B C J) *)
      intro HTwo'.
(* Goal: False *)
      destruct HTwo' as [HBA [HNColC [HNColJ _]]].
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      Col.
    }
(* Goal: forall _ : not (@Col Tn A B J), and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J) *)
    intro HNColJ.
(* Goal: and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J) *)
    assert (HF : ~ TS A' B C J).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { apply l9_9_bis.
(* Goal: @OS Tn B C1 C A *)
      apply one_side_symmetry.
(* Goal: @OS Tn A' B J C *)
      apply (in_angle_one_side); auto.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      intro; apply HNColJ; apply (l6_16_1 B A'); Col.
(* Goal: @InAngle Tn F1 A B F'1 *)
      apply l11_24.
(* Goal: @InAngle Tn J C B A' *)
      destruct Hlea as [K [HInAngle HCongaK]].
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (conga_preserves_in_angle C B A' K C B A' J); CongA.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (conga_trans C B K D E F); CongA.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
      exists A; split; auto.
(* Goal: @TS Tn C B A' A *)
      repeat (split; Col).
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      exists B; split; Between; Col.
    }
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
    split; Cop.
(* Goal: not (@TS Tn A B C J) *)
    intro; apply HF.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply (col_preserves_two_sides A B); Col.
Qed.

Lemma sams_distincts : forall A B C D E F, SAMS A B C D E F ->
   A<>B /\ B<>C /\ D<>E /\ E<>F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @SAMS Tn A B C D E F), @SAMS Tn A B C F E D *)
  intros A B C D E F Hisi.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) D E)) (not (@eq (@Tpoint Tn) E F)))) *)
  destruct Hisi as [HP1 [HP2 [J HJ]]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C A B C *)
  repeat split; auto.
Qed.

Lemma sams_sym : forall A B C D E F, SAMS A B C D E F ->
   SAMS D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @SAMS Tn A B C D E F), @SAMS Tn A B C F E D *)
  intros A B C D E F Hisi.
(* Goal: @SAMS Tn D E F A B C *)
  assert(A<>B/\B<>C/\D<>E/\E<>F) by (apply sams_distincts; auto).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @SAMS Tn D E F A B C *)
  assert(HD' : exists D', Midpoint E D D') by apply symmetric_point_construction.
(* Goal: @SAMS Tn D E F A B C *)
  destruct HD' as [D'].
(* Goal: @SAMS Tn D E F A B C *)
  assert(HA' : exists A', Midpoint B A A') by apply symmetric_point_construction.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  destruct HA' as [A'].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn D E F A B C *)
  apply (sams_chara D E F A B C D'); Between.
(* Goal: @LeA Tn A B C A' B C *)
  apply lea_right_comm.
(* Goal: @LeA Tn A B C D' E F *)
  apply (l11_36 D _ _ A'); Between.
(* Goal: @LeA Tn A B C A' B C *)
  apply lea_right_comm.
(* Goal: @LeA Tn A B C C B A' *)
  apply (sams_chara A); Between.
Qed.

Lemma sams_right_comm : forall A B C D E F, SAMS A B C D E F ->
   SAMS A B C F E D.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @SAMS Tn A B C D E F), @SAMS Tn A B C F E D *)
  intros A B C D E F Hisi.
(* Goal: @SAMS Tn A B C F E D *)
  destruct Hisi as [HAB [HUn [J [HJ1 [HJ2 HJ3]]]]].
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { destruct HUn.
(* Goal: or (@Out Tn E F D) (not (@Bet Tn A B C)) *)
(* Goal: or (@Out Tn E F D) (not (@Bet Tn A B C)) *)
    left; apply l6_6; auto.
(* Goal: or (@Out Tn E F D) (not (@Bet Tn A B C)) *)
    right; auto.
  }
(* Goal: @SumA Tn A B C' D' E F G H I *)
  exists J.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @CongA Tn C B J F E D *)
(* Goal: and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)) *)
  apply conga_right_comm; auto.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
Qed.

Lemma sams_left_comm : forall A B C D E F, SAMS A B C D E F ->
   SAMS C B A D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @SAMS Tn A' B' C' G H I *)
  apply sams_sym.
(* Goal: @SAMS Tn A B C F E D *)
  apply sams_right_comm.
(* Goal: @SAMS Tn A' B' C' G H I *)
  apply sams_sym.
(* Goal: @TriSumA Tn A B C D E F *)
  assumption.
Qed.

Lemma sams_comm : forall A B C D E F, SAMS A B C D E F ->
   SAMS C B A F E D.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @SAMS Tn C B A F E D *)
  apply sams_left_comm.
(* Goal: @SAMS Tn A B C F E D *)
  apply sams_right_comm.
(* Goal: @TriSumA Tn A B C D E F *)
  assumption.
Qed.

Lemma conga2_sams__sams : 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' ->
   SAMS A B C D E F -> SAMS A' B' C' D' E' F'.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @CongA Tn A B C A' B' C') (_ : @CongA Tn D E F D' E' F') (_ : @SAMS Tn A B C D E F), @SAMS Tn A' B' C' D' E' F' *)
  intros A B C D E F A' B' C' D' E' F' HCongaB HCongaE Hisi.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(HA0 : exists A0, Midpoint B A A0) by apply symmetric_point_construction.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  destruct HA0 as [A0].
(* Goal: @SAMS Tn A B C D E F *)
  assert(HA'0 : exists A'0, Midpoint B' A' A'0) by apply symmetric_point_construction.
(* Goal: @SAMS Tn A B C D E F *)
  destruct HA'0 as [A'0].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A' B' C' D' E' F' *)
  apply (sams_chara _ _ _ _ _ _ A'0); Between.
(* Goal: @LeA Tn D' E' F' C' B' A'0 *)
  apply (l11_30 D E F C B A0); try (apply (sams_chara A)); Between.
(* Goal: @CongA Tn C B A0 C' B' A'0 *)
  apply conga_comm.
(* Goal: @CongA Tn A0 B C A'0 B' C' *)
  apply (l11_13 A B C A'); Between.
Qed.

Lemma out546__sams : forall A B C D E F, A <> B -> B <> C -> Out E D F -> SAMS A B C D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Out Tn E D F), @SAMS Tn A B C D E F *)
  intros A B C D E F HAB HBC HOut.
(* Goal: @SAMS Tn A B C D E F *)
  destruct (segment_construction A B A B) as [A' [HBet HCong]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C D E F *)
  apply sams_chara with A'; auto.
(* Goal: @LeA Tn B C A C B A' *)
  apply l11_31_1; auto.
Qed.

Lemma out213__sams : forall A B C D E F, D <> E -> E <> F -> Out B A C -> SAMS A B C D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) D E)) (_ : not (@eq (@Tpoint Tn) E F)) (_ : @Out Tn B A C), @SAMS Tn A B C D E F *)
  intros; apply sams_sym, out546__sams; trivial.
Qed.

Lemma bet_suma__sams : forall A B C D E F G H I, SumA A B C D E F G H I -> Bet G H I ->
  SAMS A B C D E F.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @Bet Tn G H I), @SAMS Tn A B C D E F *)
  intros A B C D E F G H I HSuma HBet.
(* Goal: @SAMS Tn A B C D E F *)
  destruct HSuma as [A' [HConga1 [HNOS [HCop HConga2]]]].
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (bet_conga__bet _ _ _ A B A') in HBet; CongA.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C A B C *)
  repeat split; auto.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  - elim (bet_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HBet'; left.
(* Goal: @Out Tn E D F *)
      apply (l11_21_a C B A'); trivial.
(* Goal: @Out Tn B P C *)
      apply l6_2 with A; Between.
    }
(* Goal: forall _ : not (@Bet Tn A B C), or (@Out Tn E D F) (not (@Bet Tn A B C)) *)
    intro HNBet; auto.
(* Goal: and (@CongA Tn C B F1 D E F) (and (not (@OS Tn B C A F1)) (and (not (@TS Tn A B C F1)) (@Coplanar Tn A B C F1))) *)
  - exists A'; repeat (split; auto).
(* Goal: False *)
(* Goal: False *)
    intro HTS; destruct HTS as [_ []]; assert_cols; Col.
Qed.

Lemma bet__sams : forall A B C P, A <> B -> B <> C -> P <> B -> Bet A B C -> SAMS A B P P B C.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) P B)) (_ : @Bet Tn A B C), @SAMS Tn A B P P B C *)
  intros A B C P HAB HBC HPB HBet.
(* Goal: @SAMS Tn A B P P B C *)
  apply bet_suma__sams with A B C.
(* Goal: @SumA Tn A B P P B C A B C *)
(* Goal: @Bet Tn A B C *)
    apply bet__suma; auto.
(* Goal: @TriSumA Tn A B C D E F *)
    assumption.
Qed.

Lemma suppa__sams : forall A B C D E F, SuppA A B C D E F -> SAMS A B C D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @SuppA Tn A B C D E F), @SAMS Tn A B C D E F *)
  intros A B C D E F [HAB [A' [HBet HCong]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga2_sams__sams A B C C B A'); CongA.
(* Goal: @SAMS Tn A B C C B A' *)
  apply bet__sams; auto.
Qed.

Lemma inangle__sams : forall A B C P, InAngle P A B C -> SAMS A B P P B C.
Proof.
(* Goal: forall (A B C P : @Tpoint Tn) (_ : @InAngle Tn P A B C), @SAMS Tn A B P P B C *)
  intros A B C P HInangle.
(* Goal: @SAMS Tn A B P P B C *)
  assert (Hcopy := HInangle); destruct Hcopy as [HAB [HCB [HPB HX]]].
(* Goal: @SAMS Tn A B C A B C *)
  repeat split; auto.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { destruct (bet_dec A B P) as [HBet|]; [left|auto].
(* Goal: @Out Tn B P C *)
    apply l6_2 with A; Between.
(* Goal: @Bet Tn C B A *)
    destruct HX as [X [HBet1 [HXB|HOut]]]; [subst X; Between|].
(* Goal: @Bet Tn C B A *)
    assert (HBet2 : Bet X B A) by (assert_diffs; apply (l6_2 P); Between; apply l6_6, HOut).
(* Goal: @Bet Tn C B A *)
    eBetween.
  }
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  exists C; split; CongA.
(* Goal: and (not (@OS Tn B P A C)) (and (not (@TS Tn A B P C)) (@Coplanar Tn A B P C)) *)
  destruct (col_dec B P A) as [HCol|HNCol].
(* Goal: and (not (@OS Tn B P A C)) (and (not (@TS Tn A B P C)) (@Coplanar Tn A B P C)) *)
(* Goal: and (not (@OS Tn B P A C)) (and (not (@TS Tn A B P C)) (@Coplanar Tn A B P C)) *)
    repeat split; [apply col123__nos, HCol|intro HTS; destruct HTS as []; Col|Cop].
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
  repeat split; Cop.
  - destruct (col_dec B P C) as [HCol1|HNCol1].
(* Goal: not (@OS Tn B P A C) *)
(* Goal: not (@OS Tn B P A C) *)
      apply col124__nos, HCol1.
(* Goal: not (@OS Tn B P A C) *)
    apply l9_9, invert_two_sides, in_angle_two_sides; Col.
  - destruct (col_dec A B C) as [HCol1|HNCol1].
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      intro HTS; destruct HTS as [_ []]; Col.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply l9_9_bis, in_angle_one_side; Col.
Qed.

End Suma_1.


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:(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

      | H:SumA ?A ?B ?C ?D ?E ?F ?G ?I ?J |- _ =>
      let h := fresh in
      not_exist_hyp6 A B B C D E E F G I I J;
      assert (h := suma_distincts A B C D E F G I J H);decompose [and] h;clear h;clean_reap_hyps
      | H: TriSumA ?A ?B ?C ?D ?E ?F |- _ =>
      let h := fresh in
      not_exist_hyp5 A B B C A C D E E F;
      assert (h := trisuma_distincts A B C D E F H);decompose [and] h;clear h; clean_reap_hyps
      | H:SAMS ?A ?B ?C ?D ?E ?F |- _ =>
      let h := fresh in
      not_exist_hyp4 A B B C D E E F;
      assert (h := sams_distincts A B C D E F H);decompose [and] h;clear 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
 end.

Hint Resolve suma_sym suma_left_comm suma_middle_comm suma_right_comm
             suma_comm ts__suma inangle__suma bet__suma
             sams_right_comm sams_comm sams_left_comm sams_sym
             out213__sams out546__sams bet__sams suppa__sams inangle__sams : suma.

Ltac SumA := eauto with suma.

Section Suma_2.

Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.

(** ABC <= ABC + DEF. *)

Lemma sams_suma__lea123789 : forall A B C D E F G H I, SumA A B C D E F G H I ->
   SAMS A B C D E F -> LeA A B C G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @SAMS Tn A B C D E F), @LeA Tn D E F G H I *)
  intros A B C D E F G H I Hsuma Hisi.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @LeA Tn B C A C B A' *)
  elim(col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HBBet.
(* Goal: @LeA Tn A B C G H I *)
      destruct Hisi as [_[[HEout|]]]; try solve[exfalso; auto].
(* Goal: @LeA Tn A B C C B A1 *)
      apply conga__lea.
(* Goal: @CongA Tn A B C G H I *)
      apply (out546_suma__conga _ _ _ D E F); auto.
    }
(* Goal: forall _ : not (@Bet Tn A B C), @SumA Tn A B C D' E' F' K L M *)
    intro HBout.
(* Goal: @LeA Tn B C A C B A' *)
    apply l11_31_1; auto.
(* Goal: @Out Tn E D F *)
    apply not_bet_out; auto.
  }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
  intro HNColB.
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim(col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HEBet.
(* Goal: @LeA Tn A B C G H I *)
      apply sams_sym in Hisi.
(* Goal: @LeA Tn A B C G H I *)
      destruct Hisi as [_[[HBout|]]]; try solve[exfalso; auto].
(* Goal: @LeA Tn B C A C B A' *)
      apply l11_31_1; auto.
    }
(* Goal: forall _ : not (@Bet Tn D E F), @SumA Tn A B C D' E' F' K L M *)
    intro HEout.
(* Goal: @LeA Tn A B C C B A1 *)
    apply conga__lea.
(* Goal: @CongA Tn A B C G H I *)
    apply (out546_suma__conga _ _ _ D E F); auto.
(* Goal: @Out Tn E D F *)
    apply not_bet_out; auto.
  }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
  intro HNColE.
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim(col_dec G H I).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColH.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec G H I).
(* Goal: forall _ : @Bet Tn G' H' I', @LeA Tn G H I G' H' I' *)
(* Goal: forall _ : not (@Bet Tn G' H' I'), @LeA Tn G H I G' H' I' *)
      apply l11_31_2; auto.
(* Goal: forall _ : not (@Bet Tn G H I), @SumA Tn A B C D' E' F' K L M *)
    intro HHout.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply not_bet_out in HHout; auto.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    exfalso.
(* Goal: False *)
    destruct Hisi as [_ [HUn _]].
(* Goal: False *)
    destruct HUn as [HEout | HBNBet].
(* Goal: False *)
(* Goal: False *)
      apply HNColE; apply col_permutation_4; apply out_col; auto.
(* Goal: False *)
    destruct Hsuma as [J [HJ1 [HJ2 [HJ3 HJ4]]]].
(* Goal: False *)
    apply HJ2.
(* Goal: @OS Tn B C A J *)
    apply conga_sym in HJ4.
(* Goal: @OS Tn B C A J *)
    apply l11_21_a in HJ4; auto.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply (l9_19 _ _ _ _ B); try split; Col.
  }
(* Goal: forall _ : not (@Col Tn G H I), @SAMS Tn A B C D' E' F' *)
  intro HNColH.
(* Goal: @CongA Tn D E F D' E' F' *)
  destruct Hisi as [_ [_ [J [HJ1 [HJ2 [HJ3 HJ4]]]]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn A B C G H I *)
  assert(HNColJ : ~ Col J B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColJ.
(* Goal: False *)
    apply HNColE.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (col_conga_col J B C); CongA.
  }
(* Goal: @LeA Tn A B C G H I *)
  assert(HCongaJ : CongA A B J G H I).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply (suma2__conga A B C D E F); auto.
(* Goal: @SumA Tn A B C' D' E F G H I *)
    exists J.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
    repeat (split; CongA).
  }
(* Goal: @LeA Tn A B C G H I *)
  assert(HNColJ2 : ~ Col J B A).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColJ.
(* Goal: False *)
    apply HNColH.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply (col_conga_col A B J); Col.
  }
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (l11_30 A B C A B J); CongA.
(* Goal: @LeA Tn A B C A B J *)
  exists C.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  split; CongA.
(* Goal: @InAngle Tn C A B J *)
  apply cop__not_one_side_two_sides in HJ2; Cop.
(* Goal: @InAngle Tn C A B J *)
  destruct HJ2 as [a [b [X [HColX HXBet]]]].
(* Goal: @SAMS Tn A B C A B C *)
  repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn F'1 X A) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X C))) *)
  exists X.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  right.
(* Goal: @Out Tn B X C *)
  assert(HNColX : ~Col X A B).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro.
(* Goal: False *)
    apply HNColJ2.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply col_permutation_1; apply (col_transitivity_1 A X); Col.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    intro; subst X; Col.
  }
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
  apply (col_one_side_out _ A); Col.
(* Goal: @OS Tn B C C1 J *)
  apply invert_one_side.
(* Goal: @OS Tn A B X C *)
  apply (one_side_transitivity _ _ _ J).
  - apply out_one_side.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    left; Col.
(* Goal: @Out Tn A X J *)
    apply bet_out; auto.
  - apply one_side_symmetry.
(* Goal: @OS Tn C B C1 J *)
    apply cop__not_two_sides_one_side; Col; Cop.
Qed.

(** DEF <= ABC + DEF. *)

Lemma sams_suma__lea456789 : forall A B C D E F G H I, SumA A B C D E F G H I ->
   SAMS A B C D E F -> LeA D E F G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @SAMS Tn A B C D E F), @LeA Tn D E F G H I *)
  intros A B C D E F G H I Hsuma Hisi.
(* Goal: @LeA Tn D E F G H I *)
  apply (sams_suma__lea123789 D E F A B C G H I); SumA.
Qed.

(** LeA preserves SAMS. *)

Lemma sams_lea2__sams : forall A B C D E F A' B' C' D' E' F',
   SAMS A' B' C' D' E' F' -> LeA A B C A' B' C' -> LeA D E F D' E' F' ->
   SAMS A B C D E F.
Proof.
(* Goal: forall (A B C D E F A' B' C' D' E' F' : @Tpoint Tn) (_ : @SAMS Tn A' B' C' D' E' F') (_ : @LeA Tn A B C A' B' C') (_ : @LeA Tn D E F D' E' F'), @SAMS Tn A B C D E F *)
  intros A B C D E F A' B' C' D' E' F' Hisi HleaB HleaE.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(HA0 : exists A0, Midpoint B A A0) by apply symmetric_point_construction.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  destruct HA0 as [A0].
(* Goal: @SAMS Tn A B C D E F *)
  assert(HA'0 : exists A'0, Midpoint B' A' A'0) by apply symmetric_point_construction.
(* Goal: @SAMS Tn A B C D E F *)
  destruct HA'0 as [A'0].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C D E F *)
  apply (sams_chara _ _ _ _ _ _ A0); Between.
(* Goal: @LeA Tn D E F C B A0 *)
  apply (lea_trans D E F D' E' F'); auto.
(* Goal: @LeA Tn D' E' F' C B A0 *)
  apply (lea_trans D' E' F' C' B' A'0).
  - apply (sams_chara A'); Between.
  - apply lea_comm.
(* Goal: @LeA Tn A'0 B' C' A0 B C *)
    apply (l11_36 A B C A'); Between.
Qed.

Lemma sams_lea456_suma2__lea : forall A B C D E F G H I D' E' F' G' H' I',
   LeA D E F D' E' F' -> SAMS A B C D' E' F' -> SumA A B C D E F G H I ->
   SumA A B C D' E' F' G' H' I' -> LeA G H I G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I D' E' F' G' H' I' : @Tpoint Tn) (_ : @LeA Tn D E F D' E' F') (_ : @SAMS Tn A B C D' E' F') (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A B C D' E' F' G' H' I'), @LeA Tn G H I G' H' I' *)
  intros A B C D E F G H I D' E' F' G' H' I' Hlea Hisi' Hsuma Hsuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn G H I G' H' I' *)
  elim(out_dec E' D' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HE'out.
(* Goal: @LeA Tn A B C C B A1 *)
    apply conga__lea.
(* Goal: @CongA Tn G H I G' H' I' *)
    apply (conga_trans _ _ _ A B C).
(* Goal: @CongA Tn G H I A B C *)
(* Goal: @CongA Tn A B C G' H' I' *)
    apply conga_sym; apply (out546_suma__conga _ _ _ D E F); auto; apply (out_lea__out _ _ _ D' E' F'); auto.
(* Goal: @CongA Tn A B C G' H' I' *)
    apply (out546_suma__conga _ _ _ D' E' F'); auto.
  }
(* Goal: forall _ : not (@Out Tn E' D' F'), @LeA Tn G H I G' H' I' *)
  intro HE'Nout.
(* Goal: @LeA Tn B C A C B A' *)
  elim(col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB.
(* Goal: @LeA Tn G H I G' H' I' *)
    destruct Hisi' as [_ [[HE'out|HBNBet]_]].
(* Goal: @LeA Tn G H I G' H' I' *)
(* Goal: @LeA Tn G H I G' H' I' *)
    exfalso; auto.
(* Goal: @LeA Tn G H I G' H' I' *)
    apply not_bet_out in HColB; auto.
(* Goal: @LeA Tn G H I G' H' I' *)
    apply (l11_30 D E F D' E' F'); auto; apply (out213_suma__conga A B C); auto.
  }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
  intro HNColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  elim(col_dec D' E' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE'.
(* Goal: @LeA Tn G H I G' H' I' *)
    apply sams_sym in Hisi'.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    destruct Hisi' as [_ [[HBout|HE'NBet]_]]; exfalso.
(* Goal: False *)
(* Goal: False *)
    apply HNColB; assert_cols; Col.
(* Goal: False *)
    apply not_bet_out in HColE'; auto.
  }
(* Goal: forall _ : not (@Col Tn D' E' F'), @SumA Tn A B C D' E' F' K L M *)
  intro HNColE'.
(* Goal: @LeA Tn G H I G' H' I' *)
  clear HE'Nout.
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim(col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE.
(* Goal: @LeA Tn G H I G' H' I' *)
    assert(~ Bet D E F) by (intro; apply HNColE'; apply bet_col; apply (bet_lea__bet D E F); auto).
(* Goal: @LeA Tn G H I G' H' I' *)
    apply (l11_30 A B C G' H' I'); try (apply conga_refl); auto.
(* Goal: @LeA Tn A B C G' H' I' *)
    apply (sams_suma__lea123789 _ _ _ D' E' F'); auto.
(* Goal: @CongA Tn A B C G H I *)
    apply (out546_suma__conga _ _ _ D E F); auto.
(* Goal: @Out Tn E D F *)
    apply not_bet_out; auto.
  }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
  intro HNColE.
(* Goal: @LeA Tn G H I G' H' I' *)
  elim(col_dec G' H' I').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColH'.
(* Goal: @LeA Tn G H I G' H' I' *)
    elim(bet_dec G' H' I').
(* Goal: forall _ : @Bet Tn G' H' I', @LeA Tn G H I G' H' I' *)
(* Goal: forall _ : not (@Bet Tn G' H' I'), @LeA Tn G H I G' H' I' *)
    apply l11_31_2; auto.
(* Goal: forall _ : not (@Bet Tn G' H' I'), @LeA Tn G H I G' H' I' *)
    intro HH'out.
(* Goal: @LeA Tn G H I G' H' I' *)
    apply not_bet_out in HH'out; auto.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    exfalso.
(* Goal: False *)
    apply HNColB.
(* Goal: @Col Tn A B C *)
    apply col_permutation_4.
(* Goal: @Col Tn C B A *)
    apply out_col.
(* Goal: @Out Tn B A C *)
    apply (out_lea__out _ _ _ G' H' I'); auto.
(* Goal: @LeA Tn A B C G' H' I' *)
    apply (sams_suma__lea123789 _ _ _ D' E' F'); auto.
  }
(* Goal: forall _ : not (@Col Tn G' H' I'), @LeA Tn G H I G' H' I' *)
  intro HNColH'.
(* Goal: @LeA Tn G H I G' H' I' *)
  destruct Hisi' as [_[_[F'1]]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply(l11_30 _ _ _ _ _ _ D E F C B F'1) in Hlea; CongA.
(* Goal: @LeA Tn G H I G' H' I' *)
  destruct Hlea as [F1].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn G H I G' H' I' *)
  assert(CongA A B F'1 G' H' I').
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
  apply (suma2__conga A B C D' E' F'); auto; exists F'1; repeat (split; CongA).
(* Goal: @LeA Tn G H I G' H' I' *)
  assert(~ Col A B F'1) by (apply (ncol_conga_ncol G' H' I'); CongA).
(* Goal: @LeA Tn G H I G' H' I' *)
  assert(~ Col C B F'1) by (apply (ncol_conga_ncol D' E' F'); CongA).
(* Goal: @LeA Tn G H I G' H' I' *)
  apply (l11_30 A B F1 A B F'1); auto.
  - exists F1.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    split; CongA.
(* Goal: @InAngle Tn F1 A B F'1 *)
    apply l11_24.
(* Goal: @InAngle Tn F1 F'1 B A *)
    apply (in_angle_trans _ _ _ C).
(* Goal: @InAngle Tn F1 F'1 B C *)
(* Goal: @InAngle Tn C F'1 B A *)
    apply l11_24; auto.
(* Goal: @InAngle Tn C F'1 B A *)
    assert(Hts : TS B C A F'1) by (apply cop__not_one_side_two_sides; Col; Cop).
(* Goal: @InAngle Tn C F'1 B A *)
    destruct Hts as [_ [_ [X]]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    spliter.
(* Goal: @SAMS Tn A B C A B C *)
    repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn F'1 X A) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X C))) *)
    exists X.
(* Goal: and (@Bet Tn F'1 X A) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X C)) *)
    split; Between.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    right.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply (col_one_side_out _ A); Col.
(* Goal: @OS Tn B C C1 J *)
    apply invert_one_side.
(* Goal: @OS Tn A B X C *)
    apply (one_side_transitivity _ _ _ F'1); auto.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      apply out_one_side; Col; apply bet_out; auto; intro; subst A; Col.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply one_side_symmetry; apply cop__not_two_sides_one_side; Col.

  - apply (suma2__conga A B C D E F); auto.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    exists F1.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
    repeat (split; CongA).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { apply l9_9.
(* Goal: @TS Tn B C A J *)
      apply l9_2.
(* Goal: @TS Tn B C F1 A *)
      apply (l9_8_2 _ _ F'1).
(* Goal: @TS Tn B C A C1 *)
        apply l9_2; apply cop__not_one_side_two_sides; Col; Cop.
(* Goal: @OS Tn B C1 C A *)
      apply invert_one_side; apply one_side_symmetry.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      apply in_angle_one_side; Col.
(* Goal: not (@Col Tn B C F1) *)
      apply not_col_permutation_4; apply (ncol_conga_ncol D E F); auto.
    }
(* Goal: @Coplanar Tn A B C F1 *)
    apply coplanar_perm_12, coplanar_trans_1 with F'1; Col; Cop.
Qed.

Lemma sams_lea123_suma2__lea : forall A B C D E F G H I A' B' C' G' H' I',
   LeA A B C A' B' C' -> SAMS A' B' C' D E F -> SumA A B C D E F G H I ->
   SumA A' B' C' D E F G' H' I' -> LeA G H I G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' G' H' I' : @Tpoint Tn) (_ : @LeA Tn A B C A' B' C') (_ : @SAMS Tn A' B' C' D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D E F G' H' I'), @LeA Tn G H I G' H' I' *)
  intros A B C D E F G H I A' B' C'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LeA Tn G H I G' H' I' *)
  apply (sams_lea456_suma2__lea D E F A B C _ _ _ A' B' C'); SumA.
Qed.

(** SumA preserves LeA. *)

Lemma sams_lea2_suma2__lea : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LeA A B C A' B' C' -> LeA D E F D' E' F' -> SAMS A' B' C' D' E' F' ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LeA G H I G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LeA Tn A B C A' B' C') (_ : @LeA Tn D E F D' E' F') (_ : @SAMS Tn A' B' C' D' E' F') (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LeA Tn G H I G' H' I' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I' HleaB HleaD Hisi' Hsuma Hsuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn G H I G' H' I' *)
  assert(Haux := ex_suma A B C D' E' F').
(* Goal: @LeA Tn G H I G' H' I' *)
  destruct Haux as [G'' [H'' [I'']]]; auto.
(* Goal: @LeA Tn G H I G' H' I' *)
  apply (lea_trans _ _ _ G'' H'' I'').
  - apply (sams_lea456_suma2__lea A B C D E F _ _ _ D' E' F'); auto.
(* Goal: @SAMS Tn A' B' C' D E F *)
    apply (sams_lea2__sams _ _ _ _ _ _ A' B' C' D' E' F'); Lea.
  - apply (sams_lea123_suma2__lea A B C D' E' F' _ _ _ A' B' C'); auto.
Qed.

(** Unicity of the difference of angles. *)

Lemma sams2_suma2__conga456 : forall A B C D E F D' E' F' G H I,
   SAMS A B C D E F -> SAMS A B C D' E' F' ->
   SumA A B C D E F G H I -> SumA A B C D' E' F' G H I ->
   CongA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F D' E' F' G H I : @Tpoint Tn) (_ : @SAMS Tn A B C D E F) (_ : @SAMS Tn A B C D' E' F') (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A B C D' E' F' G H I), @CongA Tn D E F D' E' F' *)
  intros A B C D E F D' E' F' G H I Hisi Hisi' Hsuma Hsuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn B C A C B A' *)
  elim(col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HBBet.
(* Goal: @CongA Tn D E F D' E' F' *)
      destruct Hisi as [_ [[HEout|]_]]; try solve [exfalso; Between].
(* Goal: @CongA Tn D E F D' E' F' *)
      destruct Hisi' as [_ [[HE'out|]_]]; try solve [exfalso; Between].
(* Goal: @CongA Tn D E F D' E' F' *)
      apply l11_21_b; auto.
    }
(* Goal: forall _ : not (@Bet Tn A B C), @SumA Tn A B C D' E' F' K L M *)
    intro HBout.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply not_bet_out in HBout; auto.
(* Goal: @CongA Tn A B J A B J' *)
    apply (conga_trans _ _ _ G H I).
    - apply (out213_suma__conga A B C); auto.
(* Goal: @CongA Tn G H I A B C *)
    - apply conga_sym.
(* Goal: @CongA Tn D E F A' B' C' *)
      apply (out213_suma__conga A B C); auto.
  }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
  intro HNColB.
(* Goal: @CongA Tn D E F D' E' F' *)
  destruct Hisi as [_[_[J [HJ1 [HJ2 [HJ3 HJ4]]]]]].
(* Goal: @CongA Tn D E F D' E' F' *)
  destruct Hisi' as [_[_[J' [HJ'1 [HJ'2 [HJ'3 HJ'4]]]]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn D E F D' E' F' *)
  apply (conga_trans _ _ _ C B J); try solve [apply conga_sym; auto].
(* Goal: @CongA Tn C B J D' E' F' *)
  apply (conga_trans _ _ _ C B J'); auto.
(* Goal: @CongA Tn C B J C B J' *)
  assert(CongA A B J A B J').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply (conga_trans _ _ _ G H I).
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
      apply (suma2__conga A B C D E F); auto; exists J; repeat (split; CongA).
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
    apply (suma2__conga A B C D' E' F'); auto; exists J'; repeat (split; CongA).
  }
(* Goal: @CongA Tn C B J C B J' *)
  assert(HJJ' : Out B J J' \/ TS A B J J').
(* Goal: or (@Out Tn B J' J) (@TS Tn C1 B J' J) *)
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    apply conga_cop__or_out_ts; auto.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply coplanar_trans_1 with C; Cop; Col.
(* Goal: @CongA Tn C B J C B J' *)
  destruct HJJ' as [Hout|Hts].
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  - apply (out_conga C B J C B J); try (apply out_trivial); CongA.
  - exfalso.
(* Goal: False *)
    apply HJ'3.
(* Goal: @TS Tn A B C J' *)
    apply (l9_8_2 _ _ J); auto.
(* Goal: @OS Tn B C1 C A *)
    apply one_side_symmetry.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply cop__not_two_sides_one_side; Col.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply two_sides_not_col in Hts; Col.
Qed.

(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(** Unicity of the difference on the left. *)

Lemma sams2_suma2__conga123 : forall A B C A' B' C' D E F G H I,
   SAMS A B C D E F -> SAMS A' B' C' D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D E F G H I ->
   CongA A B C A' B' C'.
Proof.
(* Goal: forall (A B C A' B' C' D E F G H I : @Tpoint Tn) (_ : @SAMS Tn A B C D E F) (_ : @SAMS Tn A' B' C' D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D E F G H I), @CongA Tn A B C A' B' C' *)
  intros A B C A' B' C' D E F G H I Hisi Hisi' Hsuma Hsuma'.
(* Goal: @CongA Tn A B C A' B' C' *)
  apply (sams2_suma2__conga456 D E F _ _ _ _ _ _ G H I); SumA.
Qed.

Lemma suma_assoc_1 : forall A B C D E F G H I K L M A' B' C' D' E' F',
   SAMS A B C D E F -> SAMS D E F G H I ->
   SumA A B C D E F A' B' C' -> SumA D E F G H I D' E' F' ->
   SumA A' B' C' G H I K L M -> SumA A B C D' E' F' K L M.
Proof.
(* Goal: forall (A B C D E F G H I K L M A' B' C' D' E' F' : @Tpoint Tn) (_ : @SAMS Tn A B C D E F) (_ : @SAMS Tn D E F G H I) (_ : @SumA Tn A B C D E F A' B' C') (_ : @SumA Tn D E F G H I D' E' F') (_ : @SumA Tn A' B' C' G H I K L M), @SumA Tn A B C D' E' F' K L M *)
  intros A B C D E F G H I K L M A' B' C' D' E' F' HisiBE HisiEH HsBE HsEH HsB'H.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(HA0 : exists A0, Midpoint B A A0) by apply symmetric_point_construction.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  destruct HA0 as [A0].
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(HD0 : exists D0, Midpoint E D D0) by apply symmetric_point_construction.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  destruct HD0 as [D0].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn B C A C B A' *)
  elim(col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HBBet.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      destruct HisiBE as [_ [[HEout | HBNBet] HJ]]; try solve [exfalso; Between].
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      apply (conga3_suma__suma A' B' C' G H I K L M); try (apply conga_refl); auto.
(* Goal: @CongA Tn A B C G H I *)
      apply conga_sym; apply (out546_suma__conga _ _ _ D E F); auto.
(* Goal: @CongA Tn C A B P Q R *)
      apply (out213_suma__conga D E F); auto.
    }
(* Goal: forall _ : not (@Bet Tn A B C), @SumA Tn A B C D' E' F' K L M *)
    intro HBout.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply not_bet_out in HBout; auto.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    assert(Hexsuma : exists K0 L0 M0, SumA A B C D' E' F' K0 L0 M0) by (apply ex_suma; auto).
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    destruct Hexsuma as [K0 [L0 [M0]]].
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    apply (conga3_suma__suma A B C D' E' F' K0 L0 M0); try (apply conga_refl); auto.
(* Goal: @CongA Tn K0 L0 M0 K L M *)
    apply (conga_trans _ _ _ D' E' F').
(* Goal: @CongA Tn D E F A' B' C' *)
    apply conga_sym; apply (out213_suma__conga A B C); auto.
(* Goal: @CongA Tn C B J D' E' F' *)
    apply (suma2__conga D E F G H I); auto.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    apply (conga3_suma__suma A' B' C' G H I K L M); try (apply conga_refl); auto.
(* Goal: @CongA Tn G H I A B C *)
    apply conga_sym.
(* Goal: @CongA Tn D E F A' B' C' *)
    apply (out213_suma__conga A B C); auto.
  }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
  intro HNColB.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(~ Col C B A0) by (intro; apply HNColB; apply (l6_16_1 _ A0); Col).
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim(col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HEBet.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      destruct HisiEH as [_ [[HHout | HENBet] HJ]]; try solve [exfalso; Between].
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      apply (conga3_suma__suma A B C D E F A' B' C'); try (apply conga_refl); try (apply (out546_suma__conga _ _ _ G H I)); auto.
    }
(* Goal: forall _ : not (@Bet Tn D E F), @SumA Tn A B C D' E' F' K L M *)
    intro HEout.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply not_bet_out in HEout; auto.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    apply (conga3_suma__suma A' B' C' G H I K L M); try (apply conga_refl); auto.
(* Goal: @CongA Tn A B C G H I *)
    apply conga_sym; apply (out546_suma__conga _ _ _ D E F); auto.
(* Goal: @CongA Tn C A B P Q R *)
    apply (out213_suma__conga D E F); auto.
  }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
  intro HNColE.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(~ Col F E D0) by (intro; apply HNColE; apply (l6_16_1 _ D0); Col).
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim(col_dec G H I).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColH.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec G H I).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HHBet.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      apply sams_sym in HisiEH.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      destruct HisiEH as [_ [[HEout | HHNBet] HJ]]; try solve [exfalso; Between].
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      exfalso.
(* Goal: False *)
      apply HNColE.
(* Goal: @Col Tn A B C *)
      apply col_permutation_4.
(* Goal: @Col Tn E D F *)
      apply out_col; auto.
    }
(* Goal: forall _ : not (@Bet Tn G H I), @SumA Tn A B C D' E' F' K L M *)
    intro HHout.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply not_bet_out in HHout; auto.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    apply (conga3_suma__suma A B C D E F A' B' C'); try (apply conga_refl); try (apply (out546_suma__conga _ _ _ G H I)); auto.
  }
(* Goal: forall _ : not (@Col Tn G H I), @SAMS Tn A B C D' E' F' *)
  intro HNColH.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(~ OS B C A A0).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply l9_9.
(* Goal: @TS Tn B C A A' *)
    repeat split; Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C1) (@Bet Tn C T C0)) *)
    exists B.
(* Goal: and (@Col Tn B B C1) (@Bet Tn C B C0) *)
    split; Col; Between.
  }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(HisiA0: SAMS A B C A0 B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { split; auto.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: False *)
(* Goal: False *)
      right; intro; assert_cols; Col.
(* Goal: @SumA Tn A B C C B A0 A B A0 *)
    exists A0.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
    repeat (split; CongA); Cop.
(* Goal: not (@TS Tn D E F D0) *)
    unfold TS.
(* Goal: False *)
(* Goal: False *)
    intro; spliter; assert_cols; Col.
  }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(~ OS E F D D0).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply l9_9.
(* Goal: @TS Tn B C A A' *)
    repeat split; Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T E F) (@Bet Tn D T D0)) *)
    exists E.
(* Goal: and (@Col Tn B B C1) (@Bet Tn C B C0) *)
    split; Col; Between.
  }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(HisiD0: SAMS D E F D0 E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { split; auto.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: False *)
(* Goal: False *)
      right; intro; assert_cols; Col.
(* Goal: @SumA Tn D E F D0 E F D' E' F' *)
    exists D0.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
    repeat (split; CongA); Cop.
(* Goal: not (@TS Tn D E F D0) *)
    unfold TS.
(* Goal: False *)
(* Goal: False *)
    intro; spliter; assert_cols; Col.
  }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  elim(col_dec A' B' C').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB'.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec A' B' C').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HB'Bet.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      elim(col_dec D' E' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { intro HColE'.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
        elim(bet_dec D' E' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
        { intro HE'Bet.
(* Goal: @SumA Tn B2 C2 A2 A B C D E F *)
          apply suma_sym.
(* Goal: @SumA Tn D' E' F' A B C K L M *)
          apply (conga3_suma__suma A' B' C' G H I K L M); try (apply conga_refl); auto; try solve [apply conga_line; auto].
(* Goal: @CongA Tn G H I A B C *)
          apply conga_sym.
(* Goal: @CongA Tn A B C G H I *)
          apply (conga_trans _ _ _ D0 E F).
          - apply (sams2_suma2__conga123 _ _ _ _ _ _ D E F A' B' C'); SumA.
(* Goal: @SumA Tn B2 C2 A2 A B C D E F *)
            apply suma_sym.
(* Goal: @SumA Tn D E F D0 E F D' E' F' *)
            exists D0.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
            split.
(* Goal: @CongA Tn F E D0 D0 E F *)
(* Goal: and (not (@OS Tn E F D D0)) (and (@Coplanar Tn D E F D0) (@CongA Tn D E D0 D' E' F')) *)
            apply conga_pseudo_refl; auto.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
            split; auto.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
            split; Cop.
(* Goal: @CongA Tn C B A D E F *)
(* Goal: and (not (@OS Tn B C A A)) (and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A)) *)
            apply conga_line; Between.
          - apply (sams2_suma2__conga456 D E F _ _ _ _ _ _ D' E' F'); auto.
(* Goal: @SumA Tn D E F D0 E F D' E' F' *)
            exists D0.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
            split.
(* Goal: @CongA Tn F E D0 D0 E F *)
(* Goal: and (not (@OS Tn E F D D0)) (and (@Coplanar Tn D E F D0) (@CongA Tn D E D0 D' E' F')) *)
            apply conga_pseudo_refl; auto.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
            split; auto.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
            split; Cop.
(* Goal: @CongA Tn C B A D E F *)
(* Goal: and (not (@OS Tn B C A A)) (and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A)) *)
            apply conga_line; Between.
        }
(* Goal: forall _ : not (@Bet Tn D' E' F'), @SumA Tn A B C D' E' F' K L M *)
        intro HE'out.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
        apply not_bet_out in HE'out; auto.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
        exfalso.
(* Goal: False *)
        apply HNColE.
(* Goal: @Col Tn A B C *)
        apply col_permutation_4.
(* Goal: @Col Tn C B A *)
        apply out_col.
(* Goal: @Out Tn E D F *)
        apply (out_lea__out _ _ _ D' E' F'); auto.
(* Goal: @LeA Tn D E F D' E' F' *)
        apply (sams_suma__lea123789 _ _ _ G H I); auto.
      }
(* Goal: forall _ : not (@Col Tn D' E' F'), @SumA Tn A B C D' E' F' K L M *)
      intro HNColE'.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      assert(CongA D E F C B A0).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { apply (sams2_suma2__conga456 A B C _ _ _ _ _ _ A' B' C'); auto.
(* Goal: @SAMS Tn A B C C B A0 *)
(* Goal: @SumA Tn A B C C B A0 A' B' C' *)
        apply (sams_chara _ _ _ _ _ _ A0); try (apply lea_refl); Between.
(* Goal: @SumA Tn A B C C B A0 A' B' C' *)
        apply (conga3_suma__suma A B C C B A0 A B A0); try (apply conga_refl); try (apply conga_line); Between.
(* Goal: @SumA Tn A B C C B A0 A B A0 *)
        exists A0.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
        repeat (split; CongA); Cop.
      }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      assert(HJ : SAMS C B A0 G H I) by (apply (conga2_sams__sams D E F G H I); try (apply conga_refl); auto).
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      destruct HJ as [_ [_ [J]]].
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      destruct HisiEH as [_ [_ [F1]]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
      spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
      assert_diffs.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      assert(CongA C B J D' E' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { apply (conga_trans _ _ _ D E F1); auto.
        - apply (l11_22 _ _ _ A0 _ _ _ F); auto.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
          split.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
            left; split; apply cop__not_one_side_two_sides; Cop; apply (ncol_conga_ncol G H I); CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
          split.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
          { apply (sams2_suma2__conga456 A B C _ _ _ _ _ _ A' B' C'); auto.
(* Goal: @SAMS Tn A B C C B A0 *)
(* Goal: @SumA Tn A B C C B A0 A' B' C' *)
            apply (sams_chara _ _ _ _ _ _ A0); try (apply lea_refl); Between.
(* Goal: @SumA Tn A B C C B A0 A' B' C' *)
            apply (conga3_suma__suma A B C C B A0 A B A0); try (apply conga_refl); try (apply conga_line); Between.
(* Goal: @SumA Tn A B C C B A0 A B A0 *)
            exists A0.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
            repeat (split; CongA); Cop.
          }
(* Goal: @CongA Tn A0 B J F E F1 *)
          apply (conga_trans _ _ _ G H I); auto.
(* Goal: @CongA Tn G H I F E F1 *)
          apply conga_sym; auto.

        - apply (suma2__conga D E F G H I); auto.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
          exists F1.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
          repeat (split; CongA).
      }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      apply (conga3_suma__suma A B C D' E' F' A B J); try (apply conga_refl); auto.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      { exists J.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
        split.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
        { apply (suma2__conga C B A0 G H I).
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
          exists J; repeat (split; CongA).
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
          apply (conga3_suma__suma D E F G H I D' E' F'); CongA.
        }
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
        split.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
        { apply l9_9.
(* Goal: @TS Tn B C A J *)
          apply invert_two_sides; apply l9_2.
(* Goal: @TS Tn C B J A *)
          apply (l9_8_2 _ _ A0).
(* Goal: and (@Col Tn B B C1) (@Bet Tn C B C0) *)
            repeat split; Col; exists B; split; Col; Between.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
          apply cop__not_two_sides_one_side; Col.
(* Goal: not (@Col Tn J C B) *)
          apply not_col_permutation_2.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
          apply (ncol_conga_ncol D' E' F'); CongA.
        }
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
        split; CongA.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
        apply coplanar_perm_12, coplanar_trans_1 with A0; Cop; Col.
      }
(* Goal: @CongA Tn A B J K L M *)
      apply (suma2__conga A' B' C' G H I); auto.
(* Goal: @SumA Tn A' B' C' G H I A B J *)
      apply (conga3_suma__suma A B A0 A0 B J A B J); try (apply conga_refl); auto; try (apply conga_line); Between.
(* Goal: @SumA Tn A B C' D' E F G H I *)
      exists J.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
      repeat (split; CongA); Cop.
(* Goal: not (@OS Tn B C A A) *)
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
      apply col123__nos; Col.
    }
(* Goal: forall _ : not (@Bet Tn A' B' C'), @SumA Tn A B C D' E' F' K L M *)
    intro HB'out.
(* Goal: False *)
    apply not_bet_out in HB'out; auto.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    exfalso.
(* Goal: False *)
    apply HNColB.
(* Goal: @Col Tn A B C *)
    apply col_permutation_4.
(* Goal: @Col Tn C B A *)
    apply out_col.
(* Goal: @Out Tn B A C *)
    apply (out_lea__out _ _ _ A' B' C'); auto.
(* Goal: @LeA Tn A B C A' B' C' *)
    apply (sams_suma__lea123789 _ _ _ D E F); auto.
  }
(* Goal: forall _ : not (@Col Tn A' B' C'), @SumA Tn A B C D' E' F' K L M *)
  intro HNColB'.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  clear dependent A0.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  destruct HisiBE as [_ [_ [C1 HC1]]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(CongA A' B' C' A B C1).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply (suma2__conga A B C D E F); auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (conga3_suma__suma A B C C B C1 A B C1); CongA.
(* Goal: @SumA Tn A B C C B C1 A B C1 *)
    exists C1.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
    repeat (split; CongA).
  }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(OS B C1 C A).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply one_side_symmetry.
(* Goal: @OS Tn B C1 A C *)
    apply os_ts1324__os.
    - apply invert_one_side.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      apply cop__not_two_sides_one_side; Col.
(* Goal: not (@Col Tn C1 A B) *)
      apply not_col_permutation_2; apply (ncol_conga_ncol A' B' C'); auto.
(* Goal: @TS Tn B C A C1 *)
    - apply cop__not_one_side_two_sides; Col; Cop.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (ncol_conga_ncol D E F); CongA.
  }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  elim(col_dec D' E' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE'.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    elim(bet_dec D' E' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HE'Bet.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      assert(HC0 : exists C0, Midpoint B C C0) by apply symmetric_point_construction.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      destruct HC0 as [C0].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
      spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
      assert_diffs.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      assert(TS B C1 C C0).
(* Goal: @SAMS Tn A B C A B C *)
      { repeat split; auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
        apply (ncol_conga_ncol D E F); CongA.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
        intro; apply HNColE; apply (col_conga_col C B C1); CongA; apply (l6_16_1 _ C0); Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C1) (@Bet Tn C T C0)) *)
        exists B.
(* Goal: and (@Col Tn B B C1) (@Bet Tn C B C0) *)
        split; Col; Between.
      }
(* Goal: @SumA Tn A B C D' E' F' K L M *)
      apply (conga3_suma__suma A B C C B C0 A B C0); try (apply conga_refl); auto.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
        exists C0; repeat (split; CongA); Cop; apply col124__nos; Col.
(* Goal: @CongA Tn C B A D E F *)
(* Goal: and (not (@OS Tn B C A A)) (and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A)) *)
        apply conga_line; Between.
(* Goal: @CongA Tn A B J K L M *)
      apply (suma2__conga A' B' C' G H I); auto.
(* Goal: @SumA Tn A' B' C' G H I A B C0 *)
      apply (conga3_suma__suma A B C1 C1 B C0 A B C0).
      - exists C0; repeat (split; CongA).
(* Goal: not (@OS Tn B C1 A C0) *)
(* Goal: @Coplanar Tn A B C1 C0 *)
          apply l9_9; apply (l9_8_2 _ _ C); auto.
(* Goal: @Coplanar Tn A B C1 C0 *)
        apply coplanar_perm_2, col_cop__cop with C; Col; Cop.
      - apply conga_sym; assumption.
      - apply (sams2_suma2__conga456 C B C1 _ _ _ _ _ _ C B C0); auto.
(* Goal: @SAMS Tn C B C1 C1 B C0 *)
(* Goal: @SAMS Tn C B C1 G H I *)
(* Goal: @SumA Tn C B C1 C1 B C0 C B C0 *)
(* Goal: @SumA Tn C B C1 G H I C B C0 *)
          apply (sams_chara _ _ _ _ _ _ C0); try (apply lea_refl); Between.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
          apply (conga2_sams__sams D E F G H I); CongA.
(* Goal: @SumA Tn C B C1 C1 B C0 C B C0 *)
(* Goal: @SumA Tn C B C1 G H I C B C0 *)
          exists C0; repeat (split; CongA); Cop; apply l9_9; auto.
(* Goal: @SumA Tn C B C1 G H I C B C0 *)
        apply (conga3_suma__suma D E F G H I D' E' F'); try (apply conga_refl); try (apply conga_sym); auto.
(* Goal: @CongA Tn C B A D E F *)
(* Goal: and (not (@OS Tn B C A A)) (and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A)) *)
        apply conga_line; Between.
      - apply conga_refl; auto.
    }
(* Goal: forall _ : not (@Bet Tn D' E' F'), @SumA Tn A B C D' E' F' K L M *)
    intro HE'out.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
    apply not_bet_out in HE'out; auto.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    exfalso.
(* Goal: False *)
    apply HNColE.
(* Goal: @Col Tn A B C *)
    apply col_permutation_4.
(* Goal: @Col Tn C B A *)
    apply out_col.
(* Goal: @Out Tn E D F *)
    apply (out_lea__out _ _ _ D' E' F'); auto.
(* Goal: @LeA Tn D E F D' E' F' *)
    apply (sams_suma__lea123789 _ _ _ G H I); auto.
  }
(* Goal: forall _ : not (@Col Tn D' E' F'), @SumA Tn A B C D' E' F' K L M *)
  intro HNColE'.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  clear dependent D0.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(HJ : SAMS C B C1 G H I) by (apply (conga2_sams__sams D E F G H I); CongA).
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  destruct HJ as [_ [_ [J]]].
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  destruct HisiEH as [_ [_ [F1 HF1]]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  assert(CongA C B J D' E' F').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply (conga_trans _ _ _ D E F1); auto.
    - apply (l11_22 _ _ _ C1 _ _ _ F); auto.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
        left; split; apply cop__not_one_side_two_sides; Cop;
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
        [apply (ncol_conga_ncol D E F)|apply (ncol_conga_ncol G H I)..]; CongA.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      CongA.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (conga_trans _ _ _ G H I); CongA.

    - apply (suma2__conga D E F G H I); auto.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
      exists F1.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
      repeat (split; CongA).
  }
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert (~ Col C B C1) by (apply (ncol_conga_ncol D E F); CongA).
(* Goal: @SumA Tn A B C D' E' F' K L M *)
  apply (conga3_suma__suma A B C C B J A B J); try (apply conga_refl); auto.
(* Goal: @SumA Tn A B C' D' E F G H I *)
  - exists J.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
    repeat (split; CongA).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { apply l9_9.
(* Goal: @TS Tn B C A J *)
      apply l9_2.
(* Goal: @TS Tn B C J A *)
      apply (l9_8_2 _ _ C1).
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply l9_2; apply cop__not_one_side_two_sides; Cop; apply (ncol_conga_ncol D E F); CongA.
(* Goal: @OS Tn B C C1 J *)
      apply invert_one_side.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      apply cop__not_two_sides_one_side; Cop; Col.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply not_col_permutation_2, (ncol_conga_ncol D' E' F'); CongA.
    }
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply coplanar_perm_12, coplanar_trans_1 with C1; Cop; Col.
  - apply (suma2__conga A' B' C' G H I); auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (conga3_suma__suma A B C1 C1 B J A B J); CongA.
(* Goal: @SumA Tn A B C' D' E F G H I *)
    exists J.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
    repeat (split; CongA).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { apply l9_9.
(* Goal: @TS Tn B C1 A J *)
      apply (l9_8_2 _ _ C); auto.
(* Goal: @TS Tn B C1 A J' *)
      apply cop__not_one_side_two_sides; Cop.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      apply (ncol_conga_ncol G H I); CongA.
    }
(* Goal: @Coplanar Tn A B C1 J *)
    apply coplanar_perm_12, coplanar_trans_1 with C; Cop.
Qed.

Lemma suma_assoc_2 : forall A B C D E F G H I K L M A' B' C' D' E' F',
   SAMS A B C D E F -> SAMS D E F G H I ->
   SumA A B C D E F A' B' C' -> SumA D E F G H I D' E' F' ->
   SumA A B C D' E' F' K L M -> SumA A' B' C' G H I K L M.
Proof.
(* Goal: forall (A B C D E F G H I K L M A' B' C' D' E' F' : @Tpoint Tn) (_ : @SAMS Tn A B C D E F) (_ : @SAMS Tn D E F G H I) (_ : @SumA Tn A B C D E F A' B' C') (_ : @SumA Tn D E F G H I D' E' F'), iff (@SumA Tn A' B' C' G H I K L M) (@SumA Tn A B C D' E' F' K L M) *)
  intros A B C D E F G H I K L M A' B' C' D' E' F'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @SumA Tn B2 C2 A2 A B C D E F *)
  apply suma_sym.
(* Goal: @SumA Tn G H I A' B' C' K L M *)
  apply (suma_assoc_1 G H I D E F A B C K L M D' E' F'); SumA.
Qed.

(** Associativity of the sum of angles. *)

Lemma suma_assoc : forall A B C D E F G H I K L M A' B' C' D' E' F',
   SAMS A B C D E F -> SAMS D E F G H I ->
   SumA A B C D E F A' B' C' -> SumA D E F G H I D' E' F' ->
   (SumA A' B' C' G H I K L M <-> SumA A B C D' E' F' K L M).
Proof.
(* Goal: forall (A B C D E F G H I K L M A' B' C' D' E' F' : @Tpoint Tn) (_ : @SAMS Tn A B C D E F) (_ : @SAMS Tn D E F G H I) (_ : @SumA Tn A B C D E F A' B' C') (_ : @SumA Tn D E F G H I D' E' F'), iff (@SumA Tn A' B' C' G H I K L M) (@SumA Tn A B C D' E' F' K L M) *)
  intros A B C D E F G H I K L M A' B' C' D' E' F'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: forall _ : @SumA Tn A' B' C' G H I K L M, @SumA Tn A B C D' E' F' K L M *)
(* Goal: forall _ : @SumA Tn A B C D' E' F' K L M, @SumA Tn A' B' C' G H I K L M *)
    apply (suma_assoc_1 _ _ _ D E F); auto.
(* Goal: forall _ : @SumA Tn A B C D' E' F' K L M, @SumA Tn A' B' C' G H I K L M *)
    apply (suma_assoc_2 _ _ _ D E F); auto.
Qed.

Lemma sams_assoc_1 : forall A B C D E F G H I A' B' C' D' E' F',
   SAMS A B C D E F -> SAMS D E F G H I ->
   SumA A B C D E F A' B' C' -> SumA D E F G H I D' E' F' ->
   SAMS A' B' C' G H I -> SAMS A B C D' E' F'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' : @Tpoint Tn) (_ : @SAMS Tn A B C D E F) (_ : @SAMS Tn D E F G H I) (_ : @SumA Tn A B C D E F A' B' C') (_ : @SumA Tn D E F G H I D' E' F') (_ : @SAMS Tn A' B' C' G H I), @SAMS Tn A B C D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' Hsams1 Hsams2 Hs1 Hs2 Hsams1'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @LeA Tn B C A C B A' *)
  elim(col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColB.
(* Goal: @SAMS Tn A B C D' E' F' *)
    destruct Hsams1 as [_ [[HEout|HBout]_]].
    - apply (conga2_sams__sams A' B' C' G H I); auto.
(* Goal: @CongA Tn A B C G H I *)
      apply conga_sym; apply (out546_suma__conga _ _ _ D E F); auto.
(* Goal: @CongA Tn C A B P Q R *)
      apply (out213_suma__conga D E F); auto.

    - apply not_bet_out in HBout; auto.
(* Goal: @SAMS Tn A' B' C' G H I *)
      apply sams_sym.
(* Goal: @SAMS Tn A B C A B C *)
      repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn F' E' J A B C) (and (not (@OS Tn E' F' D' J)) (and (not (@TS Tn D' E' F' J)) (@Coplanar Tn D' E' F' J)))) *)
      exists F'.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: @CongA Tn F' E' F' A B C *)
(* Goal: and (not (@OS Tn E' F' D' F')) (and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F')) *)
      apply l11_21_b; try (apply out_trivial); auto.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
      split.
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
        apply col124__nos; Col.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
      split; Cop.
(* Goal: not (@TS Tn D' E' F' F') *)
      apply not_two_sides_id.
  }
(* Goal: forall _ : not (@Col Tn A B C), @SAMS Tn A B C D' E' F' *)
  intro HNColB.
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim(col_dec D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColE.
(* Goal: @SAMS Tn A B C D' E' F' *)
    destruct Hsams2 as [_ [[HHout|HEout]_]].
    - apply (conga2_sams__sams A B C D E F); try (apply conga_refl); auto.
(* Goal: @CongA Tn D E F D' E' F' *)
      apply (out546_suma__conga _ _ _ G H I); auto.

    - apply not_bet_out in HEout; auto.
(* Goal: @SAMS Tn A B C D' E' F' *)
      apply (conga2_sams__sams A' B' C' G H I); auto.
(* Goal: @CongA Tn A B C G H I *)
      apply conga_sym; apply (out546_suma__conga _ _ _ D E F); auto.
(* Goal: @CongA Tn C A B P Q R *)
      apply (out213_suma__conga D E F); auto.
  }
(* Goal: forall _ : not (@Col Tn D E F), @SAMS Tn A B C D' E' F' *)
  intro HNColE.
(* Goal: @SAMS Tn A B C D' E' F' *)
  elim(col_dec G H I).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HColH.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply sams_sym in Hsams2.
(* Goal: @SAMS Tn A B C D' E' F' *)
    destruct Hsams2 as [_ [[HEout|HHout]_]].
(* Goal: False *)
(* Goal: False *)
    exfalso; assert_cols; Col.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply not_bet_out in HHout; auto.
(* Goal: @SAMS Tn A B C D' E' F' *)
    apply (conga2_sams__sams A B C D E F); try (apply conga_refl); auto.
(* Goal: @CongA Tn D E F D' E' F' *)
    apply (out546_suma__conga _ _ _ G H I); auto.
  }
(* Goal: forall _ : not (@Col Tn G H I), @SAMS Tn A B C D' E' F' *)
  intro HNColH.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: False *)
(* Goal: False *)
  right; intro; assert_cols; Col.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert(~ Col A' B' C').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    exfalso.
(* Goal: False *)
    destruct Hsams1' as [_ [[|HB'out]_]].
(* Goal: False *)
(* Goal: False *)
    assert_cols; Col.
(* Goal: False *)
    apply not_bet_out in HB'out; auto.
(* Goal: False *)
    apply HNColB.
(* Goal: @Col Tn A B C *)
    apply col_permutation_4.
(* Goal: @Col Tn C B A *)
    apply out_col.
(* Goal: @Out Tn B A C *)
    apply (out_lea__out _ _ _ A' B' C'); auto.
(* Goal: @LeA Tn A B C A' B' C' *)
    apply (sams_suma__lea123789 _ _ _ D E F); auto.
  }
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert(HC1 : exists C1, CongA C B C1 D E F /\ ~ OS B C A C1 /\ ~ TS A B C C1 /\ Coplanar A B C C1).
(* Goal: @ex (@Tpoint Tn) (fun C1 : @Tpoint Tn => and (@CongA Tn C B C1 D E F) (and (not (@OS Tn B C A C1)) (and (not (@TS Tn A B C C1)) (@Coplanar Tn A B C C1)))) *)
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    destruct Hsams1 as [_ []]; auto.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  destruct HC1 as [C1].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert(CongA A B C1 A' B' C') by (apply (suma2__conga A B C D E F); auto; exists C1; repeat (split; CongA)).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert(HJ :exists J, CongA C1 B J G H I /\ ~ OS B C1 C J /\ ~ TS C B C1 J /\ Coplanar C B C1 J).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { apply (conga2_sams__sams _ _ _ _ _ _ C B C1 G H I) in Hsams2; CongA.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C1 B J G H I) (and (not (@OS Tn B C1 C J)) (and (not (@TS Tn C B C1 J)) (@Coplanar Tn C B C1 J)))) *)
    destruct Hsams2 as [_ [_ HJ]]; auto.
  }
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  destruct HJ as [J [HJ1 [HJ2 [HJ3 HJ4]]]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga2_sams__sams _ _ _ _ _ _ A B C1 C1 B J) in Hsams1'; CongA.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  destruct Hsams1' as [_ [_ [J']]].
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  spliter.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert (~ Col A B C1) by (apply (ncol_conga_ncol A' B' C'); CongA).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert (~ Col C B C1) by (apply (ncol_conga_ncol D E F); CongA).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert (Coplanar C1 B A J) by (apply coplanar_trans_1 with C; Cop; Col).
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  assert (HUn : Out B J' J \/ TS C1 B J' J).
(* Goal: or (@Out Tn B J' J) (@TS Tn C1 B J' J) *)
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    apply conga_cop__or_out_ts; auto.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply coplanar_trans_1 with A; Cop; Col.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  destruct HUn as [HJJ'|Hts].
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { exists J.
(* Goal: and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J))) *)
    split; [|repeat split].
    - apply (suma2__conga D E F G H I); auto.
(* Goal: @SumA Tn D E F G H I C B J *)
      apply (conga3_suma__suma C B C1 C1 B J C B J); try (apply conga_refl); auto.
(* Goal: @SumA Tn A B C' D' E F G H I *)
      exists J.
(* Goal: and (@CongA Tn C1 B J C1 B J) (and (not (@OS Tn B C1 C J)) (and (@Coplanar Tn C B C1 J) (@CongA Tn C B J C B J))) *)
      repeat (split; CongA).

    - elim(col_dec C B J).
(* Goal: not (@OS Tn E' F' D' F') *)
(* Goal: and (not (@TS Tn D' E' F' F')) (@Coplanar Tn D' E' F' F') *)
      intro; apply col124__nos; Col.
(* Goal: not (@SAMS Tn A B C D E F) *)
      intro.
(* Goal: not (@OS Tn B C A A') *)
      apply l9_9.
(* Goal: @TS Tn B C A J *)
      apply l9_2.
(* Goal: @TS Tn B C J A *)
      apply (l9_8_2 _ _ C1).
(* Goal: @TS Tn B C A C1 *)
        apply l9_2; apply cop__not_one_side_two_sides; Col; Cop.
(* Goal: @OS Tn B C C1 J *)
      apply invert_one_side.
(* Goal: @OS Tn C B C1 J *)
      apply cop__not_two_sides_one_side; Col; Cop.

    - elim(col_dec A B J).
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
        intro; intro Hts; destruct Hts; spliter; Col.
(* Goal: not (@SAMS Tn A B C D E F) *)
      intro.
(* Goal: not (@TS Tn A B C J) *)
      apply l9_9_bis.
(* Goal: @OS Tn A B C J *)
      apply (one_side_transitivity _ _ _ C1).
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
        apply cop__not_two_sides_one_side; Col.
      apply (one_side_transitivity _ _ _ J');
      [|apply invert_one_side; apply out_one_side; Col].
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      apply cop__not_two_sides_one_side; Col.
(* Goal: not (@Col Tn J' A B) *)
      apply not_col_permutation_2; apply (ncol_conga_ncol A B J); auto.
(* Goal: @CongA Tn A B J A B J' *)
      apply out2__conga; try (apply out_trivial); auto.

    - apply coplanar_trans_1 with C1; Cop; Col.
  }
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  exfalso.
(* Goal: False *)
  apply l9_2 in Hts.
(* Goal: False *)
  apply invert_two_sides in Hts.
(* Goal: False *)
  apply HJ2.
(* Goal: @OS Tn B C1 C J *)
  exists J'.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
(* Goal: @TS Tn B C1 C J' *)
  apply (l9_8_2 _ _ A).
  - apply cop__not_one_side_two_sides; Cop.
(* Goal: not (@Col Tn J' B C1) *)
    apply (ncol_conga_ncol G H I); auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (conga_trans _ _ _ C1 B J); CongA.
  - apply os_ts1324__os.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply invert_one_side; apply cop__not_two_sides_one_side; Col.
(* Goal: @TS Tn B C A C1 *)
    apply cop__not_one_side_two_sides; Col; Cop.
Qed.

Lemma sams_assoc_2 : forall A B C D E F G H I A' B' C' D' E' F',
   SAMS A B C D E F -> SAMS D E F G H I ->
   SumA A B C D E F A' B' C' -> SumA D E F G H I D' E' F' ->
   SAMS A B C D' E' F' -> SAMS A' B' C' G H I.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' : @Tpoint Tn) (_ : @LeA Tn A B C A' B' C') (_ : @LeA Tn D E F D' E' F') (_ : @SAMS Tn A' B' C' D' E' F') (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G H I), @CongA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @SAMS Tn A' B' C' G H I *)
  apply sams_sym.
(* Goal: @SAMS Tn G H I A' B' C' *)
  apply (sams_assoc_1 G H I D E F A B C D' E' F'); SumA.
Qed.

Lemma sams_assoc : forall A B C D E F G H I A' B' C' D' E' F',
   SAMS A B C D E F -> SAMS D E F G H I ->
   SumA A B C D E F A' B' C' -> SumA D E F G H I D' E' F' ->
   (SAMS A' B' C' G H I <-> SAMS A B C D' E' F').
Proof.
(* Goal: forall A B C D E F : @Tpoint Tn, or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  intros A B C D E F.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: forall _ : @SAMS Tn A' B' C' G H I, @SAMS Tn A B C D' E' F' *)
(* Goal: forall _ : @SAMS Tn A B C D' E' F', @SAMS Tn A' B' C' G H I *)
  apply (sams_assoc_1 _ _ _ D E F); auto.
(* Goal: forall _ : @SAMS Tn A B C D' E' F', @SAMS Tn A' B' C' G H I *)
  apply (sams_assoc_2 _ _ _ D E F); auto.
Qed.

Lemma sams_nos__nts : forall A B C J, SAMS A B C C B J -> ~ OS B C A J ->
  ~ TS A B C J.
Proof.
(* Goal: forall (A B C J : @Tpoint Tn) (_ : @SAMS Tn A B C C B J) (_ : not (@OS Tn B C A J)), not (@TS Tn A B C J) *)
  intros A B C J HIsi HNOS HTS.
(* Goal: False *)
  destruct HIsi as [_ [HUn [J' [HConga [HNOS' [HNTS HCop]]]]]].
(* Goal: False *)
  assert (Coplanar C B J J').
(* Goal: @Coplanar Tn C B J J' *)
(* Goal: False *)
    apply coplanar_trans_1 with A; Cop.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply two_sides_not_col in HTS; Col.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  destruct (conga_cop__or_out_ts C B J J') as [HOut|HTS1]; CongA.
  - apply HNTS.
(* Goal: @TS Tn A B C J' *)
    apply l9_2, l9_8_2 with J; Side.
(* Goal: @OS Tn A B J J' *)
    apply invert_one_side, out_one_side; trivial.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    destruct HTS as [_ []]; Col.
  - destruct HTS as [HNCol1 [HNCol2 _]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: False *)
    absurd (OS B C J J'); Side.
(* Goal: @OS Tn B C J J' *)
    destruct HTS1 as [HNCol _].
(* Goal: @OS Tn B C J J' *)
    assert (~ Col C B J') by (apply (ncol_conga_ncol C B J); Col; CongA).
(* Goal: @OS Tn B C J J' *)
    exists A; split; apply cop__not_one_side_two_sides; Col; Side.
(* Goal: @Coplanar Tn B C J A *)
(* Goal: @Coplanar Tn B C J' A *)
      apply coplanar_trans_1 with J'; Col; Cop.
(* Goal: @Coplanar Tn B C J' A *)
      Cop.
Qed.

Lemma conga_sams_nos__nts : forall A B C D E F J,
  SAMS A B C D E F -> CongA C B J D E F -> ~ OS B C A J -> ~ TS A B C J.
Proof.
(* Goal: forall (A B C D E F J : @Tpoint Tn) (_ : @SAMS Tn A B C D E F) (_ : @CongA Tn C B J D E F) (_ : not (@OS Tn B C A J)), not (@TS Tn A B C J) *)
  intros A B C D E F J HIsi HConga.
(* Goal: forall _ : not (@OS Tn B C A J), not (@TS Tn A B C J) *)
  apply sams_nos__nts.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga2_sams__sams A B C D E F); CongA.
Qed.


(** If B <= B', E <= E' and B + E = B' + E', then B = B' and E = E' *)

Lemma sams_lea2_suma2__conga123 : forall A B C D E F G H I A' B' C' D' E' F',
   LeA A B C A' B' C' -> LeA D E F D' E' F' -> SAMS A' B' C' D' E' F' ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G H I -> CongA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' : @Tpoint Tn) (_ : @LeA Tn A B C A' B' C') (_ : @LeA Tn D E F D' E' F') (_ : @SAMS Tn A' B' C' D' E' F') (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G H I), @CongA Tn A B C A' B' C' *)
  intros A B C D E F G H I A' B' C' D' E' F' HleaB HleaE Hisi' Hsuma Hsuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn A B C A' B' C' *)
  apply (sams2_suma2__conga123 _ _ _ _ _ _ D E F G H I); auto.
(* Goal: @SAMS Tn A B C D E F *)
(* Goal: @SAMS Tn A' B' C' D E F *)
(* Goal: @SumA Tn A' B' C' D E F G H I *)
    apply (sams_lea2__sams _ _ _ _ _ _ A' B' C' D' E' F'); auto.
(* Goal: @SAMS Tn A' B' C' D E F *)
    apply (sams_lea2__sams _ _ _ _ _ _ A' B' C' D' E' F'); Lea.
(* Goal: @SumA Tn A' B' C' D E F G H I *)
  assert (Haux := ex_suma A' B' C' D E F).
(* Goal: @SumA Tn A' B' C' D E F G H I *)
  destruct Haux as [G' [H' [I']]]; auto.
(* Goal: @SumA Tn A' B' C' D E F G H I *)
  apply (conga3_suma__suma A' B' C' D E F G' H' I'); try (apply conga_refl); auto.
(* Goal: @CongA Tn G' H' I' G H I *)
  apply lea_asym.
(* Goal: @LeA Tn G' H' I' G H I *)
(* Goal: @LeA Tn G H I G' H' I' *)
  apply (sams_lea456_suma2__lea A' B' C' D E F _ _ _ D' E' F'); auto.
(* Goal: @LeA Tn G H I G' H' I' *)
  apply (sams_lea123_suma2__lea A B C D E F _ _ _ A' B' C'); auto.
(* Goal: @SAMS Tn A' B' C' D E F *)
  apply (sams_lea2__sams _ _ _ _ _ _ A' B' C' D' E' F'); Lea.
Qed.

Lemma sams_lea2_suma2__conga456 : forall A B C D E F G H I A' B' C' D' E' F',
   LeA A B C A' B' C' -> LeA D E F D' E' F' -> SAMS A' B' C' D' E' F' ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G H I -> CongA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' : @Tpoint Tn) (_ : @LeA Tn A B C A' B' C') (_ : @LeA Tn D E F D' E' F') (_ : @SAMS Tn A' B' C' D' E' F') (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G H I), @CongA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @CongA Tn D E F D' E' F' *)
  apply (sams_lea2_suma2__conga123 _ _ _ A B C G H I _ _ _ A' B' C'); SumA.
Qed.

(** If B + E = E, then B = 0 *)

Lemma sams_suma__out213 : forall A B C D E F, SumA A B C D E F D E F -> SAMS A B C D E F -> Out B A C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @SumA Tn A B C D E F A B C) (_ : @SAMS Tn A B C D E F), @Out Tn E D F *)
  intros A B C D E F HSuma HIsi.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Out Tn B A C *)
  apply (l11_21_a D E D).
(* Goal: @Out Tn E D D *)
(* Goal: @CongA Tn D E D A B C *)
    apply out_trivial; auto.
(* Goal: @CongA Tn D E D A B C *)
  apply sams_lea2_suma2__conga123 with D E F D E F D E F; Lea.
(* Goal: and (@CongA Tn A0 B J A0 B J) (and (not (@OS Tn B A0 A J)) (and (@Coplanar Tn A B A0 J) (@CongA Tn A B J A B J))) *)
  exists F; repeat (split; CongA); Cop.
(* Goal: not (@OS Tn B C A A) *)
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
  apply col123__nos; Col.
Qed.

Lemma sams_suma__out546 : forall A B C D E F, SumA A B C D E F A B C -> SAMS A B C D E F -> Out E D F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @SumA Tn A B C D E F A B C) (_ : @SAMS Tn A B C D E F), @Out Tn E D F *)
  intros A B C D E F HSuma HIsi.
(* Goal: @Out Tn E D F *)
  apply sams_suma__out213 with A B C.
(* Goal: @SumA Tn D E F A B C A B C *)
(* Goal: @SAMS Tn D E F A B C *)
    apply suma_sym; trivial.
(* Goal: @SAMS Tn D E F A B C *)
  apply sams_sym; trivial.
Qed.

(** If B < B' and E <= E', then B + E < B' + E' *)

Lemma sams_lea_lta123_suma2__lta : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LtA A B C A' B' C' -> LeA D E F D' E' F' -> SAMS A' B' C' D' E' F' ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA G H I G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A B C A' B' C') (_ : @LeA Tn D E F D' E' F') (_ : @SAMS Tn A' B' C' D' E' F') (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn G H I G' H' I' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I' HltaB HleaE Hisi' Hsuma Hsuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @LeA Tn G H I G' H' I' *)
(* Goal: not (@CongA Tn G H I G' H' I') *)
  apply (sams_lea2_suma2__lea A B C D E F _ _ _ A' B' C' D' E' F'); Lea.
(* Goal: not (@SAMS Tn A B C D E F) *)
  intro.
(* Goal: False *)
  destruct HltaB as [HleaB HNConga].
(* Goal: False *)
  apply HNConga.
(* Goal: @CongA Tn A B C A' B' C' *)
  apply (sams_lea2_suma2__conga123 _ _ _ D E F G H I _ _ _ D' E' F'); auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma A' B' C' D' E' F' G' H' I'); CongA.
Qed.

Lemma sams_lea_lta456_suma2__lta : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LeA A B C A' B' C' -> LtA D E F D' E' F' -> SAMS A' B' C' D' E' F' ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA G H I G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LtA Tn G H I G' H' I' *)
  apply (sams_lea_lta123_suma2__lta D E F A B C _ _ _ D' E' F' A' B' C'); SumA.
Qed.

Lemma sams_lta2_suma2__lta : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LtA A B C A' B' C' -> LtA D E F D' E' F' -> SAMS A' B' C' D' E' F' ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA G H I G' H' I'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LtA Tn G H I G' H' I' *)
  apply (sams_lea_lta123_suma2__lta A B C D E F _ _ _ A' B' C' D' E' F'); auto.
(* Goal: @LeA Tn D E F D' E' F' *)
  apply lta__lea; auto.
Qed.

(** If E >= E' and B + E <= B' + E', then B <= B' *)

Lemma sams_lea2_suma2__lea123 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LeA D' E' F' D E F -> LeA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LeA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
  elim(lta_dec A' B' C' A B C).
  2: intro; apply nlta__lea; auto.
  intro Hlta.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  exfalso.
  assert(~ LeA G H I G' H' I'); auto.
  apply lta__nlea.
  apply(sams_lea_lta123_suma2__lta A' B' C' D' E' F' _ _ _ A B C D E F); auto.
Qed.

Lemma sams_lea2_suma2__lea456 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LeA A' B' C' A B C -> LeA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LeA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LeA Tn D E F D' E' F' *)
  apply (sams_lea2_suma2__lea123 _ _ _ A B C G H I _ _ _ A' B' C' G' H' I'); try (apply suma_sym); auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply sams_sym; assumption.
Qed.

(** If E > E' and B + E <= B' + E', then B < B' *)

Lemma sams_lea_lta456_suma2__lta123 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LtA D' E' F' D E F -> LeA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
  elim(lea_dec A' B' C' A B C).
  2: intro; apply nlea__lta; auto.
(* Goal: forall _ : @LeA Tn D E F C B A', @SAMS Tn A B C D E F *)
  intro Hlea.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  exfalso.
  assert(~ LeA G H I G' H' I'); auto.
  apply lta__nlea.
  apply(sams_lea_lta456_suma2__lta A' B' C' D' E' F' _ _ _ A B C D E F); auto.
Qed.

Lemma sams_lea_lta123_suma2__lta456 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LtA A' B' C' A B C -> LeA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LtA Tn D E F D' E' F' *)
  apply (sams_lea_lta456_suma2__lta123 _ _ _ A B C G H I _ _ _ A' B' C' G' H' I'); try (apply suma_sym); auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply sams_sym; assumption.
Qed.

(** If E >= E' and B + E < B' + E', then B < B' *)

Lemma sams_lea_lta789_suma2__lta123 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LeA D' E' F' D E F -> LtA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
  elim(lea_dec A' B' C' A B C).
  2: intro; apply nlea__lta; auto.
  intro Hlta.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  exfalso.
  assert(~ LtA G H I G' H' I'); auto.
  apply lea__nlta.
  apply(sams_lea2_suma2__lea A' B' C' D' E' F' _ _ _ A B C D E F); auto.
Qed.

Lemma sams_lea_lta789_suma2__lta456 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LeA A' B' C' A B C -> LtA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LtA Tn D E F D' E' F' *)
  apply (sams_lea_lta789_suma2__lta123 _ _ _ A B C G H I _ _ _ A' B' C' G' H' I'); try (apply suma_sym); auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply sams_sym; assumption.
Qed.

Lemma sams_lta2_suma2__lta123 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LtA D' E' F' D E F -> LtA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LtA Tn A B C A' B' C' *)
  apply (sams_lea_lta789_suma2__lta123 _ _ _ D E F G H I _ _ _ D' E' F' G' H' I'); auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply lta__lea; assumption.
Qed.

Lemma sams_lta2_suma2__lta456 : forall A B C D E F G H I A' B' C' D' E' F' G' H' I',
   LtA A' B' C' A B C -> LtA G H I G' H' I' -> SAMS A B C D E F ->
   SumA A B C D E F G H I -> SumA A' B' C' D' E' F' G' H' I' -> LtA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' G' H' I' : @Tpoint Tn) (_ : @LtA Tn A' B' C' A B C) (_ : @LtA Tn G H I G' H' I') (_ : @SAMS Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I) (_ : @SumA Tn A' B' C' D' E' F' G' H' I'), @LtA Tn D E F D' E' F' *)
  intros A B C D E F G H I A' B' C' D' E' F' G' H' I'.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @LtA Tn D E F D' E' F' *)
  apply (sams_lea_lta789_suma2__lta456 A B C _ _ _ G H I A' B' C' _ _ _ G' H' I'); auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply lta__lea; assumption.
Qed.

(** The sum of two angles of a triangle is less than a straight angle (three lemmas) *)

Lemma sams123231 : forall A B C, A <> B -> A <> C -> B <> C -> SAMS A B C B C A.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A C)) (_ : not (@eq (@Tpoint Tn) B C)), @SAMS Tn A B C B C A *)
  intros A B C.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert(HA' := symmetric_point_construction A B).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  destruct HA' as [A'].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C A B C *)
  apply (sams_chara _ _ _ _ _ _ A'); Between.
(* Goal: @LeA Tn B C A C B A' *)
  elim(col_dec A B C).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intro HCol.
(* Goal: @LeA Tn B C A C B A' *)
    elim(bet_dec A C B).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { intro HCBet.
(* Goal: @LeA Tn A B C C B A1 *)
      apply conga__lea.
(* Goal: @CongA Tn C B A D E F *)
(* Goal: and (not (@OS Tn B C A A)) (and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A)) *)
      apply conga_line; Between.
(* Goal: @Bet Tn C B A' *)
      apply (between_exchange3 A); Between.
    }
(* Goal: not (@SAMS Tn A B C D E F) *)
    intro.
(* Goal: @LeA Tn B C A C B A' *)
    apply l11_31_1; auto.
(* Goal: @Out Tn C B A *)
    apply l6_6.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply not_bet_out; Col.
  }
(* Goal: not (@SAMS Tn A B C D E F) *)
  intro.
(* Goal: @LeA Tn B C A C B A' *)
  apply lta__lea.
(* Goal: @LtA Tn B C A C B P *)
(* Goal: @SAMS Tn A B C C B P *)
(* Goal: @SumA Tn A B C C B P A B P *)
  apply l11_41_aux; Col; Between.
Qed.

Lemma col_suma__col : forall A B C D E F, Col D E F -> SumA A B C B C A D E F -> Col A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Col Tn D E F) (_ : @SumA Tn A B C B C A D E F), @Col Tn A B C *)
  intros A B C D E F HCol HSuma.
(* Goal: @Col Tn A B C *)
  destruct (col_dec A B C) as [|HNCol]; [trivial|].
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  exfalso.
(* Goal: @Col Tn G H I *)
(* Goal: @Col Tn G H I *)
  destruct (bet_dec D E F).
  - assert (HP := symmetric_point_construction A B).
(* Goal: False *)
    destruct HP as [P].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
    assert (Hlta : LtA D E F A B P);
    [|destruct Hlta as [Hlea HNConga]; apply HNConga; apply conga_line; Between].
(* Goal: @LtA Tn D E F A B P *)
    assert (TS B C A P).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { repeat split; Col.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      intro; apply HNCol; ColR.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      exists B; Col; Between.
    }
(* Goal: @LtA Tn D E F A B P *)
    apply (sams_lea_lta456_suma2__lta A B C B C A _ _ _ A B C C B P); Lea.
(* Goal: @LtA Tn B C A C B P *)
(* Goal: @SAMS Tn A B C C B P *)
(* Goal: @SumA Tn A B C C B P A B P *)
      apply l11_41_aux; Col; Between.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { split; auto; split.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
        right; intro; apply HNCol; Col.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J C B P) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
      exists P.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
      split; CongA.
(* Goal: and (not (@OS Tn B C A P)) (and (not (@TS Tn A B C P)) (@Coplanar Tn A B C P)) *)
      split; Side.
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
      split; Cop.
(* Goal: not (@TS Tn A B C P) *)
      intro Hts.
(* Goal: False *)
      destruct Hts as [_ [Habs]].
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      apply Habs; Col.
    }
(* Goal: @Coplanar Tn B C J' A *)
    exists P; repeat (split; CongA); Side; Cop.

(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  - assert_diffs.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    apply HNCol.
(* Goal: @Col Tn A B C *)
    apply col_permutation_3.
(* Goal: @Col Tn C B A *)
    apply out_col.
(* Goal: @Out Tn C B A *)
    apply (out_lea__out _ _ _ D E F).
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      apply not_bet_out; Col.
(* Goal: @LeA Tn B C A D E F *)
    apply (sams_suma__lea456789 A B C); auto.
(* Goal: @SAMS Tn A B C B C A *)
    apply sams123231; auto.
Qed.

Lemma ncol_suma__ncol : forall A B C D E F, ~ Col A B C -> SumA A B C B C A D E F -> ~ Col D E F.
Proof.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
  intros A B C D E F HNCol HSuma HCol.
(* Goal: @TriSumA Tn A B C D E F *)
  apply HNCol, col_suma__col with D E F; assumption.
Qed.


(** Sum of two right angles is a straight angle:
  90+90=180.
 *)

Lemma per2_suma__bet : forall A B C D E F G H I, Per A B C -> Per D E F ->
   SumA A B C D E F G H I -> Bet G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @Per Tn A B C) (_ : @Per Tn D E F) (_ : @SumA Tn A B C D E F G H I), @Bet Tn G H I *)
  intros A B C D E F G H I HB HE HSuma.
(* Goal: @Bet Tn G H I *)
  destruct HSuma as [A1 [HConga1 [HNos [HCop HConga2]]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Bet Tn G H I *)
  assert(Per A1 B C) by (apply (l11_17 D E F); CongA).
(* Goal: @Bet Tn G H I *)
  apply (bet_conga__bet A B A1); auto.
(* Goal: @Bet Tn A B A1 *)
  apply (col_two_sides_bet _ C).
(* Goal: @Coplanar Tn B C J' A *)
  apply col_permutation_2; apply cop_per2__col with C; Cop.
(* Goal: @TS Tn B C A A1 *)
  apply cop__not_one_side_two_sides; Cop; apply per_not_col; auto.
Qed.

Lemma bet_per2__suma : forall A B C D E F G H I,
   A <> B -> B <> C -> D <> E -> E <> F -> G <> H -> H <> I ->
   Per A B C -> Per D E F ->
   Bet G H I -> SumA A B C D E F G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @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)) (_ : not (@eq (@Tpoint Tn) G H)) (_ : not (@eq (@Tpoint Tn) H I)) (_ : @Per Tn A B C) (_ : @Per Tn D E F) (_ : @Bet Tn G H I), @SumA Tn A B C D E F G H I *)
  intros A B C D E F G H I H1 H2 H3 H4 H5 H6 HB HE HBet.
(* Goal: @SumA Tn A B C D E F G H I *)
  destruct (ex_suma A B C D E F) as [G' [H' [I' HSuma]]]; auto.
(* Goal: @SumA Tn A B C D E F G H I *)
  apply conga3_suma__suma with A B C D E F G' H' I'; [|apply conga_refl..|]; auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn G' H' I' G H I *)
  apply conga_line; auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply (per2_suma__bet A B C D E F); assumption.
Qed.

Lemma per2__sams : forall A B C D E F, A <> B -> B <> C -> D <> E -> E <> F ->
  Per A B C -> Per D E F -> SAMS A B C D E F.
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)) (_ : @Per Tn A B C) (_ : @Per Tn D E F), @SAMS Tn A B C D E F *)
  intros A B C D E F HAB HBC HDE HEF HPerB HPerE.
(* Goal: @SAMS Tn A B C D E F *)
  destruct (ex_suma A B C D E F) as [G [H [I]]]; auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply bet_suma__sams with G H I; [|apply (per2_suma__bet A B C D E F)]; assumption.
Qed.

(** If 90+x=180 then x=90. *)

Lemma bet_per_suma__per456 : forall A B C D E F G H I, Per A B C -> Bet G H I ->
   SumA A B C D E F G H I -> Per D E F.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @Per Tn D E F) (_ : @Bet Tn G H I) (_ : @SumA Tn A B C D E F G H I), @Per Tn A B C *)
  intros A B C D E F G H I HPer HBet HSuma.
(* Goal: @Per Tn D E F *)
  assert(HA1 := symmetric_point_construction A B).
(* Goal: @Per Tn D E F *)
  destruct HA1 as [A1].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Per Tn D E F *)
  assert(~ Col A B C) by (apply per_not_col; auto).
(* Goal: @Per Tn D E F *)
  apply (l11_17 A B C); auto.
(* Goal: @CongA Tn A B C D E F *)
  apply (sams2_suma2__conga456 A B C _ _ _ _ _ _ G H I); auto.
  - apply (sams_chara _ _ _ _ _ _ A1); Between.
(* Goal: @LeA Tn A B C C B A1 *)
    apply conga__lea.
(* Goal: @CongA Tn A B C C B A1 *)
    apply conga_left_comm.
(* Goal: @CongA Tn C B A C B A1 *)
    apply l11_18_1; Between; Perp.

  - destruct HSuma as [F1 [HConga1 [HNos [HCop HConga2]]]].
(* Goal: @SAMS Tn A B C A B C *)
    repeat split; auto.
(* Goal: False *)
(* Goal: False *)
    right; intro; assert_cols; Col.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D E F) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    exists F1.
(* Goal: and (@CongA Tn C B F1 D E F) (and (not (@OS Tn B C A F1)) (and (not (@TS Tn A B C F1)) (@Coplanar Tn A B C F1))) *)
    repeat (split; auto).
(* Goal: not (@TS Tn A B C F1) *)
    intro Habs.
(* Goal: False *)
    destruct Habs as [_ [Habs]].
(* Goal: False *)
    apply Habs.
(* Goal: @Col Tn F1 A B *)
    apply col_permutation_2.
(* Goal: @Col Tn A B F1 *)
    apply bet_col.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply (bet_conga__bet G H I); CongA.

  - assert(HSuma' := ex_suma A B C A B C).
(* Goal: @SumA Tn A B C A B C G H I *)
    destruct HSuma' as [G' [H' [I']]]; auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: @SumA Tn A B C A B C G H I *)
    apply (conga3_suma__suma A B C A B C G' H' I'); try (apply conga_refl); auto.
(* Goal: @CongA Tn G' H' I' G H I *)
    apply conga_line; auto.
(* Goal: @Bet Tn D E F *)
    apply (per2_suma__bet A B C A B C); auto.
Qed.

(** If x+90=180 then x=90. *)

Lemma bet_per_suma__per123 : forall A B C D E F G H I, Per D E F -> Bet G H I ->
   SumA A B C D E F G H I -> Per A B C.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @Per Tn D E F) (_ : @Bet Tn G H I) (_ : @SumA Tn A B C D E F G H I), @Per Tn A B C *)
  intros A B C D E F G H I HPer HBet HSuma.
(* Goal: @Per Tn A B C *)
  apply (bet_per_suma__per456 D E F _ _ _ G H I); SumA.
Qed.

(** If x+x=180 then x=90. *)

Lemma bet_suma__per : forall A B C D E F, Bet D E F -> SumA A B C A B C D E F ->
   Per A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Bet Tn D E F) (_ : @SumA Tn A B C A B C D E F), @Per Tn A B C *)
  intros A B C D E F HBet HSuma.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Per Tn A B C *)
  destruct HSuma as [A' [HConga1 [_ [_ HConga2]]]].
(* Goal: @Per Tn A B C *)
  apply l8_2.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (l11_18_2 _ _ _ A'); CongA.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (bet_conga__bet D E F); CongA.
Qed.

(** If x<90 then x+x<180 (two lemmas). *)

Lemma acute__sams : forall A B C, Acute A B C -> SAMS A B C A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Acute Tn A B C), @SAMS Tn A B C A B C *)
  intros A B C Hacute.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert(HA' := symmetric_point_construction A B).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  destruct HA' as [A'].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C A B C *)
  apply (sams_chara _ _ _ _ _ _ A'); Between.
(* Goal: @LtA Tn A' B C A B C *)
  apply acute_obtuse__lta; auto.
(* Goal: @Obtuse Tn C B A' *)
  apply obtuse_sym.
(* Goal: @Obtuse Tn A' B C *)
  apply (acute_bet__obtuse A); Between.
Qed.

Lemma acute_suma__nbet : forall A B C D E F, Acute A B C -> SumA A B C A B C D E F -> ~ Bet D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Acute Tn A B C) (_ : @SumA Tn A B C A B C D E F), not (@Bet Tn D E F) *)
  intros A B C D E F Hacute HSuma.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: not (@SAMS Tn A B C D E F) *)
  intro.
(* Goal: False *)
  apply (nlta A B C).
(* Goal: @LeA Tn D E F A B C *)
  apply acute_per__lta; auto.
(* Goal: @Per Tn A B C *)
  apply (bet_suma__per _ _ _ D E F); auto.
Qed.

(** If x<90 and y<90 then x+y<180 (two lemmas). *)

Lemma acute2__sams : forall A B C D E F, Acute A B C -> Acute D E F -> SAMS A B C D E F.
Proof.
  assert (Haux : forall A B C D E F, Acute A B C -> LeA D E F A B C -> SAMS A B C D E F).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intros A B C D E F HAcute HLea.
(* Goal: @SAMS Tn A B C D E F *)
    apply sams_lea2__sams with A B C A B C.
(* Goal: @SAMS Tn A B C A B C *)
      apply acute__sams, HAcute.
(* Goal: @LeA Tn A B C A B C *)
(* Goal: @LeA Tn D E F A B C *)
      assert_diffs; apply lea_refl; auto.
(* Goal: @TriSumA Tn A B C D E F *)
      assumption.
  }
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Acute Tn A B C) (_ : @Acute Tn D E F), @SAMS Tn A B C D E F *)
  intros A B C D E F HAcute1 HAcute2.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @SAMS Tn A B C D E F *)
  destruct (lea_total A B C D E F); SumA.
Qed.

Lemma acute2_suma__nbet : forall A B C D E F G H I,
  Acute A B C -> Acute D E F -> SumA A B C D E F G H I -> ~ Bet G H I.
Proof.
  assert (Haux : forall A B C D E F G H I, Acute A B C -> LeA D E F A B C -> SumA A B C D E F G H I ->
    ~ Bet G H I).
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intros A B C D E F G H I HAcute HLea HSuma HBet.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: False *)
    destruct (ex_suma A B C A B C) as [A' [B' [C']]]; auto.
(* Goal: False *)
    apply (acute_suma__nbet A B C A' B' C'); trivial.
(* Goal: @Bet Tn A' B' C' *)
    apply (bet_lea__bet G H I); [apply HBet|].
(* Goal: @LeA Tn G H I A' B' C' *)
    apply sams_lea2_suma2__lea with A B C D E F A B C A B C; trivial.
(* Goal: @LeA Tn A B C A B C *)
(* Goal: @LeA Tn D E F A B C *)
      apply lea_refl; auto.
(* Goal: @SAMS Tn A B C A B C *)
      apply acute__sams, HAcute.
  }
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @Acute Tn A B C) (_ : @Acute Tn D E F) (_ : @SumA Tn A B C D E F G H I), not (@Bet Tn G H I) *)
  intros A B C D E F G H I HAcute1 HAcute2 HSuma.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: not (@Bet Tn G H I) *)
  destruct (lea_total A B C D E F); auto.
(* Goal: @TriSumA Tn A B C D E F *)
    apply suma_sym in HSuma; apply (Haux D E F A B C); assumption.
(* Goal: @TriSumA Tn A B C D E F *)
    apply (Haux A B C D E F); assumption.
Qed.

(** If x<90 then x+90<180 (two lemmas) *)

Lemma acute_per__sams : forall A B C D E F, A <> B -> B <> C ->
  Per A B C -> Acute D E F -> SAMS A B C D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Per Tn A B C) (_ : @Acute Tn D E F), @SAMS Tn A B C D E F *)
  intros A B C D E F HAB HBC HPer HAcute.
(* Goal: @SAMS Tn A B C D E F *)
  apply sams_lea2__sams with A B C A B C.
(* Goal: @SAMS Tn A B C A B C *)
(* Goal: @SumA Tn A B C A B C G H I *)
    apply per2__sams; auto.
(* Goal: @LeA Tn A B C A B C *)
(* Goal: @LeA Tn D E F A B C *)
    apply lea_refl; auto.
(* Goal: @LeA Tn D E F A B C *)
    apply acute_per__lta; auto.
Qed.

Lemma acute_per_suma__nbet : forall A B C D E F G H I, A <> B -> B <> C ->
  Per A B C -> Acute D E F -> SumA A B C D E F G H I -> ~ Bet G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Per Tn A B C) (_ : @Acute Tn D E F) (_ : @SumA Tn A B C D E F G H I), not (@Bet Tn G H I) *)
  intros A B C D E F G H I HAB HBC HPer HAcute HSuma HBet.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: False *)
  apply (nlta G H I).
(* Goal: @LtA Tn G H I G H I *)
  apply sams_lea_lta456_suma2__lta with A B C D E F A B C A B C; Lea.
(* Goal: @SAMS Tn A B C A B C *)
(* Goal: @SumA Tn A B C A B C G H I *)
    apply per2__sams; auto.
(* Goal: @SumA Tn A B C A B C G H I *)
    apply bet_per2__suma; auto.
Qed.

(** If x>90 then x+x>180. *)

Lemma obtuse__nsams : forall A B C, Obtuse A B C -> ~ SAMS A B C A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Obtuse Tn A B C), not (@SAMS Tn A B C A B C) *)
  intros A B C Hobtuse.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert(HA' := symmetric_point_construction A B).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  destruct HA' as [A'].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: not (@SAMS Tn A B C D E F) *)
  intro.
(* Goal: False *)
  apply (nlta A B C).
(* Goal: @LtA Tn A B C A B C *)
  apply (lea123456_lta__lta _ _ _ A' B C).
  - apply lea_right_comm.
(* Goal: @LeA Tn A B C C B A' *)
    apply (sams_chara A); Between.
  - apply acute_obtuse__lta; auto.
(* Goal: @Acute Tn A' B C *)
    apply (bet_obtuse__acute A); Between.
Qed.

(** If x+x<180 then x<90. *)

Lemma nbet_sams_suma__acute : forall A B C D E F, ~ Bet D E F -> SAMS A B C A B C ->
   SumA A B C A B C D E F -> Acute A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@Bet Tn D E F)) (_ : @SAMS Tn A B C A B C) (_ : @SumA Tn A B C A B C D E F), @Acute Tn A B C *)
  intros A B C D E F HNBet HIsi HSuma.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Obtuse Tn A B C *)
  elim(angle_partition A B C); auto.
(* Goal: forall _ : or (@Per Tn A B C) (@Obtuse Tn A B C), @Obtuse Tn A B C *)
  intro HUn.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  exfalso.
(* Goal: False *)
  destruct HUn.
  - apply HNBet.
(* Goal: @Bet Tn D E F *)
    apply (per2_suma__bet A B C A B C); auto.
  - assert(~ SAMS A B C A B C); auto.
(* Goal: not (@SAMS Tn A B C A B C) *)
    apply obtuse__nsams; auto.
Qed.

(** If x+x>180 then x>90. *)

Lemma nsams__obtuse : forall A B C, A <> B -> B <> C -> ~ SAMS A B C 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)) (_ : not (@SAMS Tn A B C A B C)), @Obtuse Tn A B C *)
  intros A B C HAB HBC HNIsi.
(* Goal: @Obtuse Tn A B C *)
  elim(angle_partition A B C); auto.
  - intro.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    exfalso.
(* Goal: False *)
    apply HNIsi.
(* Goal: @SAMS Tn A B C A B C *)
    apply acute__sams; auto.

  - intro HUn.
(* Goal: @Obtuse Tn A B C *)
    destruct HUn; auto.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    exfalso.
(* Goal: False *)
    apply HNIsi.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert(HA' := symmetric_point_construction A B).
(* Goal: @SAMS Tn A B C A B C *)
    assert(HNCol : ~ Col A B C) by (apply per_not_col; auto).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    destruct HA' as [A'].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: @SAMS Tn A B C A B C *)
    repeat split; auto.
(* Goal: or (@Out Tn B A C) (not (@Bet Tn A B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J A B C) (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
    right; intro; Col.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D E F C B A')) *)
    exists A'.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: @CongA Tn C B A C B A1 *)
      apply conga_right_comm; apply conga_sym; apply l11_18_1; Between; Perp.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
    split.
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    { apply l9_9.
(* Goal: @TS Tn B C A A' *)
      repeat split; Col.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
        intro; apply HNCol; ColR.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
      exists B; Col; Between.
    }
(* Goal: and (not (@TS Tn A B C A')) (@Coplanar Tn A B C A') *)
    split; Cop.
(* Goal: False *)
(* Goal: False *)
    intro Hts; destruct Hts as [_ []]; assert_cols; Col.
Qed.

(** If doubling two acute angles makes the same result, then these angles are congruent *)

Lemma sams2_suma2__conga : forall A B C D E F A' B' C',
  SAMS A B C A B C -> SumA A B C A B C D E F ->
  SAMS A' B' C' A' B' C' -> SumA A' B' C' A' B' C' D E F ->
  CongA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F A' B' C' : @Tpoint Tn) (_ : @SAMS Tn A B C A B C) (_ : @SumA Tn A B C A B C D E F) (_ : @SAMS Tn A' B' C' A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), @CongA Tn A B C A' B' C' *)
  intros A B C D E F A' B' C' HIsi HSuma HIsi' HSuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
  destruct (lea_total A B C A' B' C'); trivial; [|apply conga_sym];
  eapply sams_lea2_suma2__conga123; eauto.
Qed.

Lemma acute2_suma2__conga : forall A B C D E F A' B' C',
  Acute A B C -> SumA A B C A B C D E F ->
  Acute A' B' C' -> SumA A' B' C' A' B' C' D E F ->
  CongA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F A' B' C' : @Tpoint Tn) (_ : @Acute Tn A B C) (_ : @SumA Tn A B C A B C D E F) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), @CongA Tn A B C A' B' C' *)
  intros A B C D E F A' B' C' HB HSuma HB'.
(* Goal: @TriSumA Tn A B C D E F *)
  apply sams2_suma2__conga; try apply acute__sams; assumption.
Qed.

(** Sum of two straight angles is a null angle *)

Lemma bet2_suma__out : forall A B C D E F G H I, Bet A B C -> Bet D E F ->
  SumA A B C D E F G H I -> Out H G I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn D E F) (_ : @SumA Tn A B C D E F G H I), @Out Tn H G I *)
  intros A B C D E F G H I HBet1 HBet2 HSuma.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Out Tn H G I *)
  apply (eq_conga_out A B).
(* Goal: @CongA Tn A B A G H I *)
  apply (suma2__conga A B C D E F); trivial.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  exists A; split.
(* Goal: @CongA Tn C B A D E F *)
(* Goal: and (not (@OS Tn B C A A)) (and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A)) *)
    apply conga_line; Between.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: not (@OS Tn B C A A) *)
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
    apply col123__nos; Col.
(* Goal: and (@Coplanar Tn A B C A) (@CongA Tn A B A A B A) *)
  split; CongA; Cop.
Qed.

(** Sum of two degenerate angles is degenerate *)

Lemma col2_suma__col : forall A B C D E F G H I, Col A B C -> Col D E F ->
  SumA A B C D E F G H I -> Col G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @Col Tn A B C) (_ : @Col Tn D E F) (_ : @SumA Tn A B C D E F G H I), @Col Tn G H I *)
  intros A B C D E F G H I HCol1 HCol2 HSuma.
(* Goal: @Col Tn G H I *)
  destruct (bet_dec A B C).
(* Goal: @Col Tn G H I *)
(* Goal: @Col Tn G H I *)
  destruct (bet_dec D E F).
  - apply col_permutation_4, out_col, (bet2_suma__out A B C D E F); assumption.
  - apply (col_conga_col A B C); trivial.
(* Goal: @CongA Tn A B C G H I *)
    apply out546_suma__conga with D E F; trivial.
(* Goal: @TriSumA Tn A B C D E F *)
    apply not_bet_out; assumption.
  - apply (col_conga_col D E F); trivial.
(* Goal: @CongA Tn D E F G H I *)
    apply (out213_suma__conga A B C); trivial.
(* Goal: @TriSumA Tn A B C D E F *)
    apply not_bet_out; assumption.
Qed.

(** The sum of two supplementary angles is a flat angle (two lemmas) *)

Lemma suma_suppa__bet : forall A B C D E F G H I,
  SuppA A B C D E F -> SumA A B C D E F G H I -> Bet G H I.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SuppA Tn A B C D E F) (_ : @SumA Tn A B C D E F G H I), @Bet Tn G H I *)
  intros A B C D E F G H I [_ [A' [HBet HCong]]] [A'' [HConga1 [HNOS [HCop HConga2]]]].
(* Goal: @Bet Tn G H I *)
  apply (bet_conga__bet A B A''); trivial.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Bet Tn A B A'' *)
  apply between_symmetry, l6_2 with A'; Between.
(* Goal: @Out Tn B A' A'' *)
  destruct (conga_cop__or_out_ts C B A' A'') as [|HTS]; auto.
(* Goal: @Coplanar Tn B C J' A *)
    apply coplanar_perm_3, col_cop__cop with A; Col; Cop.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    apply conga_trans with D E F; CongA.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  exfalso.
(* Goal: False *)
  apply HNOS.
(* Goal: @OS Tn B C A A'' *)
  exists A'; split; [|Side].
(* Goal: @TS Tn B C A A' *)
  destruct HTS as [HNCol1 [HNCol2 _]].
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  repeat split.
(* Goal: not (@Col Tn A B C) *)
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    intro; apply HNCol1; ColR.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    Col.
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
  exists B; split; Col.
Qed.

Lemma bet_suppa__suma : forall A B C D E F G H I, G <> H -> H <> I ->
  SuppA A B C D E F -> Bet G H I -> SumA A B C D E F G H I.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros A B C D E F G H I; intros.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: or (@SumA Tn A B C D E F G H I) (not (@SumA Tn A B C D E F G H I)) *)
  destruct (ex_suma A B C D E F) as [G' [H' [I']]]; auto.
(* Goal: @CongA Tn A B C0 A B C0 *)
  apply (conga3_suma__suma A B C D E F G' H' I'); try apply conga_refl; auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn G' H' I' G H I *)
  apply conga_line; auto.
(* Goal: @TriSumA Tn A B C D E F *)
  apply (suma_suppa__bet A B C D E F); assumption.
Qed.

(** If the sum of two angles is a flat angle, then they are supplementary *)

Lemma bet_suma__suppa : forall A B C D E F G H I,
  SumA A B C D E F G H I -> Bet G H I -> SuppA A B C D E F.
Proof.
(* Goal: forall (A B C D E F G H I : @Tpoint Tn) (_ : @SumA Tn A B C D E F G H I) (_ : @Bet Tn G H I), @SuppA Tn A B C D E F *)
  intros A B C D E F G H I [A' [HConga1 [_ [_ HConga2]]]] HBet.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
(* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => and (@Bet Tn A B A') (@CongA Tn D E F C B A')) *)
  exists A'.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  split; CongA.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (bet_conga__bet G H I); CongA.
Qed.

(** The sum of two angles is equal to the sum of their two supplementary angles *)

Lemma bet2_suma__suma : forall A B C D E F G H I A' D', A' <> B -> D' <> E ->
  Bet A B A' -> Bet D E D' -> SumA A B C D E F G H I -> SumA A' B C D' E F G H I.
Proof.
(* Goal: @ex (@Tpoint Tn) (fun J : @Tpoint Tn => and (@CongA Tn C B J D' E' F') (and (not (@OS Tn B C A J)) (and (not (@TS Tn A B C J)) (@Coplanar Tn A B C J)))) *)
  intros A B C D E F G H I A' D' HBA' HED' HBetA HBetD [J [HJ1 [HJ2 [HJ3 HJ4]]]]; spliter.
(* Goal: @SumA Tn A' B C D' E F G H I *)
  destruct (segment_construction C B B C) as [C' []].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma A B C' D' E F G H I); [|apply l11_14; Between|CongA..].
(* Goal: @SumA Tn A B C' D' E F G H I *)
  exists J.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @CongA Tn C' B J D' E F *)
(* Goal: and (not (@OS Tn B C' A J)) (and (@Coplanar Tn A B C' J) (@CongA Tn A B J G H I)) *)
    apply l11_13 with C D; Between.
(* Goal: and (not (@OS Tn B C' A J)) (and (@Coplanar Tn A B C' J) (@CongA Tn A B J G H I)) *)
  repeat (split; trivial).
(* Goal: not (@Col Tn A' B C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B C) (@Bet Tn A T A')) *)
    intro; apply HJ2, col_one_side with C'; Col.
(* Goal: @Coplanar Tn B C J' A *)
  apply coplanar_perm_3, col_cop__cop with C; Col; Cop.
Qed.

Lemma suma_suppa2__suma : forall A B C D E F G H I A' B' C' D' E' F',
  SuppA A B C A' B' C' -> SuppA D E F D' E' F' -> SumA A B C D E F G H I ->
  SumA A' B' C' D' E' F' G H I.
Proof.
(* Goal: forall (A B C D E F G H I A' B' C' D' E' F' : @Tpoint Tn) (_ : @SuppA Tn A B C A' B' C') (_ : @SuppA Tn D E F D' E' F') (_ : @SumA Tn A B C D E F G H I), @SumA Tn A' B' C' D' E' F' G H I *)
  intros A B C D E F G H I A' B' C' D' E' F' [_ [A0 []]] [_ [D0 []]] HSuma.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma A0 B C D0 E F G H I); CongA.
(* Goal: @SumA Tn A0 B C D0 E F G H I *)
  apply bet2_suma__suma with A D; auto.
Qed.

(** If doubling two obtuse angles makes the same result, then these angles are congruent *)

Lemma suma2_obtuse2__conga : forall A B C D E F A' B' C',
  Obtuse A B C -> SumA A B C A B C D E F ->
  Obtuse A' B' C' -> SumA A' B' C' A' B' C' D E F ->
  CongA A B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F A' B' C' : @Tpoint Tn) (_ : @Obtuse Tn A B C) (_ : @SumA Tn A B C A B C D E F) (_ : @Obtuse Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), @CongA Tn A B C A' B' C' *)
  intros A B C D E F A' B' C' HB HSuma HB' HSuma'.
(* Goal: or (@CongA Tn A B C A' B' C') (@SuppA Tn A B C A' B' C') *)
  destruct (segment_construction A B A B) as [A0 []].
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  destruct (segment_construction A' B' A' B') as [A0' []].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn A B C A' B' C' *)
  apply l11_13 with A0 A0'; Between.
(* Goal: @CongA Tn A0 B C A0' B' C' *)
  apply acute2_suma2__conga with D E F.
(* Goal: @Acute Tn A0 B C *)
(* Goal: @SumA Tn A0 B C A0 B C D E F *)
    apply (bet_obtuse__acute A); auto.
(* Goal: @SumA Tn A0 B C A0 B C D E F *)
    apply bet2_suma__suma with A A; auto.
(* Goal: @Acute Tn A0' B' C' *)
(* Goal: @SumA Tn A0' B' C' A0' B' C' D E F *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    apply (bet_obtuse__acute A'); auto.
(* Goal: @SumA Tn A0' B' C' A0' B' C' D E F *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    apply bet2_suma__suma with A' A'; auto.
Qed.

(** If doubling two angles makes the same result, then they are either congruent or supplementary *)

Lemma bet_suma2__or_conga : forall A B C D E F A' B' C' A0, A0 <> B ->
  Bet A B A0 -> SumA A B C A B C D E F -> SumA A' B' C' A' B' C' D E F ->
  CongA A B C A' B' C' \/ CongA A0 B C A' B' C'.
Proof.
(* Goal: forall (A B C D E F A' B' C' A0 : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A0 B)) (_ : @Bet Tn A B A0) (_ : @SumA Tn A B C A B C D E F) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  intros A B C D E F A' B' C' A0 HBA0 HBet HSuma.
(* Goal: forall _ : @SumA Tn A' B' C' A' B' C' D E F, or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  revert A' B' C'.
  assert (Haux : forall A' B' C', Acute A' B' C' -> SumA A' B' C' A' B' C' D E F ->
    CongA A B C A' B' C' \/ CongA A0 B C A' B' C').
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @Acute Tn A' B' C') (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  { intros A' B' C' HAcute' HSuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    destruct (angle_partition A B C) as [HAcute|[HPer|HObtuse]]; auto.
    - left; apply acute2_suma2__conga with D E F; auto.
    - exfalso.
(* Goal: @TriSumA Tn A B C D E F *)
      apply (acute_suma__nbet A' B' C' D E F); [..|apply (per2_suma__bet A B C A B C)]; assumption.
    - right; apply acute2_suma2__conga with D E F; auto.
(* Goal: @Acute Tn A0 B C *)
(* Goal: @SumA Tn A0 B C A0 B C D E F *)
        apply (bet_obtuse__acute A); auto.
(* Goal: @SumA Tn A0 B C A0 B C D E F *)
        apply bet2_suma__suma with A A; auto.
  }
(* Goal: forall (A' B' C' : @Tpoint Tn) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  intros A' B' C' HSuma'.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
  destruct (angle_partition A' B' C') as [HAcute|[HPer|HObtuse]]; auto.
  - left.
(* Goal: @CongA Tn A B C A' B' C' *)
    apply l11_16; auto.
(* Goal: @TriSumA Tn A B C D E F *)
    apply bet_suma__per with D E F; [apply (per2_suma__bet A' B' C' A' B' C')|]; assumption.
  - destruct (segment_construction A' B' A' B') as [A0' []].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    assert_diffs.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
    destruct (Haux A0' B' C').
(* Goal: @Acute Tn A0' B' C' *)
(* Goal: @SumA Tn A0' B' C' A0' B' C' D E F *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      apply (bet_obtuse__acute A'); auto.
(* Goal: @SumA Tn A0' B' C' A0' B' C' D E F *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      apply bet2_suma__suma with A' A'; auto.
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
(* Goal: or (@CongA Tn A B C A' B' C') (@CongA Tn A0 B C A' B' C') *)
      right; apply l11_13 with A A0'; Between.
(* Goal: @CongA Tn A B C A' B' C' *)
      left; apply l11_13 with A0 A0'; Between.
Qed.

Lemma suma2__or_conga_suppa : forall A B C A' B' C' D E F ,
  SumA A B C A B C D E F -> SumA A' B' C' A' B' C' D E F ->
  CongA A B C A' B' C' \/ SuppA A B C A' B' C'.
Proof.
(* Goal: forall (A B C A' B' C' D E F : @Tpoint Tn) (_ : @SumA Tn A B C A B C D E F) (_ : @SumA Tn A' B' C' A' B' C' D E F), or (@CongA Tn A B C A' B' C') (@SuppA Tn A B C A' B' C') *)
  intros A B C A' B' C' D E F HSuma HSuma'.
(* Goal: or (@CongA Tn A B C A' B' C') (@SuppA Tn A B C A' B' C') *)
  destruct (segment_construction A B A B) as [A0 []].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: or (@CongA Tn A B C A' B' C') (@SuppA Tn A B C A' B' C') *)
  destruct (bet_suma2__or_conga A B C D E F A' B' C' A0); auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  right.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  exists A0; split; CongA.
Qed.


(** Basic properties about the sum of the angles of a triangle *)

Lemma ex_trisuma : forall A B C, A <> B -> B <> C -> A <> C ->
  exists D E F, TriSumA A B C D E F.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) A C)), @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @TriSumA Tn A B C D E F))) *)
  intros A B C HAB HBC HAC.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @TriSumA Tn A B C D E F))) *)
  destruct (ex_suma A B C B C A) as [G [H [I HSuma1]]]; auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @TriSumA Tn A B C D E F))) *)
  destruct (ex_suma G H I C A B) as [D [E [F HSuma2]]]; auto.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @TriSumA Tn A B C D E F))) *)
  exists D; exists E; exists F; exists G; exists H; exists I.
(* Goal: @TriSumA Tn A B C D E F *)
  split; assumption.
Qed.

Lemma trisuma_perm_231 : forall A B C D E F, TriSumA A B C D E F -> TriSumA B C A D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn C B A D E F *)
  intros A B C D E F HT.
(* Goal: @TriSumA Tn C B A D E F *)
  destruct HT as [A1 [B1 [C1 [HT1 HT2]]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @TriSumA Tn B C A D E F *)
  assert(Hex:= ex_suma B C A C A B).
(* Goal: @TriSumA Tn B C A D E F *)
  destruct Hex as [B2 [C2 [A2 Hex]]]; auto.
(* Goal: @ex (@Tpoint Tn) (fun I : @Tpoint Tn => and (@SumA Tn C B A B A C C2 A2 I) (@SumA Tn C2 A2 I A C B D E F)) *)
  exists B2.
(* Goal: @TriSumA Tn C B A D E F *)
  exists C2.
(* Goal: @ex (@Tpoint Tn) (fun H : @Tpoint Tn => @ex (@Tpoint Tn) (fun I : @Tpoint Tn => and (@SumA Tn C B A B A C C2 H I) (@SumA Tn C2 H I A C B D E F))) *)
  exists A2.
(* Goal: and (@SumA Tn B C A C A B B2 C2 A2) (@SumA Tn B2 C2 A2 A B C D E F) *)
  split; auto.
(* Goal: @SumA Tn B2 C2 A2 A B C D E F *)
  apply suma_sym.
(* Goal: @SumA Tn A B C B2 C2 A2 D E F *)
  apply (suma_assoc A B C B C A C A B D E F A1 B1 C1 B2 C2 A2); try (apply sams123231); auto.
Qed.

Lemma trisuma_perm_312 : forall A B C D E F, TriSumA A B C D E F -> TriSumA C A B D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @TriSumA Tn C A B D E F *)
  do 2 apply trisuma_perm_231.
(* Goal: @TriSumA Tn A B C D E F *)
  assumption.
Qed.

Lemma trisuma_perm_321 : forall A B C D E F, TriSumA A B C D E F -> TriSumA C B A D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn C B A D E F *)
  intros A B C D E F HT.
(* Goal: @TriSumA Tn C B A D E F *)
  destruct HT as [A1 [B1 [C1 [HT1 HT2]]]].
(* Goal: @TriSumA Tn C B A D E F *)
  apply suma_sym in HT2.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @TriSumA Tn C B A D E F *)
  assert(Hex:= ex_suma C A B A B C).
(* Goal: @TriSumA Tn C B A D E F *)
  destruct Hex as [C2 [A2 [B2 Hex]]]; auto.
(* Goal: @TriSumA Tn C B A D E F *)
  exists C2.
(* Goal: @ex (@Tpoint Tn) (fun H : @Tpoint Tn => @ex (@Tpoint Tn) (fun I : @Tpoint Tn => and (@SumA Tn C B A B A C C2 H I) (@SumA Tn C2 H I A C B D E F))) *)
  exists A2.
(* Goal: @ex (@Tpoint Tn) (fun I : @Tpoint Tn => and (@SumA Tn C B A B A C C2 A2 I) (@SumA Tn C2 A2 I A C B D E F)) *)
  exists B2.
(* Goal: and (@SumA Tn C B A B A C C2 A2 B2) (@SumA Tn C2 A2 B2 A C B D E F) *)
  split.
(* Goal: @SumA Tn C B A B A C C2 A2 B2 *)
(* Goal: @SumA Tn C2 A2 B2 A C B D E F *)
  SumA.
(* Goal: @SumA Tn C2 A2 B2 A C B D E F *)
  apply suma_middle_comm.
(* Goal: @SumA Tn C2 A2 B2 B C A D E F *)
  apply (suma_assoc C A B A B C B C A D E F C2 A2 B2 A1 B1 C1); try (apply sams123231); auto.
Qed.

Lemma trisuma_perm_213 : forall A B C D E F, TriSumA A B C D E F -> TriSumA B A C D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @TriSumA Tn A C B D E F *)
  apply trisuma_perm_321.
(* Goal: @TriSumA Tn C A B D E F *)
  apply trisuma_perm_312.
(* Goal: @TriSumA Tn A B C D E F *)
  assumption.
Qed.

Lemma trisuma_perm_132 : forall A B C D E F, TriSumA A B C D E F -> TriSumA A C B D E F.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @TriSumA Tn A C B D E F *)
  intros.
(* Goal: @TriSumA Tn A C B D E F *)
  apply trisuma_perm_321.
(* Goal: @TriSumA Tn B C A D E F *)
  apply trisuma_perm_231.
(* Goal: @TriSumA Tn A B C D E F *)
  assumption.
Qed.

Lemma conga_trisuma__trisuma : forall A B C D E F D' E' F',
  TriSumA A B C D E F -> CongA D E F D' E' F' -> TriSumA A B C D' E' F'.
Proof.
(* Goal: forall (A B C D E F D' E' F' : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F) (_ : @CongA Tn D E F D' E' F'), @TriSumA Tn A B C D' E' F' *)
  intros A B C D E F D' E' F' HTri HConga.
(* Goal: @CongA Tn D E F D' E' F' *)
  destruct HTri as [G [H [I [HSuma1 HSuma2]]]].
(* Goal: @TriSumA Tn A B C D' E' F' *)
  exists G; exists H; exists I; split; trivial.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  assert_diffs; apply (conga3_suma__suma G H I C A B D E F); CongA.
Qed.

Lemma trisuma2__conga : forall A B C D E F D' E' F',
  TriSumA A B C D E F -> TriSumA A B C D' E' F' -> CongA D E F D' E' F'.
Proof.
(* Goal: forall (A B C D E F D' E' F' : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F) (_ : @TriSumA Tn A B C D' E' F'), @CongA Tn D E F D' E' F' *)
  intros A B C D E F D' E' F' HTri HTri'.
(* Goal: @CongA Tn D E F D' E' F' *)
  destruct HTri as [G [H [I [HSuma1 HSuma2]]]].
(* Goal: @CongA Tn D E F D' E' F' *)
  destruct HTri' as [G' [H' [I' [HSuma1' HSuma2']]]].
(* Goal: @CongA Tn D E F D' E' F' *)
  apply (suma2__conga G H I C A B); trivial.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  apply (conga3_suma__suma G' H' I' C A B D' E' F'); CongA.
(* Goal: @CongA Tn G' H' I' G H I *)
  apply (suma2__conga A B C B C A); trivial.
Qed.

Lemma conga3_trisuma__trisuma : forall A B C D E F A' B' C', TriSumA A B C D E F ->
  CongA A B C A' B' C' -> CongA B C A B' C' A' -> CongA C A B C' A' B' ->
  TriSumA A' B' C' D E F.
Proof.
(* Goal: forall (A B C D E F A' B' C' : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F) (_ : @CongA Tn A B C A' B' C') (_ : @CongA Tn B C A B' C' A') (_ : @CongA Tn C A B C' A' B'), @TriSumA Tn A' B' C' D E F *)
  intros A B C D E F A' B' C' HTri HCongaB HCongaC HCongaA.
(* Goal: @TriSumA Tn A' B' C' D E F *)
  destruct HTri as [G [H [I [HSuma HSuma']]]].
  assert_diffs; exists G; exists H; exists I; split;
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
  [apply (conga3_suma__suma A B C B C A G H I)|apply (conga3_suma__suma G H I C A B D E F)]; CongA.
Qed.

(** The sum of the angles of a degenerate triangle is a straight angle *)

Lemma col_trisuma__bet : forall A B C P Q R, Col A B C -> TriSumA A B C P Q R -> Bet P Q R.
Proof.
(* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : @Col Tn A B C) (_ : @TriSumA Tn A B C P Q R), @Bet Tn P Q R *)
  intros A B C P Q R HCol HTri.
(* Goal: @Bet Tn P Q R *)
  destruct HTri as [D [E [F []]]].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: @Bet Tn P Q R *)
  destruct HCol as [|[|]].
  - apply (bet_conga__bet A B C); auto.
(* Goal: @CongA Tn B C A P Q R *)
    apply (conga_trans _ _ _ D E F).
(* Goal: @CongA Tn A B C D E F *)
(* Goal: @CongA Tn D E F P Q R *)
    apply (out546_suma__conga _ _ _ B C A); try (apply bet_out); Between.
(* Goal: @CongA Tn D E F P Q R *)
    apply (out546_suma__conga _ _ _ C A B); try (apply l6_6; apply bet_out); auto.
  - apply (bet_conga__bet B C A); auto.
(* Goal: @CongA Tn B C A P Q R *)
    apply (conga_trans _ _ _ D E F).
(* Goal: @CongA Tn B C A D E F *)
(* Goal: @CongA Tn D E F P Q R *)
    apply (out213_suma__conga A B C); try (apply l6_6; apply bet_out); auto.
(* Goal: @CongA Tn D E F P Q R *)
    apply (out546_suma__conga _ _ _ C A B); try (apply bet_out); Between.
  - apply (bet_conga__bet C A B); auto.
(* Goal: @CongA Tn C A B P Q R *)
    apply (out213_suma__conga D E F); auto.
(* Goal: @Out Tn E D F *)
    apply (l11_21_a B C A); try (apply l6_6; apply bet_out); auto.
(* Goal: @CongA Tn B C A D E F *)
    apply (out213_suma__conga A B C); try (apply bet_out); Between.
Qed.

(** Decidability properties *)

Lemma suma_dec : forall A B C D E F G H I, SumA A B C D E F G H I \/ ~ SumA A B C D E F G H I.
Proof.
(* Goal: forall A B C D E F G H I : @Tpoint Tn, or (@SumA Tn A B C D E F G H I) (not (@SumA Tn A B C D E F G H I)) *)
  intros A B C D E F G H I.
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  destruct(eq_dec_points A B).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    subst; right; intro; assert_diffs; auto.
(* Goal: or (@SumA Tn A B C D E F G H I) (not (@SumA Tn A B C D E F G H I)) *)
  destruct(eq_dec_points C B).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    subst; right; intro; assert_diffs; auto.
(* Goal: or (@SumA Tn A B C D E F G H I) (not (@SumA Tn A B C D E F G H I)) *)
  destruct(eq_dec_points D E).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    subst; right; intro; assert_diffs; auto.
(* Goal: or (@SumA Tn A B C D E F G H I) (not (@SumA Tn A B C D E F G H I)) *)
  destruct(eq_dec_points F E).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    subst; right; intro; assert_diffs; auto.
(* Goal: or (@SumA Tn A B C D E F G H I) (not (@SumA Tn A B C D E F G H I)) *)
  destruct (ex_suma A B C D E F) as [G' [H' [I']]]; auto.
(* Goal: or (@SumA Tn A B C D E F G H I) (not (@SumA Tn A B C D E F G H I)) *)
  destruct(conga_dec G H I G' H' I') as [|HNCongA].
(* Goal: @CongA Tn C B C1 D E F *)
(* Goal: @CongA Tn C1 B J F E F1 *)
    left; apply (conga3_suma__suma A B C D E F G' H' I'); CongA.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  right.
(* Goal: not (@SAMS Tn A B C D E F) *)
  intro.
(* Goal: False *)
  apply HNCongA, (suma2__conga A B C D E F); auto.
Qed.

Lemma sams_dec : forall A B C D E F, SAMS A B C D E F \/ ~ SAMS A B C D E F.
Proof.
(* Goal: forall A B C D E F : @Tpoint Tn, or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  intros A B C D E F.
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  destruct(eq_dec_points A B).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
    subst; right; intro; assert_diffs; auto.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert(HA' := symmetric_point_construction A B).
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  destruct HA' as [A'].
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  assert_diffs.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  destruct(lea_dec D E F C B A') as [|HNlea].
(* Goal: @SAMS Tn A B C A B C *)
    left; apply (sams_chara _ _ _ _ _ _ A'); Between.
(* Goal: or (@SAMS Tn A B C D E F) (not (@SAMS Tn A B C D E F)) *)
  right.
(* Goal: not (@SAMS Tn A B C D E F) *)
  intro.
(* Goal: False *)
  apply HNlea, (sams_chara A); Between.
Qed.

Lemma trisuma_dec : forall A B C P Q R, TriSumA A B C P Q R \/ ~ TriSumA A B C P Q R.
Proof.
(* Goal: forall A B C P Q R : @Tpoint Tn, or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  intros A B C P Q R.
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  destruct(eq_dec_points A B).
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
    subst; right; intros [D [E [F []]]]; assert_diffs; auto.
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  destruct(eq_dec_points B C).
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
    subst; right; intros [D [E [F []]]]; assert_diffs; auto.
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  destruct(eq_dec_points A C).
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
    subst; right; intros [D [E [F []]]]; assert_diffs; auto.
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  destruct (ex_trisuma A B C) as [D [E [F]]]; auto.
(* Goal: or (@TriSumA Tn A B C P Q R) (not (@TriSumA Tn A B C P Q R)) *)
  destruct (conga_dec D E F P Q R) as [|HNCong].
(* Goal: @TriSumA Tn A B C D E F *)
    left; apply conga_trisuma__trisuma with D E F; assumption.
(* Goal: @TriSumA Tn A B C D E F *)
    right; intro; apply HNCong, (trisuma2__conga A B C); assumption.
Qed.

End Suma_2.

Hint Resolve per2__sams acute2__sams acute_per__sams sams123231 bet_suppa__suma : suma.
