Require Export GeoCoq.Elements.OriginalProofs.lemma_diagonalsmeet.
Require Export GeoCoq.Elements.OriginalProofs.proposition_29B.
Require Export GeoCoq.Elements.OriginalProofs.proposition_26A.

Section Euclid.

Context `{Ax:euclidean_euclidean}.

Lemma proposition_34 : 
   forall A B C D, 
   PG A C D B ->
   Cong A B C D /\ Cong A C B D /\ CongA C A B B D C /\ CongA A B D D C A /\ Cong_3 C A B B D C.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @PG Ax0 A C D B), and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
intros.
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert ((Par A C D B /\ Par A B C D)) by (conclude_def PG ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Par A C B D) by (forward_using lemma_parallelflip).
let Tf:=fresh in
assert (Tf:exists M, (BetS A M D /\ BetS C M B)) by (conclude lemma_diagonalsmeet);destruct Tf as [M];spliter.
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (BetS B M C) by (conclude axiom_betweennesssymmetry).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Col B M C) by (conclude_def Col ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Col B C M) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (~ Meet A B C D) by (conclude_def Par ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq A B) by (conclude_def Par ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq C D) by (conclude_def Par ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (~ Col B C A).
(* Goal: not (@Col Ax0 A B D) *)
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
 {
(* Goal: not (@Col Ax0 A B D) *)
 intro.
(* Goal: False *)
 assert (Col A B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: False *)
 assert (Col C D C) by (conclude_def Col ).
(* Goal: False *)
 assert (Meet A B C D) by (conclude_def Meet ).
(* Goal: False *)
 contradict.
 }
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (TS A B C D) by (conclude_def TS ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA A B C B C D) by (conclude proposition_29B).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (~ Col B C D).
(* Goal: not (@Col Ax0 A B D) *)
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
 {
(* Goal: not (@Col Ax0 A B D) *)
 intro.
(* Goal: False *)
 assert (Col C D B) by (forward_using lemma_collinearorder).
(* Goal: False *)
 assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: False *)
 assert (Col A B B) by (conclude_def Col ).
(* Goal: False *)
 assert (Meet A B C D) by (conclude_def Meet ).
(* Goal: False *)
 assert (~ Meet A B C D) by (conclude_def Par ).
(* Goal: False *)
 contradict.
 }
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA B C D D C B) by (conclude lemma_ABCequalsCBA).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA A B C D C B) by (conclude lemma_equalanglestransitive).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Col C B M) by (forward_using lemma_collinearorder).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (nCol C B A).
(* Goal: not (@Col Ax0 A B D) *)
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
 {
(* Goal: @nCol Ax0 C B A *)
 assert (nCol B C A) by auto.
(* Goal: @nCol Ax0 C B A *)
 forward_using lemma_NCorder.
 }
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (TS A C B D) by (conclude_def TS ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA A C B C B D) by (conclude proposition_29B).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (nCol A B C) by (forward_using lemma_NCorder).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA B C A A C B) by (conclude lemma_ABCequalsCBA).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA B C A C B D) by (conclude lemma_equalanglestransitive).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Triangle A B C) by (conclude_def Triangle ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (nCol D C B) by (conclude lemma_equalanglesNC).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Triangle D C B) by (conclude_def Triangle ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong B C C B) by (conclude cn_equalityreverse).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert ((Cong A B D C /\ Cong A C D B /\ CongA B A C C D B)) by (conclude proposition_26A).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong A B C D) by (forward_using lemma_congruenceflip).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong A C B D) by (forward_using lemma_congruenceflip).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong C A B D) by (forward_using lemma_congruenceflip).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong C B B C) by (conclude cn_equalityreverse).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong_3 C A B B D C) by (conclude_def Cong_3 ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA C A B B D C) by (conclude lemma_equalanglesflip).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong A D D A) by (conclude cn_equalityreverse).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: False *)
assert (eq D D) by (conclude cn_equalityreflexive).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq A C) by (forward_using lemma_angledistinct).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq C A) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq C D) by (forward_using lemma_angledistinct).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq B A) by (forward_using lemma_angledistinct).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq D B) by (forward_using lemma_angledistinct).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (neq B D) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Out C A A) by (conclude lemma_ray4).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Out C D D) by (conclude lemma_ray4).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Out B A A) by (conclude lemma_ray4).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Out B D D) by (conclude lemma_ray4).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong B A C D) by (forward_using lemma_congruenceflip).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong C A B D) by (forward_using lemma_congruenceflip).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (Cong B D C A) by (conclude lemma_congruencesymmetric).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (~ Col A B D).
(* Goal: not (@Col Ax0 A B D) *)
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
 {
(* Goal: not (@Col Ax0 A B D) *)
 intro.
(* Goal: False *)
 assert (eq D D) by (conclude cn_equalityreflexive).
(* Goal: False *)
 assert (Col C D D) by (conclude_def Col ).
(* Goal: False *)
 assert (Meet A B C D) by (conclude_def Meet ).
(* Goal: False *)
 contradict.
 }
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
assert (CongA A B D D C A) by (conclude_def CongA ).
(* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *)
close.
Qed.

End Euclid.


