Require Export GeoCoq.Elements.OriginalProofs.lemma_NCdistinct.
Require Export GeoCoq.Elements.OriginalProofs.proposition_31short.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearparallel.
Require Export GeoCoq.Elements.OriginalProofs.proposition_29.

Section Euclid.

Context `{Ax:euclidean_euclidean}.

Lemma proposition_32 : 
   forall A B C D, 
   Triangle A B C -> BetS B C D ->
   SumA C A B A B C A C D.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @BetS Ax0 B C D), @SumA Ax0 C A B A B C A C D *)
intros.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol A B C) by (conclude_def Triangle ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq B A) by (forward_using lemma_NCdistinct).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq A B) by (conclude lemma_inequalitysymmetric).
let Tf:=fresh in
assert (Tf:exists F, (BetS B A F /\ Cong A F B A)) by (conclude lemma_extension);destruct Tf as [F];spliter.
(* Goal: False *)
assert (Col B A F) by (conclude_def Col ).
(* Goal: False *)
assert (Col A B F) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A B B) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq B F) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq F B) by (conclude lemma_inequalitysymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol F B C) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS F A B) by (conclude axiom_betweennesssymmetry).
rename_H H;let Tf:=fresh in
assert (Tf:exists E H S, (BetS E C H /\ CongA E C A C A B /\ Par E H F B /\ BetS E S B /\ BetS C S A)) by (conclude proposition_31short);destruct Tf as [E[H[S]]];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq B C) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq C B) by (conclude lemma_inequalitysymmetric).
let Tf:=fresh in
assert (Tf:exists G, (BetS C B G /\ Cong B G C B)) by (conclude lemma_extension);destruct Tf as [G];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq C A) by (forward_using lemma_NCdistinct).
let Tf:=fresh in
assert (Tf:exists J, (BetS C A J /\ Cong A J C A)) by (conclude lemma_extension);destruct Tf as [J];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq A C) by (conclude lemma_inequalitysymmetric).
let Tf:=fresh in
assert (Tf:exists K, (BetS A C K /\ Cong C K A C)) by (conclude lemma_extension);destruct Tf as [K];spliter.
let Tf:=fresh in
assert (Tf:exists M, (BetS A B M /\ Cong B M A B)) by (conclude lemma_extension);destruct Tf as [M];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col F B A) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Par E H A B) by (conclude lemma_collinearparallel).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS K C A) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col C S A) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col C A S) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol A C B) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A C S) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq C S) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq S C) by (conclude lemma_inequalitysymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A C C) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol S C B) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol B S C) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col E S B) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B S E) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B S B) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS B S E) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq B E) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol B E C) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B E S) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq E E) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B E E) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq S E) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol S E C) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol S C E) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col S C C) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col C S A) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col S C A) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq C A) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol C A E) by (conclude lemma_NChelper).
(* Goal: False *)
assert (Col A B M) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B A M) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Par E H B A) by (forward_using lemma_parallelflip).
(* Goal: False *)
assert (neq A M) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq M A) by (conclude lemma_inequalitysymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Par E H M A) by (conclude lemma_collinearparallel).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS H C E) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS M B A) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS F A B) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS D C B) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol B C A) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol A C B) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq B E) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS E C H) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS A S C) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol C E A) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col C E H) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col C E E) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq E H) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq H E) by (conclude lemma_inequalitysymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol H E A) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol E H A) by (forward_using lemma_NCorder).
let Tf:=fresh in
assert (Tf:exists Q, (BetS A Q H /\ BetS E S Q)) by (conclude postulate_Pasch_outer);destruct Tf as [Q];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col E S Q) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col S E B) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col S E Q) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col E B Q) by (conclude lemma_collinear4).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B E Q) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq H E) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq C E) by (forward_using lemma_betweennotequal).
let Tf:=fresh in
assert (Tf:exists L, (BetS H E L /\ Cong E L C E)) by (conclude lemma_extension);destruct Tf as [L];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS L E H) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col L E H) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq L H) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq E H) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col A B M) by (conclude_def Col ).
(* Goal: False *)
assert (neq A M) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq A B) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (~ Meet A M L H).
(* Goal: not (@Meet Ax0 A M L H) *)
(* Goal: @SumA Ax0 C A B A B C A C D *)
 {
(* Goal: not (@Meet Ax0 A M L H) *)
 intro.
 let Tf:=fresh in
 assert (Tf:exists c, (neq A M /\ neq L H /\ Col A M c /\ Col L H c)) by (conclude_def Meet );destruct Tf as [c];spliter.
(* Goal: False *)
 assert (Col H E L) by (conclude_def Col ).
(* Goal: False *)
 assert (Col L H E) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (neq H L) by (forward_using lemma_betweennotequal).
(* Goal: False *)
 assert (neq L H) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
 assert (Col H c E) by (conclude lemma_collinear4).
(* Goal: False *)
 assert (Col E H c) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (Col A B M) by (conclude_def Col ).
(* Goal: False *)
 assert (Col M A B) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (Col M A c) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (neq A M) by (forward_using lemma_betweennotequal).
(* Goal: False *)
 assert (neq M A) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
 assert (Col A B c) by (conclude lemma_collinear4).
(* Goal: False *)
 assert (Col B A F) by (conclude_def Col ).
(* Goal: False *)
 assert (Col A B F) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (Col B c F) by (conclude lemma_collinear4).
(* Goal: False *)
 assert (Col F B c) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (Meet E H F B) by (conclude_def Meet ).
(* Goal: False *)
 assert (~ Meet E H F B) by (conclude_def Par ).
(* Goal: False *)
 contradict.
 }
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS B Q E) by (conclude lemma_collinearbetween).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol A H E) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A Q H) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A H Q) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq H H) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A H H) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq Q H) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol Q H E) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol Q E H) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq E E) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col Q E E) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col Q E B) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol B E H) by (conclude lemma_NChelper).
let Tf:=fresh in
assert (Tf:exists T, (BetS B T C /\ BetS H T Q)) by (conclude postulate_Pasch_inner);destruct Tf as [T];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS Q T H) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS A T H) by (conclude lemma_3_5b).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B T C) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col C B T) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol C B A) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (TS A C B H) by (conclude_def TS ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (TS H C B A) by (conclude lemma_oppositesidesymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Par H E M A) by (forward_using lemma_parallelflip).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA A C E B A C) by (conclude lemma_equalanglesflip).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert ((CongA H C B C B A /\ CongA D C E C B A /\ RT E C B C B A)) by (conclude proposition_29).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA C B A A B C) by (conclude lemma_ABCequalsCBA).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA D C E A B C) by (conclude lemma_equalanglestransitive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS T C D) by (conclude lemma_3_6a).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq T D) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol B C A) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B C T) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col B C D) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol T D A) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol A T D) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A T A) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A T H) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq A H) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol A H D) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol H A D) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS H T A) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS D C T) by (conclude axiom_betweennesssymmetry).
let Tf:=fresh in
assert (Tf:exists R, (BetS D R A /\ BetS H C R)) by (conclude postulate_Pasch_outer);destruct Tf as [R];spliter.
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Out C E R) by (conclude_def Out ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Out C A A) by (conclude lemma_ray4).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq C D) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq D D) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (BetS A R D) by (conclude axiom_betweennesssymmetry).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA B A C A C E) by (conclude lemma_equalanglessymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA B A C A C R) by (conclude lemma_equalangleshelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol C A B) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA C A B B A C) by (conclude lemma_ABCequalsCBA).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA C A B A C R) by (conclude lemma_equalanglestransitive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Out C D D) by (conclude lemma_ray4).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA A B C D C E) by (conclude lemma_equalanglessymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA A B C D C R) by (conclude lemma_equalangleshelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol A D H) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col D R A) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A D R) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq D D) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col A D D) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq D R) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq R D) by (conclude lemma_inequalitysymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol R D H) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol R H D) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col H C R) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col R H C) by (forward_using lemma_collinearorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (eq R R) by (conclude cn_equalityreflexive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (Col R H R) by (conclude_def Col ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq C R) by (forward_using lemma_betweennotequal).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (neq R C) by (conclude lemma_inequalitysymmetric).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol R C D) by (conclude lemma_NChelper).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (nCol D C R) by (forward_using lemma_NCorder).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA D C R R C D) by (conclude lemma_ABCequalsCBA).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (CongA A B C R C D) by (conclude lemma_equalanglestransitive).
(* Goal: @SumA Ax0 C A B A B C A C D *)
assert (SumA C A B A B C A C D) by (conclude_def SumA ).
(* Goal: @SumA Ax0 C A B A B C A C D *)
close.
Qed.

End Euclid.


