Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelNC.
Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelsymmetric.
Require Export GeoCoq.Elements.OriginalProofs.proposition_29B.
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCdistinct.
Require Export GeoCoq.Elements.OriginalProofs.lemma_samesidetransitive.

Section Euclid.

Context `{Ax:euclidean_euclidean}.

Lemma lemma_Playfairhelper : 
   forall A B C D E, 
   Par A B C D -> Par A B C E -> CR A D B C -> CR A E B C ->
   Col C D E.
Proof.
(* Goal: forall (A B C D E : @Point Ax0) (_ : @Par Ax0 A B C D) (_ : @Par Ax0 A B C E) (_ : @CR Ax0 A D B C) (_ : @CR Ax0 A E B C), @Col Ax0 C D E *)
intros.
let Tf:=fresh in
assert (Tf:exists M, (BetS A M D /\ BetS B M C)) by (conclude_def CR );destruct Tf as [M];spliter.
let Tf:=fresh in
assert (Tf:exists m, (BetS A m E /\ BetS B m C)) by (conclude_def CR );destruct Tf as [m];spliter.
(* Goal: @Col Ax0 C D E *)
assert (neq B C) by (forward_using lemma_betweennotequal).
(* Goal: @Col Ax0 C D E *)
assert (BetS E m A) by (conclude axiom_betweennesssymmetry).
(* Goal: @Col Ax0 C D E *)
assert (BetS D M A) by (conclude axiom_betweennesssymmetry).
(* Goal: @Col Ax0 C D E *)
assert (Col B M C) by (conclude_def Col ).
(* Goal: @Col Ax0 C D E *)
assert (Col B m C) by (conclude_def Col ).
(* Goal: @Col Ax0 C D E *)
assert (Col C B M) by (forward_using lemma_collinearorder).
(* Goal: @Col Ax0 C D E *)
assert (Col C B m) by (forward_using lemma_collinearorder).
(* Goal: @Col Ax0 C D E *)
assert (nCol B C E) by (forward_using lemma_parallelNC).
(* Goal: @Col Ax0 C D E *)
assert (nCol C B E) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (nCol B C D) by (forward_using lemma_parallelNC).
(* Goal: @Col Ax0 C D E *)
assert (nCol C B D) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (TS E C B A) by (conclude_def TS ).
(* Goal: @Col Ax0 C D E *)
assert (TS D C B A) by (conclude_def TS ).
(* Goal: @Col Ax0 C D E *)
assert (Par C D A B) by (conclude lemma_parallelsymmetric).
(* Goal: @Col Ax0 C D E *)
assert (Par C E A B) by (conclude lemma_parallelsymmetric).
(* Goal: @Col Ax0 C D E *)
assert (Par E C B A) by (forward_using lemma_parallelflip).
(* Goal: @Col Ax0 C D E *)
assert (Par D C B A) by (forward_using lemma_parallelflip).
(* Goal: @Col Ax0 C D E *)
assert (CongA E C B C B A) by (conclude proposition_29B).
(* Goal: @Col Ax0 C D E *)
assert (CongA D C B C B A) by (conclude proposition_29B).
(* Goal: @Col Ax0 C D E *)
assert (CongA C B A D C B) by (conclude lemma_equalanglessymmetric).
(* Goal: @Col Ax0 C D E *)
assert (CongA E C B D C B) by (conclude lemma_equalanglestransitive).
(* Goal: @Col Ax0 C D E *)
assert (neq C E) by (forward_using lemma_NCdistinct).
(* Goal: @Col Ax0 C D E *)
assert (neq C D) by (forward_using lemma_NCdistinct).
let Tf:=fresh in
assert (Tf:exists e, (Out C E e /\ Cong C e C D)) by (conclude lemma_layoff);destruct Tf as [e];spliter.
(* Goal: @Col Ax0 C D E *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @Col Ax0 C D E *)
assert (neq C B) by (conclude lemma_inequalitysymmetric).
(* Goal: @Col Ax0 C D E *)
assert (Out C B B) by (conclude lemma_ray4).
(* Goal: @Col Ax0 C D E *)
assert (Cong C B C B) by (conclude cn_congruencereflexive).
(* Goal: @Col Ax0 C D E *)
assert (nCol E C B) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (CongA E C B E C B) by (conclude lemma_equalanglesreflexive).
(* Goal: @Col Ax0 C D E *)
assert (CongA E C B e C B) by (conclude lemma_equalangleshelper).
(* Goal: @Col Ax0 C D E *)
assert (CongA e C B E C B) by (conclude lemma_equalanglessymmetric).
(* Goal: @Col Ax0 C D E *)
assert (CongA e C B D C B) by (conclude lemma_equalanglestransitive).
(* Goal: @Col Ax0 C D E *)
assert (Col C E e) by (conclude lemma_rayimpliescollinear).
(* Goal: @Col Ax0 C D E *)
assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: @Col Ax0 C D E *)
assert (Col C E C) by (conclude_def Col ).
(* Goal: @Col Ax0 C D E *)
assert (nCol C E B) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (neq C e) by (conclude lemma_raystrict).
(* Goal: @Col Ax0 C D E *)
assert (nCol C e B) by (conclude lemma_NChelper).
(* Goal: @Col Ax0 C D E *)
assert (nCol e C B) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (Triangle e C B) by (conclude_def Triangle ).
(* Goal: @Col Ax0 C D E *)
assert (nCol D C B) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (Triangle D C B) by (conclude_def Triangle ).
(* Goal: @Col Ax0 C D E *)
assert (Cong e B D B) by (conclude proposition_04).
(* Goal: @Col Ax0 C D E *)
assert (nCol B C E) by (forward_using lemma_parallelNC).
(* Goal: @Col Ax0 C D E *)
assert (nCol C B E) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (nCol B C D) by (forward_using lemma_parallelNC).
(* Goal: @Col Ax0 C D E *)
assert (nCol C B D) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (OS E D C B) by (conclude_def OS ).
(* Goal: @Col Ax0 C D E *)
assert (nCol C B e) by (forward_using lemma_NCorder).
(* Goal: @Col Ax0 C D E *)
assert (Col C C B) by (conclude_def Col ).
(* Goal: @Col Ax0 C D E *)
assert (Out C e E) by (conclude lemma_ray5).
(* Goal: @Col Ax0 C D E *)
assert (OS e e C B) by (conclude lemma_samesidereflexive).
(* Goal: @Col Ax0 C D E *)
assert (OS e E C B) by (conclude lemma_sameside2).
(* Goal: @Col Ax0 C D E *)
assert (OS e D C B) by (conclude lemma_samesidetransitive).
(* Goal: @Col Ax0 C D E *)
assert (Cong e C D C) by (forward_using lemma_congruenceflip).
(* Goal: @Col Ax0 C D E *)
assert (eq e D) by (conclude proposition_07).
(* Goal: @Col Ax0 C D E *)
assert (Col C E D) by (conclude cn_equalitysub).
(* Goal: @Col Ax0 C D E *)
assert (Col C D E) by (forward_using lemma_collinearorder).
(* Goal: @Col Ax0 C D E *)
close.
Qed.

End Euclid.


