Require Export GeoCoq.Elements.OriginalProofs.lemma_rightangleNC.
Require Export GeoCoq.Elements.OriginalProofs.lemma_ABCequalsCBA.
Require Export GeoCoq.Elements.OriginalProofs.lemma_supplements.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglestransitive.

Section Euclid.

Context `{Ax:euclidean_neutral_ruler_compass}.

Lemma lemma_8_2 : 
   forall A B C, 
   Per A B C ->
   Per C B A.
Proof.
(* Goal: forall (A B C : @Point Ax0) (_ : @Per Ax0 A B C), @Per Ax0 C B A *)
intros.
let Tf:=fresh in
assert (Tf:exists D, (BetS A B D /\ Cong A B D B /\ Cong A C D C /\ neq B C)) by (conclude_def Per );destruct Tf as [D];spliter.
(* Goal: @Per Ax0 C B A *)
assert (neq C B) by (conclude lemma_inequalitysymmetric).
let Tf:=fresh in
assert (Tf:exists E, (BetS C B E /\ Cong B E B C)) by (conclude lemma_extension);destruct Tf as [E];spliter.
(* Goal: @Per Ax0 C B A *)
assert (neq A B) by (forward_using lemma_betweennotequal).
(* Goal: @Per Ax0 C B A *)
assert (neq B A) by (conclude lemma_inequalitysymmetric).
(* Goal: @Per Ax0 C B A *)
assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: @Per Ax0 C B A *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: @Per Ax0 C B A *)
assert (Out B C C) by (conclude lemma_ray4).
(* Goal: @Per Ax0 C B A *)
assert (nCol A B C) by (conclude lemma_rightangleNC).
(* Goal: @Per Ax0 C B A *)
assert (Supp A B C C D) by (conclude_def Supp ).
(* Goal: @Per Ax0 C B A *)
assert (Out B A A) by (conclude lemma_ray4).
(* Goal: @Per Ax0 C B A *)
assert (Supp C B A A E) by (conclude_def Supp ).
(* Goal: @Per Ax0 C B A *)
assert (CongA A B C C B A) by (conclude lemma_ABCequalsCBA).
(* Goal: @Per Ax0 C B A *)
assert (CongA C B D A B E) by (conclude lemma_supplements).
(* Goal: @Per Ax0 C B A *)
assert (Cong B C B E) by (conclude lemma_congruencesymmetric).
(* Goal: @Per Ax0 C B A *)
assert (Cong B D B A) by (forward_using lemma_doublereverse).
(* Goal: @Per Ax0 C B A *)
assert (~ Col E B A).
(* Goal: not (@Col Ax0 A B E) *)
(* Goal: @Per Ax0 C B A *)
 {
(* Goal: not (@Col Ax0 A B E) *)
 intro.
(* Goal: False *)
 assert (Col C B E) by (conclude_def Col ).
(* Goal: False *)
 assert (Col E B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (neq B E) by (forward_using lemma_betweennotequal).
(* Goal: False *)
 assert (neq E B) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
 assert (Col B A C) by (conclude lemma_collinear4).
(* Goal: False *)
 assert (Col A B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
 contradict.
 }
(* Goal: @Per Ax0 C B A *)
assert (~ Col A B E).
(* Goal: not (@Col Ax0 A B E) *)
(* Goal: @Per Ax0 C B A *)
 {
(* Goal: not (@Col Ax0 A B E) *)
 intro.
(* Goal: False *)
 assert (Col E B A) by (forward_using lemma_collinearorder).
(* Goal: False *)
 contradict.
 }
(* Goal: @Per Ax0 C B A *)
assert (CongA A B E E B A) by (conclude lemma_ABCequalsCBA).
(* Goal: @Per Ax0 C B A *)
assert (CongA C B D E B A) by (conclude lemma_equalanglestransitive).
(* Goal: @Per Ax0 C B A *)
assert ((Cong C D E A /\ CongA B C D B E A /\ CongA B D C B A E)) by (conclude proposition_04).
(* Goal: @Per Ax0 C B A *)
assert (Cong A C C D) by (forward_using lemma_congruenceflip).
(* Goal: @Per Ax0 C B A *)
assert (Cong A C E A) by (conclude lemma_congruencetransitive).
(* Goal: @Per Ax0 C B A *)
assert (Cong C A E A) by (forward_using lemma_congruenceflip).
(* Goal: @Per Ax0 C B A *)
assert (Cong C B E B) by (forward_using lemma_congruenceflip).
(* Goal: @Per Ax0 C B A *)
assert (neq B A) by (conclude lemma_inequalitysymmetric).
(* Goal: @Per Ax0 C B A *)
assert (Per C B A) by (conclude_def Per ).
(* Goal: @Per Ax0 C B A *)
close.
Qed.

End Euclid.


