  (* Gabriel Braun April 2013 *)

Require Export GeoCoq.Tarski_dev.Ch12_parallel.

Section L13_1.

Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.

(** Pappus Desargues *)

Lemma per2_col_eq : forall A P P' B, A <> P -> A <> P' -> Per A P B -> Per A P' B -> Col P A P' -> P = P'.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @eq (@Tpoint Tn) P P' *)
induction(eq_dec_points P B).
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
assert( A = P' \/ P = P').
(* Goal: or (@eq (@Tpoint Tn) A P') (@eq (@Tpoint Tn) P P') *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
apply(l8_9 A P' P H2); Col.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
induction H4.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @eq (@Tpoint Tn) P P' *)
induction(eq_dec_points P' B).
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
assert(A = P \/ P' = P).
(* Goal: or (@eq (@Tpoint Tn) A P) (@eq (@Tpoint Tn) P' P) *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
apply(l8_9 A P P' H1); Col.
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
induction H5; auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @eq (@Tpoint Tn) P P' *)
apply per_perp_in in H1; auto.
(* Goal: @eq (@Tpoint Tn) P P' *)
apply per_perp_in in H2; auto.

(* Goal: @eq (@Tpoint Tn) P P' *)
apply perp_in_comm in H1.
(* Goal: @Perp Tn A B' B' B *)
(* Goal: not (@eq (@Tpoint Tn) A B') *)
(* Goal: not (@eq (@Tpoint Tn) B' B) *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H2.
(* Goal: @eq (@Tpoint Tn) P P' *)
apply perp_in_perp_bis in H1.
(* Goal: @Perp Tn A B' B' B *)
(* Goal: not (@eq (@Tpoint Tn) A B') *)
(* Goal: not (@eq (@Tpoint Tn) B' B) *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H2.
(* Goal: @eq (@Tpoint Tn) P P' *)
induction H1; induction H2.
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
apply(l8_18_uniqueness P A B P P'); Col.
(* Goal: not (@Col Tn P A B) *)
(* Goal: @Perp Tn P A B P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
apply perp_not_col; auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Perp Tn A P B P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
(* Goal: @eq (@Tpoint Tn) P P' *)
apply(perp_col A P' B P' P); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp Tn A B' B' B *)
(* Goal: not (@eq (@Tpoint Tn) A B') *)
(* Goal: not (@eq (@Tpoint Tn) B' B) *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H2.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @eq (@Tpoint Tn) P P' *)
apply perp_distinct in H1.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @eq (@Tpoint Tn) P P' *)
apply perp_distinct in H1.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
Qed.

Lemma per2_preserves_diff : forall O A B A' B', O <> A' -> O <> B' -> Col O A' B' -> Per O A' A -> Per O B' B -> A' <> B' -> A <> B.

Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply H4.
(* Goal: @Col Tn X Y' Y *)
apply(per2_col_eq O A' B' A);Col.
Qed.

Lemma per23_preserves_bet : forall A B C B' C', Bet A B C -> A <> B' -> A <> C' -> Col A B' C' -> Per A B' B -> Per A C' C -> Bet A B' C'.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
assert(HC:Col A B C).
(* Goal: @Col Tn X Y' Y *)
apply bet_col in H; Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points B B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Col A C' C).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(A = C' \/ C = C').
(* Goal: or (@eq (@Tpoint Tn) B C') (@eq (@Tpoint Tn) C C') *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A' B C' *)
apply l8_9; auto.
(* Goal: @Col Tn X Y' Y *)
induction H6.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A P C *)
assert(A <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
apply l8_8 in H4.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Bet Tn A B C *)
assert(C <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.

(* Goal: @Bet Tn A B C *)
assert(Col A B' B).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C *)
assert(A = B' \/ B = B').
(* Goal: or (@eq (@Tpoint Tn) B C') (@eq (@Tpoint Tn) C C') *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A' B C' *)
apply l8_9; auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H8; contradiction.

(* Goal: @Bet Tn A B C *)
assert(Perp A B' B' B).
(* Goal: @Perp Tn A A' O A' *)
(* Goal: @Bet Tn A' B' C' *)
apply per_perp_in in H3; auto.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Par_strict Tn A B Q P *)
apply perp_in_perp_bis in H3.
induction H3; Perp.
(* Goal: not (@eq (@Tpoint Tn) C C') *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H3.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Perp_at Tn C' C' C A B *)
(* Goal: @Bet Tn A P B *)
assert(Perp A C' C' C).
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H4; auto.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H4.
induction H4; Perp.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Par B B' C C').
apply(l12_9 B B' C C' A B');Perp; Cop.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Perp Tn B A' C C' *)
(* Goal: @Bet Tn A B C *)
apply(perp_col _ C'); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points B C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(B' = C').
apply(per2_col_eq A B' C' B); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

assert(~Col A B' B).
(* Goal: not (@Col Tn A' A B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H3; auto.

assert(~Col A C' C).
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H4; auto.

(* Goal: @Bet Tn A B C *)
assert(B' <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.

assert(Col B C B').
apply cop_per2__col with A; Perp.
(* Goal: @Col Tn X Y' Y *)
exists C; left; split; Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply H13; ColR.

(* Goal: @eq (@Tpoint Tn) C C' *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
induction H10.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply l12_6 in H10.

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(TS B B' A C).
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
repeat split;auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Bet Tn A B C *)
assert(A = B' \/ B = B').
(* Goal: @Col Tn X Y' Y *)
apply l8_9; Col.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
induction H12; tauto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply H13; ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: @Col Tn X Y' Y *)
split; Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(TS B B' A C').
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply l9_2.
apply(l9_8_2 B B' C C' A); auto.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply l9_2.
(* Goal: @Acute Tn C' B C *)
assumption.
unfold TS in H16.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A' C') *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
ex_and H18 T.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(T = B').
apply bet_col in H19.
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 B B' A B'); Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H12.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
Qed.

Lemma per23_preserves_bet_inv : forall A B C B' C', Bet A B' C' -> A <> B' -> Col A B C -> Per A B' B -> Per A C' C -> Bet A B C.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points B B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Col A C' C).
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(A = C' \/ C = C').
(* Goal: or (@eq (@Tpoint Tn) A C') (@eq (@Tpoint Tn) C C') *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply(l8_9 A C' C); auto.
(* Goal: @Col Tn X Y' Y *)
induction H5.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
assert(Perp A B' B' B).
(* Goal: @Perp Tn A B' B' B *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H2.
(* Goal: @Perp Tn A B' B' B *)
(* Goal: not (@eq (@Tpoint Tn) A B') *)
(* Goal: not (@eq (@Tpoint Tn) B' B) *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H2.
(* Goal: @Perp Tn A B' B' B *)
(* Goal: not (@eq (@Tpoint Tn) A B') *)
(* Goal: not (@eq (@Tpoint Tn) B' B) *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H2.
(* Goal: @Perp Tn A B' B' B *)
(* Goal: not (@eq (@Tpoint Tn) A B') *)
(* Goal: not (@eq (@Tpoint Tn) B' B) *)
(* Goal: @Bet Tn A B C *)
induction H2.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp Tn A B' B' B *)
(* Goal: not (@eq (@Tpoint Tn) A B') *)
(* Goal: not (@eq (@Tpoint Tn) B' B) *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H2.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.


(* Goal: @Perp_at Tn C' C' C A B *)
(* Goal: @Bet Tn A P B *)
assert(Perp A C' C' C).
(* Goal: @Perp Tn A C' C' C *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H3.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Par_strict Tn A B Q P *)
apply perp_in_perp_bis in H3.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
induction H3.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: not (@eq (@Tpoint Tn) C C') *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H3.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn A' B C' *)
induction(eq_dec_points A C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Bet Tn A B C *)
assert(Col A B' B).
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
assert(A = B' \/ B = B').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l8_9 A B' B); auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H8;contradiction.

(* Goal: @Bet Tn A B C *)
assert(Perp A B' C' C).
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ C'); Col.

(* Goal: @Bet Tn A B C *)
assert( Par B' B C' C).
(* Goal: @Par Tn B' B C' C *)
(* Goal: @Bet Tn A B C *)
apply(l12_9 B' B C' C A B'); Cop.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp Tn C D X Y *)
Perp.

(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points B C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A B C *)
induction H8.
(* Goal: @Bet Tn A B C *)
assert(B' <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Col Tn X X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
apply H8.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: @Col Tn X Y' Y *)
split; Col.


(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH:=l12_6 B' B C' C H8).

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(TS B' B A C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Bet Tn A B C *)
assert(A = B' \/ B = B').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l8_9 A B' B); auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H12;contradiction.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Bet Tn A B C *)
assert(Col A B' B).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
assert_cols.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
assert(A = B' \/ B = B').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l8_9 A B' B); auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H13;contradiction.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: @Col Tn X Y' Y *)
split; Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(TS B' B C A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l9_8_2 B' B C' C A); auto.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply l9_2.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in H12.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H14 T.

(* Goal: @Bet Tn A P C *)
assert(A <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply between_identity in H15.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert (T = B).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
assert_cols.
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 A C B' B); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Bet Tn A B C *)
assert(Col A B' B).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
assert(A = B' \/ B = B').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l8_9 A B' B); auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H21;contradiction.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.


(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
assert_cols.
(* Goal: @Bet Tn A B C *)
assert(Col A B' B).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
assert(A = B' \/ B = B').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l8_9 A B' B); auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H15;contradiction.
Qed.



Lemma per13_preserves_bet : forall A B C A' C', Bet A B C -> B <> A' -> B <> C' -> Col A' B C' -> Per B A' A -> Per B C' C -> Bet A' B C'.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Bet Tn A' B C' *)
assert(Col A B C).
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn A B C *)
induction(eq_dec_points A A').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Col B C' C).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A' B C' *)
assert(B = C' \/ C = C').
(* Goal: or (@eq (@Tpoint Tn) B C') (@eq (@Tpoint Tn) C C') *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A' B C' *)
apply l8_9; auto.
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A' B C' *)
induction H7.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
assert(C <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Bet Tn A' B C' *)
assert(Col A A' B).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: False *)
(* Goal: @Bet Tn A' B C' *)
assert(B = A' \/ A = A').
(* Goal: @Col Tn X Y' Y *)
apply l8_9; Col.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
induction H8; tauto.

(* Goal: @Bet Tn A B C *)
assert(Perp B A' A' A).
(* Goal: @Perp Tn A A' O A' *)
(* Goal: @Bet Tn A' B' C' *)
apply per_perp_in in H3; auto.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Par_strict Tn A B Q P *)
apply perp_in_perp_bis in H3.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
induction H3.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: not (@eq (@Tpoint Tn) C C') *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H3.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
assert(Perp B C' C' C).
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H4; auto.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
induction H4.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
assert(Par A A' C C').
(* Goal: @Par Tn A A' C C' *)
(* Goal: @Bet Tn A B C *)
apply(l12_9 A A' C C' B A'); Perp; Cop.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Perp Tn B A' C C' *)
(* Goal: @Bet Tn A B C *)
apply(perp_col _ C'); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @eq (@Tpoint Tn) C C' *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
induction H10.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH:=par_strict_symmetry A A' C C' H10).
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply l12_6 in H10.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply l12_6 in HH.

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
assert(~Col A A' B).
(* Goal: not (@Col Tn A' A B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H3; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H3.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
assert(~Col C C' B).
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H4; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply H4.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS A A' B C).
(* Goal: @OS Tn C' C B A' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply out_one_side.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
left; auto.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
subst A.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold OS in H10.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H10 X.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) C A) *)
(* Goal: or (@Bet Tn A B C) (@Bet Tn A C B) *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
unfold TS in H13.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold OS in H10.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H10 X.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in H10.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
apply H10.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS C C' B A).
(* Goal: @OS Tn C' C B A' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply out_one_side.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
left; auto.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H12.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold OS in H10.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H10 X.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in H10.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
apply H10.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
assert(OS A A' B C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(one_side_transitivity _ _ _ C); auto.
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
assert(OS C C' B A').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(one_side_transitivity _ _ _ A); auto.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply invert_one_side in H15.
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
apply invert_one_side in H16.
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
assert(HP:= col_one_side_out A' A B C' H2 H15).
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Out C' B A').
(* Goal: @Col Tn X Y' Y *)
apply(col_one_side_out C' C B A'); Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold Out in *.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction H19.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
induction H22.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) B' A) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H18.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply (between_equality _ _ B); Between.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A' B C' *)
induction(eq_dec_points A C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
clean_duplicated_hyps.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
apply l8_8 in H4.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Col B C' C).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H4; auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
Qed.

Lemma per13_preserves_bet_inv : forall A B C A' C', Bet A' B C' -> B <> A' -> B <> C' ->  Col A B C  -> Per B A' A -> Per B C' C -> Bet A B C.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Bet Tn A B C *)
assert(Col A' B C').
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn A B C *)
induction(eq_dec_points A A').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Col B C' C).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH:=l8_9 B C' C H4 H6 ).
(* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
induction HH.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
assert(C <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
assert(Col B A' A).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
assert(HH:=l8_9 B A' A H3 H7).
induction HH;
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Bet Tn A B C *)
assert(Perp B A' A' A).
(* Goal: @Perp Tn A A' O A' *)
(* Goal: @Bet Tn A' B' C' *)
apply per_perp_in in H3; auto.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Par_strict Tn A B Q P *)
apply perp_in_perp_bis in H3.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
induction H3.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: not (@eq (@Tpoint Tn) C C') *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H3.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
assert(Perp B C' C' C).
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H4; auto.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
induction H4.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
assert(Par A A' C C').
(* Goal: @Par Tn A A' C C' *)
(* Goal: @Bet Tn A B C *)
apply(l12_9 A A' C C' B A'); Perp; Cop.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Perp Tn B A' C C' *)
(* Goal: @Bet Tn A B C *)
apply(perp_col _ C'); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @eq (@Tpoint Tn) C C' *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
induction H10.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH:=par_strict_symmetry A A' C C' H10).
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply l12_6 in H10.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply l12_6 in HH.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(~Col A' A B).
(* Goal: not (@Col Tn A' A B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H3; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H3.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(~Col C' C B).
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H4; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply H4.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS A' A B C').
(* Goal: @OS Tn C' C B A' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply out_one_side.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
left; auto.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H11.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply one_side_symmetry in H10.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold OS in H10.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H10 X.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in H10.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
apply H10.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS C' C B A').
(* Goal: @OS Tn C' C B A' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply out_one_side.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
left; auto.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H12.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply one_side_symmetry in H10.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold OS in H10.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H10 X.
(* Goal: False *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in H10.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
apply H10.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS A' A B C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(one_side_transitivity _ _ _ C'); auto.
(* Goal: @OS Tn C C' B A' *)
(* Goal: @OS Tn C C' A' A *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply invert_one_side.
(* Goal: @OS Tn A' B' B A *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply one_side_symmetry.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS C C' B A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(one_side_transitivity _ _ _ A'); auto.
(* Goal: @OS Tn C C' B A' *)
(* Goal: @OS Tn C C' A' A *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply invert_one_side.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @OS Tn A' B' B A *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply one_side_symmetry.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply invert_one_side in H15.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HP:= col_one_side_out A A' B C H2 H15).

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Out C B A).
(* Goal: @Col Tn X Y' Y *)
apply(col_one_side_out C C' B A); Col.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold Out in *.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction H19.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
induction H22.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) B' A) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H18.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply (between_equality _ _ B); Between.

(****************************)

(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A B C *)
assert(Perp A' C' A A').
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ B); Perp.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H9.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Bet Tn A B C *)
apply perp_not_col in H14.

(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
apply H14.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
Qed.

Lemma per3_preserves_bet1 : forall O A B C A' B' C', Col O A B -> Bet A B C -> O <> A' -> O <> B' -> O <> C'
                                                    -> Per O A' A -> Per O B' B -> Per O C' C
                                                    -> Col A' B' C' -> Col O A' B' -> Bet A' B' C'.

Proof.
(* Goal: forall (O A B C A' B' C' : @Tpoint Tn) (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A' C')) (_ : @Bet Tn A' B' C') (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A' C'), @Bet Tn A B C *)
intros O A B C A' B' C'.
(* Goal: forall (_ : @Col Tn O A B) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A' B' C') (_ : @Col Tn O A' B'), @Bet Tn A' B' C' *)
intro HC.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points A B).
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(A' = B').
(* Goal: @Col Tn X Y' Y *)
apply(per2_col_eq O A' B' A H0 H1 H3 H4); Col.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A B C *)
induction (eq_dec_points A A').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points B B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn A B C *)
assert(Col O C C').
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(C = C').
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @eq (@Tpoint Tn) C C' *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(O = C' \/ C = C').
(* Goal: @Col Tn X Y' Y *)
apply(l8_9 O C' C H5); Col.
(* Goal: @eq (@Tpoint Tn) C C' *)
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
induction H10.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
induction(eq_dec_points A B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A P C *)
assert(A <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert( ~ Col O B' B).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(per_not_col O B' B H1); auto.

(* Goal: @Bet Tn A B C *)
assert(C <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H12.
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Perp B B' O A).

(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H4; auto.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
induction H4.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Perp Tn O A C C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply perp_right_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col O B' B' B A); auto.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Perp C C' O A).

(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_perp_in in H5; auto.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H5.
(* Goal: @Col Tn X Y' Y *)
induction H5.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H5.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Perp Tn O A C C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply perp_right_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col O C' C' C A); auto.
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Par B B' C C').
(* Goal: @Par Tn B B' C C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(l12_9 B B' C C' O A); Cop.
(* Goal: @Par_strict Tn A B Q P *)
induction H16.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH:=l12_6 B B' C C' H16).

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(TS B B' A C).
(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: @Col Tn X Y' Y *)
repeat split; Col.
(* Goal: not (@Col Tn A B B') *)
(* Goal: not (@Col Tn C B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(~Col B' A B).
(* Goal: not (@Col Tn B' A B) *)
(* Goal: not (@Col Tn A B B') *)
(* Goal: not (@Col Tn C B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(perp_not_col).
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Col Tn X Y' Y *)
apply(perp_col A O B B' B'); Col.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H16.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(TS B B' C' A).
(* Goal: @TS Tn B B' C' A *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(l9_8_2 B B' C C' A).

(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply l9_2.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in H18.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H20 T.
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(B'=T).
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 B B' A C'); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: not (@Col Tn A C B') *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply between_identity in H21.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply between_symmetry.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Per O C' B).
(* Goal: @Col Tn X Y' Y *)
apply(per_col O C' C B); Col.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(B'=C').
(* Goal: @Col Tn X Y' Y *)
apply(per2_col_eq O B' C' B); Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(*-------------------------------*)

(* Goal: @Bet Tn O A' B' *)
induction(eq_dec_points A' B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points B C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(B' = C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(per2_col_eq O B' C' B); auto.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points B B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
induction(eq_dec_points A' B).
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A B C *)
assert(C <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.

(* Goal: False *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert( ~ Col O A' A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(per_not_col O A' A ); auto.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A' B' C' *)
assert(Perp A A' O A').
(* Goal: @Perp Tn A A' O A' *)
(* Goal: @Bet Tn A' B' C' *)
apply per_perp_in in H3; auto.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Par_strict Tn A B Q P *)
apply perp_in_perp_bis in H3.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
induction H3.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: not (@eq (@Tpoint Tn) C C') *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H3.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Perp C C' O A').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_perp_in in H5; auto.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H5.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H5.
(* Goal: @Col Tn X Y' Y *)
induction H5.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply (perp_col _ C'); auto.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H5.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Col O A A').
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
assert(Par A A' C C').
(* Goal: @Par Tn A A' C C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(l12_9 A A' C C' O A'); Cop.
(* Goal: @Perp Tn R X A B *)
(* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H17.


(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(HH:=l12_6 A A' C C' H17).

(*--------------------------------*)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(OS C C' A A').
(* Goal: @OS Tn C C' A A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(l12_6 C C' A A').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(OS C C' A B).
(* Goal: @OS Tn C C' A B *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(out_one_side C C' A B).
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
right.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(OS C C' A' B).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(one_side_transitivity C C' A' A); auto.
(* Goal: @OS Tn A' B' B A *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply one_side_symmetry.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Out C' B A').
(* Goal: @Col Tn X Y' Y *)
induction H6.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A' C') *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold OS in H18.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A' C') *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
ex_and H18 T.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A' C') *)
(* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold TS in H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply H4.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Col Tn X Y' Y *)
induction H6.

(* Goal: @Out Tn C' B A' *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(TS C C' B A').
(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@Col Tn A' C C') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold OS in H19.
(* Goal: False *)
(* Goal: not (@Col Tn A' C C') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
ex_and H19 T.
(* Goal: False *)
(* Goal: not (@Col Tn C' A A') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold TS in H22.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Out Tn C' B A' *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply one_side_symmetry in H20.
(* Goal: @Out Tn C' B A' *)
(* Goal: @Out Tn C' B A' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply l9_9_bis in H20.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
right; auto.

(*****************************)

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Out A' B C').
(* Goal: @Col Tn X Y' Y *)
induction H6.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Out Tn A' B C' *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out in H21.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.

(* Goal: @Col Tn X Y' Y *)
induction H6.
(* Goal: @Out Tn A' B C' *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out in H21.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
induction H23.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H22.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply (between_equality _ _ B); Between.

(***************************)

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS A A' B C).
(* Goal: @OS Tn A A' B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(out_one_side A A' B C).
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
right.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(OS A A' C' B).
apply(one_side_transitivity A A' C' C);
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply one_side_symmetry; auto.


(***********************)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(TS A A' B C').
(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@Col Tn C' A A') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold OS in H22.
(* Goal: False *)
(* Goal: not (@Col Tn C' A A') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
ex_and H22 T.
(* Goal: False *)
(* Goal: not (@Col Tn C' A A') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold TS in H22.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply one_side_symmetry in H23.
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
apply l9_9_bis in H23.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold Out in *.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
clean_duplicated_hyps.

(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
induction H26; induction H24.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
apply H21.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply(between_equality _ _ A'); Between.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
apply H10.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply(between_equality _ _ C'); Between.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H25.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply(between_equality _ _ B); Between.
(* Goal: @Col Tn X Y' Y *)
spliter.


(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(~Col O C' C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(per_not_col); auto.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
apply H21.

(* Goal: @Bet Tn A P C *)
assert(A<>C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Col Tn O C' C *)
(* Goal: @Bet Tn A' B' C' *)
apply bet_col in H.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(********************************)

(* Goal: @Bet Tn A' B' C' *)
assert(Perp A A' O A').
(* Goal: @Perp Tn A A' O A' *)
(* Goal: @Bet Tn A' B' C' *)
apply per_perp_in in H3; auto.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Par_strict Tn A B Q P *)
apply perp_in_perp_bis in H3.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
induction H3.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: not (@eq (@Tpoint Tn) C C') *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H3.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A' B' C' *)
assert(Perp B B' O A').
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H4; auto.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
induction H4.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Col Tn X Y' Y *)
apply (perp_col _ B'); Col.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn O A' B' *)
assert(Par A A' B B').
(* Goal: @Par Tn A A' B B' *)
(* Goal: @Bet Tn A' B' C' *)
apply(l12_9 A A' B B' O A'); Cop.

(* Goal: @Bet Tn A' B' C' *)
induction H15.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(HH:=l12_6 A A' B B' H15).



(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(TS B B' A C).
(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: @Col Tn X Y' Y *)
repeat split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply H15.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H11.
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 B B' A C); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply H15.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: @Col Tn X Y' Y *)
split; Col.

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(OS B B' A A').
(* Goal: @OS Tn B B' A A' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply(l12_6 B B' A A').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(HP:= l9_8_2 B B' A A' C H16 H17).


(* Goal: @Bet Tn A B C *)
induction(eq_dec_points C C').
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold TS in HP.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H20 T.

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(T = B').
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 B B' A' C); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: not (@Col Tn A C B') *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply between_identity in H21.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(Perp C C' O A').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_perp_in in H5; auto.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H5.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H5.
(* Goal: @Col Tn X Y' Y *)
induction H5.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (perp_col _ C'); finish.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H5.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Par B B' C C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l12_9 B B' C C' O A'); auto.
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
induction H20.

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(HQ:=l12_6 B B' C C' H20).

(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(TS B B' C' A').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l9_8_2 B B' C C' A'); auto.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply l9_2.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold TS in H21.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
ex_and H23 T.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
assert(T = B').
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 B B' A' C'); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
apply between_identity in H24.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
unfold TS in HP.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H25.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A' B' C' *)
apply perp_left_comm in H13.
(* Goal: @Bet Tn A' B' C' *)
apply perp_not_col in H13.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
Qed.


Lemma per3_preserves_bet2_aux : forall O A B C B' C', Col O A C -> A <> C' ->
                               Bet A B' C' -> O <> A -> O <> B' -> O <> C'
                               -> Per O B' B -> Per O C' C
                               -> Col A B C -> Col O A C' -> Bet A B C.
Proof.
(* Goal: forall (O A B C B' C' : @Tpoint Tn) (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A C')) (_ : @Bet Tn A B' C') (_ : not (@eq (@Tpoint Tn) O A)) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A C'), @Bet Tn A B C *)
intros O A B C B' C'.
(* Goal: forall (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A' C')) (_ : @Bet Tn A' B' C') (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A' C'), @Bet Tn A B C *)
intro HX.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points A B).
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points B C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A B C *)
assert(Col O A B').
(* Goal: not (@eq (@Tpoint Tn) C P) *)
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H0.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
assert(Col O B' C').
(* Goal: not (@eq (@Tpoint Tn) C P) *)
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H0.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points B B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn A B C *)
assert(Col O C C').
(* Goal: not (@eq (@Tpoint Tn) C P) *)
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H0.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(C = C').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per_col_eq C C' O); finish.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Bet Tn A B C *)
assert(C <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply per_not_col in H4; auto.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply H4.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C *)
assert(Perp O A C C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_perp_in in H5; auto.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H5.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H5.
(* Goal: @Col Tn X Y' Y *)
induction H5.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (perp_col _ C'); finish.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H5.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
assert(Perp O A B B').
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H4; auto.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
induction H4.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (perp_col _ B'); finish.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Par B B' C C').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(l12_9 B B' C C' O A);finish.

(* Goal: @Par_strict Tn A B Q P *)
induction H16.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH:=l12_6 B B' C C' H16).
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(TS B B' A C').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
repeat split; finish.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Per B B' A).
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per_col B B' O A); finish.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_not_col in H18; auto.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) B' A) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H18.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H16.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H16.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
split; finish.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(TS B B' C A).
(* Goal: @TS Tn B B' C A *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply(l9_8_2 B B' C' C A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply l9_2; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply one_side_symmetry; auto.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in H18.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H20 T.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(B = T).
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 A C B' B); Col.
(* Goal: @Bet Tn A P C *)
assert(A <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: not (@Col Tn A C B') *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply between_identity in H21.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: not (@eq (@Tpoint Tn) C P) *)
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H0.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H19.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A B C *)
assert(B' <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
assert(Perp O B' C B').
(* Goal: @Col Tn X Y' Y *)
apply(perp_col O A C B' B'); Col.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply perp_left_comm in H0.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
apply perp_not_col in H0.
(* Goal: False *)
(* Goal: @Col Tn O X Q *)
apply H0.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn A B C *)
assert(Per C C' B').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per_col C C' O B'); finish.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_not_col in H21; auto.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
apply H21.
(* Goal: @Col Tn X Y' Y *)
Col.
Qed.

Lemma per3_preserves_bet2 : forall O A B C A' B' C', Col O A C -> A' <> C' ->
                               Bet A' B' C' -> O <> A' -> O <> B' -> O <> C'
                               -> Per O A' A -> Per O B' B -> Per O C' C
                               -> Col A B C -> Col O A' C' -> Bet A B C.

Proof.
(* Goal: forall (O A B C A' B' C' : @Tpoint Tn) (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A' C')) (_ : @Bet Tn A' B' C') (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A' C'), @Bet Tn A B C *)
intros O A B C A' B' C'.
(* Goal: forall (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A' C')) (_ : @Bet Tn A' B' C') (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A' C'), @Bet Tn A B C *)
intro HX.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points A A').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply (per3_preserves_bet2_aux O A B C B' C');auto.
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points C C').
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply between_symmetry.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per3_preserves_bet2_aux O C B A B' A'); finish.

(* Goal: @Bet Tn A B C *)
assert(Perp O A' C C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_perp_in in H6; auto.
(* Goal: @Perp Tn O A' C C' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H6.
(* Goal: @Perp Tn O A' C C' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H6.
(* Goal: @Col Tn X Y' Y *)
induction H6.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (perp_col _ C'); finish.
(* Goal: @Perp Tn O A' C C' *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H6.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
assert(Perp O A' A A').
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply per_perp_in in H4; auto.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H4.
(* Goal: @Perp Tn O A' A A' *)
(* Goal: @Bet Tn A B C *)
induction H4.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
assert(Par A A' C C').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(l12_9 A A' C C' O A');finish.

(* Goal: @Bet Tn A B C *)
induction H13.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH:=l12_6 A A' C C' H13).
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply par_strict_symmetry in H13.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HP:=l12_6 C C' A A' H13).

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points B B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS A' A B C').
(* Goal: @OS Tn C' C B A' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply out_one_side.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
right.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
left; auto.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply invert_one_side in H14.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS A A' B C).
(* Goal: @OS Tn A A' B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply (one_side_transitivity _ _ _ C').
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @OS Tn A' B' B A *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply one_side_symmetry.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Out A B C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply (col_one_side_out A A');auto.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS C' C B A').
(* Goal: @OS Tn C' C B A' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply out_one_side.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
right.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
left; Between.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply invert_one_side in H17.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(OS C C' B A).
(* Goal: @OS Tn C C' B A *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply (one_side_transitivity _ _ _ A').
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @OS Tn A' B' B A *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply one_side_symmetry.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply one_side_symmetry in H18.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Out C A B).
(* Goal: @Col Tn X Y' Y *)
apply (col_one_side_out C C');Col.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold Out in *.
(* Goal: @Col Tn X Y' Y *)
spliter.


(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction H23; induction H21.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
assert(A = C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply (between_equality A C B); auto.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(B = C).
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply (between_equality B C A); Between.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(****************************************************************************************)

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Perp O A' B B').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_perp_in in H5; auto.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_comm in H5.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_in_perp_bis in H5.
(* Goal: @Col Tn X Y' Y *)
induction H5.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (perp_col _ B'); finish.
(* Goal: not (@eq (@Tpoint Tn) C P) *)
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H0.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp Tn O A' B B' *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply perp_distinct in H5.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Par B B' A A').
(* Goal: @Perp Tn C D X Y *)
apply(l12_9 B B' A A' O A'); Perp.
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.

(* Goal: @Par_strict Tn A B Q P *)
induction H16.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HQ:=l12_6 B B' A A' H16).

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Par B B' C C').
(* Goal: @Perp Tn C D X Y *)
apply(l12_9 B B' C C' O A'); Perp.
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Perp Tn R X A B *)
(* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H17.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HR:=l12_6 B B' C C' H17).

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(TS B B' A' C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H16.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
exists A'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply H17.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
split; finish.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply one_side_symmetry in HQ.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH1:= l9_8_2 B B' A' A C' H18 HQ).
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply l9_2 in HH1.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
apply one_side_symmetry in HR.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(HH2:= l9_8_2 B B' C' C A HH1 HR).
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
unfold TS in HH2.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
ex_and H21 T.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(B = T).
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 B B' A C); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points B C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Col A C C').
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
induction(eq_dec_points A B).
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
assert(Col C A A').
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Bet Tn A P C *)
assert(A <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Col Tn O X P *)
(* Goal: @Perp_at Tn Q O Q C D *)
apply H.
(* Goal: @Col Tn X Y' Y *)
apply(per2_col_eq O A' C' A); Col.

(* Goal: @Bet Tn A B C *)
assert(Col O C C').
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_not_col in H6; auto.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
apply H6.
(* Goal: @Col Tn X Y' Y *)
Col.
Qed.


Lemma symmetry_preserves_per : forall A P B A' P', Per B P A -> Midpoint B A A' -> Midpoint B P P'
                                                   -> Per B P' A'.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Per Tn B P' A' *)
assert(HS:=symmetric_point_construction A P).
(* Goal: @Per Tn B P' A' *)
ex_and HS C.
(* Goal: @Per Tn B P' A' *)
assert(HS:=symmetric_point_construction C B).
(* Goal: @Per Tn B P' A' *)
ex_and HS C'.

(* Goal: @Per Tn B P' A' *)
assert(HH:= symmetry_preserves_midpoint A P C A' P' C' B H0 H1 H3 H2).
(* Goal: @Per Tn B P' A' *)
unfold Per.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Cong Tn B A' B C' *)
unfold Per in H.
(* Goal: @Par Tn A B C D *)
ex_and H X.
(* Goal: @Cong Tn B A' B C' *)
assert(X = C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(symmetric_point_uniqueness A P X C); auto.
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Col Tn A B C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in *.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Cong Tn B A' B C' *)
apply (cong_transitivity _ _ B A).
(* Goal: @Cong Tn B C B C' *)
Cong.
(* Goal: @Cong Tn B A B C' *)
apply(cong_transitivity _ _ B C).
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Cong Tn B C B C' *)
Cong.
Qed.

Lemma l13_1_aux : forall A B C P Q R,
   ~ Col A B C -> Midpoint P B C -> Midpoint Q A C -> Midpoint R A B ->
   exists X, exists Y, Perp_at R X Y A B /\ Perp X Y P Q /\ Coplanar A B C X /\ Coplanar A B C Y.
Proof.
(* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Midpoint Tn P B C) (_ : @Midpoint Tn Q A C) (_ : @Midpoint Tn R A B), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
intros A B C P Q R HC MBC MAC MAB.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Q <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst Q.
(* Goal: @Bet Tn A Q C *)
(* Goal: @TS Tn A' B' B C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MAC.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H0.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply HC.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(P <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: @Bet Tn B P C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MBC.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H1.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply HC.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(D1:Q<>R).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst R.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(B=C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(symmetric_point_uniqueness A Q); auto.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l7_3 in MBC.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(D2:R <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst R.
(* Goal: @Col Tn R A B *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MAB.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H2.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply HC.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(~Col P Q C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply HC.
(* Goal: @Col Tn A B C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in *.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H2.
(* Goal: @Col Tn A' C' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply bet_col in H4.
(* Goal: @Col Tn A B C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply bet_col in H6.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(HH:= l8_18_existence P Q C H1).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and HH C'.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(HS1:=symmetric_point_construction C' Q).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and HS1 A'.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(HS1:=symmetric_point_construction C' P).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and HS1 B'.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cong C C' B B').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(l7_13 P C C' B B' MBC); finish.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cong C C' A A').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(l7_13 Q C C' A A'); finish.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Per P B' B).
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points P C').
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn B B' A' *)
(* Goal: @Per Tn B B' A' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H5.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Per Tn P B' B *)
(* Goal: @Per Tn P B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_symmetry in H8.
(* Goal: @Per Tn P B' B *)
(* Goal: @Per Tn P B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H8.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_2.
(* Goal: @Per Tn A Q Q *)
(* Goal: @Per Tn Q A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_5.

(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(symmetry_preserves_per C C' P B B'); finish.
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_comm.
(* Goal: @Perp_at Tn C' C' Q C C' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_perp_in.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Col Tn X Y' Y *)
apply (perp_col _ Q); Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Per Q A' A).
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points Q C').
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Per Tn Q A' A *)
(* Goal: @Per Tn Q A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_symmetry in H9.
(* Goal: @Per Tn Q A' A *)
(* Goal: @Per Tn Q A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H9.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_2.
(* Goal: @Per Tn A Q Q *)
(* Goal: @Per Tn Q A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_5.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(symmetry_preserves_per C C' Q A A'); finish.
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_comm.
(* Goal: @Perp_at Tn C' C' Q C C' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_perp_in.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Col Tn X Y' Y *)
apply (perp_col _ P); Col.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cl1: Col A' C' Q).
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn A' C' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply bet_col in H4.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cl2: Col B' C' P).
(* Goal: @Per Tn B B' A' *)
(* Goal: @Per Tn B B' A' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H5.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @eq (@Tpoint Tn) B P *)
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
apply bet_col in H5.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(NE0: P <> Q).
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
apply perp_distinct in H3; tauto.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(NE1 : A' <> B').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply NE0.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply (l7_17 C' A'); auto.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cl3: Col A' B' P).
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points P C').
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
unfold Midpoint in  H5.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn A' B' Q *)
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_symmetry in H10.
(* Goal: @Per Tn P A' A *)
(* Goal: @Per Tn P A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H10.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points Q C').
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst Q.
unfold Midpoint in  H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn A' B' C' *)
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_symmetry in H11.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H11.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cl4: Col A' B' Q).
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points P C').
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
unfold Midpoint in  H5.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn A' B' Q *)
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_symmetry in H10.
(* Goal: @Per Tn P A' A *)
(* Goal: @Per Tn P A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H10.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points Q C').
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst Q.
unfold Midpoint in  H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn A' B' C' *)
(* Goal: @Col Tn A' B' Q *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_symmetry in H11.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H11.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cl5:Col A' B' C').
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(NE2 : C <> C').
(* Goal: not (@eq (@Tpoint Tn) C C') *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H3.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(NE3: A <> A').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H7.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(NE4: B <> B').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H6.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Per P A' A).
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points A' Q).
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst Q.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Per Tn P A' A *)
(* Goal: @Per Tn P A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H10.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_left_comm in H3.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_perp_in in H3.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_per in H3.
(* Goal: @Bet Tn A Q C *)
(* Goal: @TS Tn A' B' B C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MAC.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H2.
(* Goal: @Col Tn X Y' Y *)
apply (per_col P A' C A); Col.
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_2.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (per_col A A' Q P); finish.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Per Q B' B).
(* Goal: @Perp Tn P Q X y *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points B' P).
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: @Per Tn B B' A' *)
(* Goal: @Per Tn B B' A' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H5.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H11.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_perp_in in H3.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_comm in H3.
(* Goal: @Per Tn Q B' B *)
(* Goal: @Per Tn Q B' B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_in_per in H3.
(* Goal: @Bet Tn B P C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MBC.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H2.
(* Goal: @Col Tn X Y' Y *)
apply (per_col Q B' C B); Col.
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_2.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (per_col B B' P Q); finish.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Per A' B' B).
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_2.
(* Goal: @Perp Tn P Q X y *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points B' P).
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: @Per Tn B B' A' *)
(* Goal: @Per Tn B B' A' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H5.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Per Tn B B' A' *)
(* Goal: @Per Tn B B' A' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H12.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per_col B B' Q A'); finish.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per_col B B' P A'); finish.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Per B' A' A).
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l8_2.
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points A' Q).
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst Q.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H13.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Per Tn A A' B' *)
(* Goal: @Per Tn A A' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
clean_trivial_hyps.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per_col A A' P B'); finish.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per_col A A' Q B'); finish.


(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(NC1 : ~Col A' B' A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_not_col in H13; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H13.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(NC2 : ~Col A' B' B).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_not_col in H12; auto.

(****************************************)

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(HM:=midpoint_existence A' B').
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and HM X.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(HP:=l10_15 A' B' X A).
(* Goal: @Col Tn X Y' Y *)
destruct HP as [y []]; Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(HH:=ex_sym X y A).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and HH B''.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert( X <> y).
(* Goal: not (@eq (@Tpoint Tn) X y) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_distinct in H15.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.


(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Reflect B'' A X y).
(* Goal: @Reflect Tn A' B' X y *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Reflect.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
repeat split;auto.
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and H18 M.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Midpoint Tn X0 A B'') (@Col Tn X y X0)) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
exists M.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
split; finish.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Reflect A' B' X y).
(* Goal: @Reflect Tn A' B' X y *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Reflect.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; auto.
(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
exists X.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
split; finish.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l10_4 in H20.

assert(HH:= l10_10 X y B''  B' A A' H20 H21).

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Per A' B' B'').
(* Goal: @Per Tn A' B' B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Reflect in *.
(* Goal: @Per Tn A' B' B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H20; induction H21.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(image_spec_preserves_per B' A' A A' B' B'' X y); auto.
(* Goal: @ReflectL Tn B' A' X y *)
(* Goal: @Per Tn A' B' B'' *)
(* Goal: @Per Tn A' B' B'' *)
(* Goal: @Per Tn A' B' B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l10_4_spec.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Reflect in H21.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H21.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold ReflectL in H23.


(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(OS A' B' A B'').
(* Goal: @Perp Tn R X A B *)
(* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H17.
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Par A' B' A B'').
(* Goal: @Par Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Coplanar A y A' X).
(* Goal: @Coplanar Tn A y A' R *)
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply col_cop__cop with B'; Col; Cop.
(* Goal: @Par Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Coplanar A y B' X).
(* Goal: @Coplanar Tn A y B' R *)
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply col_cop__cop with A'; Col; Cop.
(* Goal: @Par Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(~ Col A X y).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Par Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(A=B'').
(* Goal: @Col Tn X Y' Y *)
apply (image_id X y); Col.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: @Perp Tn C D X Y *)
apply(l12_9 A' B' A B'' X y); Perp.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
Cop.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with A; Cop.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
Cop.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with A; Cop.
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H24.
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply( l12_6 A' B' A B'' H24).
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_not_col in H22; auto.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H22.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst B''.
(* Goal: False *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_symmetry in HH.
(* Goal: False *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in HH.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H7.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst B''.
(* Goal: @OS Tn A' B' A A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply one_side_reflexivity.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply NC1.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(OS A' B' A B).
(* Goal: @OS Tn A' B' A B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold OS.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.
(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: @Col Tn X Y' Y *)
repeat split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D))))) *)
exists Q.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn A Q C *)
(* Goal: @TS Tn A' B' B C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MAC.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: @Col Tn X Y' Y *)
repeat split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
exists P.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn B P C *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MBC.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(*********************************)


(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert( Col B B'' B').
(* Goal: @Perp Tn C D X Y *)
apply cop_per2__col with A'; Perp.
(* Goal: @Coplanar Tn A' B B'' B' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_perm_3.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with A; Col; Cop.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Cong B B' A A').
(* Goal: @Cong Tn B C B C' *)
apply cong_transitivity with C C'; Cong.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(B = B'' \/ Midpoint B' B B'').
(* Goal: @Col Tn X Y' Y *)
apply( l7_20); Col.

(* Goal: @Cong Tn B C B C' *)
apply cong_transitivity with A A'; Cong.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H28.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst B''.

(* Goal: @Coplanar Tn A B C R *)
(* Goal: @Coplanar Tn A B C X *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
exists R.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
exists X.

(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and H18 M.
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(R = M).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply (l7_17 A B); auto.
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst M.

(* Goal: @Bet Tn O A' B' *)
assert(A <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @Col Tn X Y' Y *)
apply HC; Col.

(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Col R A B).
(* Goal: @Col Tn R A B *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in MAB.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn R A B *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply bet_col in H31.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(X <> R).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Par A B A' B').
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Coplanar A y A' R).
(* Goal: @Coplanar Tn A y A' R *)
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply col_cop__cop with B'; Col; Cop.
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Coplanar A y B' R).
(* Goal: @Coplanar Tn A y B' R *)
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply col_cop__cop with A'; Col; Cop.
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(~ Col A R y).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Par Tn A B A' B' *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(A=B).
(* Goal: @Col Tn X Y' Y *)
apply (image_id R y); Col.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: @Perp Tn C D X Y *)
apply(l12_9 A B A' B' R y); Perp.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
Cop.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
Cop.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with A; Cop.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with A; Cop.
(* Goal: @Perp Tn R X A B *)
(* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H17.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H32.
(* Goal: False *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply H32.
(* Goal: @Coplanar Tn A B C R *)
(* Goal: @Coplanar Tn A B C X *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
exists R.

(* Goal: and (@Col Tn R A B) (@Col Tn R A' B') *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H14.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: and (@Col Tn R A B) (@Col Tn R A' B') *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply bet_col in H14.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply NC1.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.

(* Goal: @Col Tn X Y' Y *)
apply(l8_14_2_1b_bis R X A B R); Col.
(* Goal: @Perp Tn R X A B *)
(* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction H17.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ y); auto.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.

(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ y);auto.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
(* Goal: @Perp Tn P Q X y *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
induction(eq_dec_points B' P).
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ A');auto.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ B');auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.

(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ A');auto.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.
(* Goal: @Coplanar Tn A B C R *)
(* Goal: @Coplanar Tn A B C X *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
exists R.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Coplanar Tn A B C X *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(Col P Q X).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_pseudo_trans with P Q C; Cop.

(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(TS A' B' B B'').
(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Col Tn X Y' Y *)
apply NC2; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_not_col in H22; auto.
(* Goal: False *)
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H22.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst B''.
(* Goal: @Bet Tn B B' B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H28.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cong_identity in H30.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold OS in H24.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
ex_and H24 T.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold TS in H30.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply H30.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn B B' B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
unfold Midpoint in H28.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
assert(OS A' B' B B'').
(* Goal: @OS Tn A' B' B B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply (one_side_transitivity A' B' B A ).
(* Goal: @OS Tn A' B' B A *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply one_side_symmetry.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply l9_9 in H29.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
Qed.

Lemma l13_1 : forall A B C P Q R,
   ~ Col A B C -> Midpoint P B C -> Midpoint Q A C -> Midpoint R A B ->
   exists X, exists Y, Perp_at R X Y A B /\ Perp X Y P Q.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (@Perp Tn X Y P Q))) *)
destruct (l13_1_aux A B C P Q R) as [X [Y]]; trivial.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
exists X.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *)
exists Y.
(* Goal: @Acute Tn C' B C *)
split; assumption.
Qed.



Lemma per_lt : forall A B C, A <> B ->  C <> B -> Per A B C -> Lt A B A C /\ Lt C B A C.
  Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: and (@Lt Tn A B A C) (@Lt Tn C B A C) *)
    assert(Lt B A A C /\ Lt B C A C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply( l11_46 A B C); auto.
(* Goal: @Col Tn X Y' Y *)
    spliter.
(* Goal: @Acute Tn C' B C *)
    split; apply lt_left_comm; assumption.
  Qed.

Lemma cong_perp_conga : forall A B C P,  Cong A B C B -> Perp A C B P -> CongA A B P C B P /\ TS B P A C.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
    assert(A <> C /\ B <> P).
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
        apply perp_not_eq_1 in H0.
(* Goal: @Acute Tn C' B C *)
        assumption.
      apply perp_not_eq_2 in H0.
(* Goal: @Acute Tn C' B C *)
      assumption.
(* Goal: @Col Tn X Y' Y *)
    spliter.
(* Goal: @Bet Tn O A' B' *)
    assert(A <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
      subst B.
      apply cong_symmetry in H.
      apply cong_identity in H.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
      apply H1.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Acute Tn A B C *)
    assert(C <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
      subst B.
      apply cong_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      contradiction.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
    induction(col_dec A B C).
      assert(~ Col B A P).
(* Goal: not (@Col Tn B' A B) *)
(* Goal: not (@Col Tn A B B') *)
(* Goal: not (@Col Tn C B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
        apply perp_not_col.
        apply perp_comm.
(* Goal: @Col Tn X Y' Y *)
        apply (perp_col _ C); Col.
      assert(Per P B A).
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
        apply perp_in_per.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
        apply perp_in_comm.
(* Goal: @Perp_at Tn C' C' Q C C' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply perp_perp_in.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply perp_sym.
(* Goal: @Col Tn X Y' Y *)
        eapply (perp_col _ C); Col.
      assert(Per P B C).
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
        apply perp_in_per.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
        apply perp_in_comm.
(* Goal: @Perp_at Tn C' C' Q C C' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply perp_perp_in.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply perp_sym.
(* Goal: @Col Tn X Y' Y *)
        eapply (perp_col _ A); Col.
(* Goal: @Perp Tn C D X Y *)
        Perp.
      apply l8_2 in H7.
      apply l8_2 in H8.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply l11_16; auto.
      assert( A = C \/ Midpoint B A C).
(* Goal: @Cong Tn B C B C' *)
        eapply l7_20; Cong.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      induction H9.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
        contradiction.
(* Goal: @TS Tn C D A B *)
      unfold TS.
(* Goal: @Out Tn O P Q *)
      repeat split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
        apply H6.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
        apply H6.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
      exists B.
      unfold Midpoint in H9.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      split; Between.
    assert(HH:= H0).
    unfold Perp in HH.
    ex_and HH T.
    apply perp_in_col in H6.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    assert(B <> T).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      subst T.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      apply H5.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert(Perp B T A C).
(* Goal: @Perp Tn C D X Y *)
      apply (perp_col _ P); Perp.
    assert(A <> T).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      subst T.
      apply perp_comm in H9.
      apply perp_perp_in in H9.
      apply perp_in_comm in H9.
      apply perp_in_per in H9.
      assert(Lt B A B C /\ Lt C A B C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply( per_lt B A C); auto.
(* Goal: @Col Tn X Y' Y *)
      spliter.
      unfold Lt in H10.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
      apply H12.
(* Goal: @Cong Tn B C B C' *)
      Cong.
    assert(C <> T).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      subst T.
      apply perp_left_comm in H9.
      apply perp_perp_in in H9.
      apply perp_in_comm in H9.
      apply perp_in_per in H9.
      assert(Lt B C B A /\ Lt A C B A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply( per_lt B C A); auto.
(* Goal: @Col Tn X Y' Y *)
      spliter.
      unfold Lt in H11.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
      apply H13.
(* Goal: @Cong Tn B C B C' *)
      Cong.
    assert(Perp_at T B T T A).
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
      apply perp_in_comm.
(* Goal: @Perp_at Tn C' C' Q C C' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
      apply perp_perp_in.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
      apply perp_sym.
      apply (perp_col _ C).
(* Goal: @Acute Tn C' B C *)
        assumption.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply perp_sym.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
        apply perp_left_comm.
(* Goal: @Perp Tn C D X Y *)
        apply (perp_col _ P); Perp.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert(Perp_at T B T T C).
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
      apply perp_in_comm.
(* Goal: @Perp_at Tn C' C' Q C C' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
      apply perp_perp_in.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
      apply perp_sym.
      apply (perp_col _ A).
(* Goal: @Acute Tn C' B C *)
        assumption.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply perp_sym.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
        apply perp_left_comm.
(* Goal: @Perp Tn C D X Y *)
        apply (perp_col _ P); Perp.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert(Cong T A T C /\ CongA T A B T C B /\ CongA T B A T B C).
(* Goal: @Cong Tn B C B C' *)
      apply( l11_52 A T B C T B); Cong.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        eapply l11_16; auto.
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
          apply perp_in_per.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
          apply perp_in_comm.
(* Goal: @Perp_at Tn P A P P C *)
          apply perp_in_sym.
(* Goal: @Acute Tn C' B C *)
          assumption.
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
        apply perp_in_per.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
        apply perp_in_comm.
(* Goal: @Perp_at Tn P A P P C *)
        apply perp_in_sym.
(* Goal: @Acute Tn C' B C *)
        assumption.
      assert(Lt B T B A /\ Lt A T B A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply( per_lt B T A); auto.
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
        apply perp_in_per.
(* Goal: @Acute Tn C' B C *)
        assumption.
(* Goal: @Col Tn X Y' Y *)
      spliter.
      apply le_comm.
      unfold Lt in H14.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Acute Tn C' B C *)
      assumption.
(* Goal: @Col Tn X Y' Y *)
    spliter.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
    split.
      induction(bet_dec P B T).
        apply conga_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        eapply l11_13; auto.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
          apply H16.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
          Between.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        Between.
      apply conga_comm.
      assert(Out B T P).
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
        unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        repeat split; auto.
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A' B C' *)
        induction H7.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
          right.
(* Goal: @Acute Tn C' B C *)
          assumption.
(* Goal: @Bet Tn A B C' *)
(* Goal: @Bet Tn A' B C' *)
        induction H7.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
          left.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
          Between.
        apply between_symmetry in H7.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
        contradiction.
      eapply out_conga.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
        apply H16.
(* Goal: @Acute Tn C' B C *)
        assumption.
        apply out_trivial.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Acute Tn C' B C *)
        assumption.
      apply out_trivial.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
    assert(A = C \/ Midpoint T A C).
(* Goal: @Col Tn X Y' Y *)
      apply l7_20; Col.
(* Goal: @Perp Tn R X A B *)
(* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
    induction H17.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      contradiction.
(* Goal: @TS Tn C D A B *)
    unfold TS.
(* Goal: @Col Tn X Y' Y *)
    repeat split; Col.
      assert(~ Col T A B).
(* Goal: not (@Col Tn B' A B) *)
(* Goal: not (@Col Tn A B B') *)
(* Goal: not (@Col Tn C B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
        apply perp_not_col.
        apply perp_in_perp_bis in H12.
        induction H12.
          apply perp_not_eq_1 in H12.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
          tauto.
(* Goal: @Perp Tn C D X Y *)
        Perp.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) B' A) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
      apply H18.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
      assert(~ Col T C B).
(* Goal: not (@Col Tn B' A B) *)
(* Goal: not (@Col Tn A B B') *)
(* Goal: not (@Col Tn C B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A B' C' *)
(* Goal: @Bet Tn A' B' C' *)
        apply perp_not_col.
        apply perp_in_perp_bis in H13.
(* Goal: @Bet Tn A B C *)
        induction H13.
          apply perp_not_eq_1 in H13.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
          tauto.
(* Goal: @Perp Tn C D X Y *)
        Perp.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) B' A) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
      apply H18.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
    exists T.
    apply midpoint_bet in H17.
(* Goal: @Col Tn X Y' Y *)
    split; Col.
Qed.




Lemma perp_per_bet : forall A B C P, ~Col A B C -> Col A P C -> Per A B C -> Perp_at P P B A C -> Bet A P C.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Bet Tn A P C *)
assert( A <> C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Col Tn O X P *)
(* Goal: @Perp_at Tn Q O Q C D *)
apply H.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Bet Tn A P C *)
assert(Bet A P C /\ A <> P /\ C <> P).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l11_47 A C B P); auto.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
Qed.





Lemma ts_per_per_ts : forall A B C D, TS A B C D -> Per B C A -> Per B D A -> TS C D A B.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @TS Tn C D A B *)
assert(HTS:= H).
(* Goal: @TS Tn C D A B *)
    unfold TS in H.
(* Goal: @TS Tn C D A B *)
    assert (~ Col C A B).
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Acute Tn C' B C *)
      assumption.
(* Goal: @Col Tn X Y' Y *)
    spliter.
(* Goal: @TS Tn C D A B *)
    clear H.
(* Goal: @Bet Tn O A' B' *)
    assert (A <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
      subst B.
(* Goal: @Col Tn X Y' Y *)
      Col.
(* Goal: @TS Tn C D A B *)
    ex_and H4 P.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
    assert_diffs.
(* Goal: @TS Tn C D A B *)
    show_distinct C D.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @TS Tn C D A B *)
unfold TS.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@Col Tn B C D) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
assert(A = P).
(* Goal: @eq (@Tpoint Tn) B P *)
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
apply bet_col in H5.
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 A B C D); Col.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
apply H6.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per2_col_eq A C D B); finish.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
assert(B = P).
(* Goal: @eq (@Tpoint Tn) B P *)
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
apply bet_col in H5.
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 A B C D); Col.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
apply H6.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(per2_col_eq B C D A); finish.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
exists P.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.

(* Goal: @Bet Tn A P B *)
assert(exists X : Tpoint, Col A B X /\ Perp A B C X).
(* Goal: @Col Tn X Y' Y *)
apply(l8_18_existence A B C); Col.
(* Goal: @Bet Tn A P B *)
ex_and H7 C'.

(* Goal: @Bet Tn A P B *)
assert(exists X : Tpoint, Col A B X /\ Perp A B D X).
(* Goal: @Col Tn X Y' Y *)
apply(l8_18_existence A B D); Col.
(* Goal: @Bet Tn A P B *)
ex_and H12 D'.

(* Goal: @Bet Tn A P B *)
assert( A <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
apply perp_perp_in in H8.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
apply perp_in_comm in H8.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
apply perp_in_per in H8.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
assert(A = C).
(* Goal: @Perp Tn C D X Y *)
apply (l8_7 B); Perp.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn A P B *)
assert( A <> D').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Bet Tn A P B *)
(* Goal: @Bet Tn A P B *)
subst D'.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
apply perp_perp_in in H14.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
apply perp_in_comm in H14.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
apply perp_in_per in H14.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
assert(A = D).
(* Goal: @Perp Tn C D X Y *)
apply (l8_7 B); Perp.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
subst D.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.


(* Goal: @Bet Tn A P B *)
assert(Bet A C' B).
(* Goal: @Col Tn X Y' Y *)
apply(perp_per_bet A C B C'); Col.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp_at Tn C' C' C A B *)
(* Goal: @Bet Tn A P B *)
assert(Perp A C' C' C).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ B); Col; Perp.
(* Goal: @Perp_at Tn P A P P C *)
apply perp_in_sym.
(* Goal: @Perp_at Tn P B P P C *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
apply perp_in_right_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l8_15_1 A B C C'); auto.

(* Goal: @Bet Tn A P B *)
assert(Bet A D' B).
(* Goal: @Col Tn X Y' Y *)
apply(perp_per_bet A D B D'); Col.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp_at Tn D' D' D A B *)
(* Goal: @Bet Tn A P B *)
assert(Perp A D' D' D).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ B); Col; Perp.
(* Goal: @Perp_at Tn P A P P C *)
apply perp_in_sym.
(* Goal: @Perp_at Tn P B P P C *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
apply perp_in_right_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(l8_15_1 A B D D'); auto.

(* Goal: @Bet Tn A P B *)
induction(eq_dec_points C' P).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A P B *)
induction(eq_dec_points D' P).
(* Goal: @Bet Tn A P B *)
(* Goal: @Bet Tn A P B *)
subst D'.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A P B *)
induction(eq_dec_points A P).
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Bet Tn A P B *)
induction(eq_dec_points B P).
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn A P B *)
assert(Bet C' P D').
(* Goal: @Col Tn X Y' Y *)
apply(per13_preserves_bet C P D C' D'); Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Per Tn P C' C *)
(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
assert(Perp P C' C' C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ A);auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ B);Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
apply perp_comm in H24.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H24.
(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
apply perp_in_comm in H24.
(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
apply perp_in_per in H24.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
assert(Perp P D' D' D).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(perp_col _ A);auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ B);Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
apply perp_comm in H24.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H24.
(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
apply perp_in_comm in H24.
(* Goal: @Per Tn P D' D *)
(* Goal: @Bet Tn A P B *)
apply perp_in_per in H24.
(* Goal: @Acute Tn C' B C *)
assumption.

(* Goal: @Bet Tn A P B *)
assert(HH:= l5_3 A C' D' B H18 H19).
(* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
induction HH.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
eBetween.
(* Goal: @Bet Tn A P B *)
apply between_symmetry in H24.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
eBetween.
Qed.


Lemma l13_2_1 : forall A B C D E, TS A B C D -> Per B C A -> Per B D A -> Col C D E
    -> Perp A E C D -> CongA C A B D A B
    -> CongA B A C D A E /\ CongA B A D C A E /\ Bet C E D.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
    assert(HH:= H).
    unfold TS in HH.
(* Goal: @TS Tn C D A B *)
    assert (~ Col C A B).
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Acute Tn C' B C *)
      assumption.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    assert(A <> C /\ A <> B /\ A <> D).
      unfold CongA in H4.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      repeat split; auto.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    assert(Cong B C B D /\ Cong A C A D /\ CongA C B A D B A).
      apply(l11_50_2 B A C B A D).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
        apply H6.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        eapply l11_16; auto.
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
          apply l8_2.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
          intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
          subst C.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
          apply H6.
(* Goal: @Col Tn X Y' Y *)
          Col.
(* Goal: @Per Tn B' A' A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
          apply l8_2.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
        subst D.
        apply H7.
(* Goal: @Col Tn X Y' Y *)
        Col.
        apply conga_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Cong Tn B C B C' *)
      Cong.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    assert(Perp C D A B).
(* Goal: @Cong Tn B C B C' *)
      apply( cong_conga_perp C A D B); Cong.
    assert(Col A B E).
      apply cop_perp2__col with C D.
        exists E.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
        left.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply perp_sym.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
        apply H15.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
    assert(TS C D A B).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply ts_per_per_ts; auto.
    unfold TS in H17.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    ex_and H19 T1.
    ex_and H8 T.
    assert(T = T1).
      apply bet_col in H20.
      apply bet_col in H21.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
      assert_diffs.
(* Goal: @Col Tn X Y' Y *)
      apply (l6_21 A B C D); Col.
    subst T1.
    assert(T = E).
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
      assert_diffs.
(* Goal: @Col Tn X Y' Y *)
      apply (l6_21 A B C D); Col.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
    subst T.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
    split.
      apply conga_left_comm.
      eapply out_conga.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
        apply H4.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
      unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
      subst E.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      contradiction.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
    split.
      apply conga_sym.
      apply conga_right_comm.
      eapply out_conga.
(* Goal: False *)
(* Goal: @Bet Tn A B C *)
        apply H4.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
        unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
        subst E.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
        contradiction.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply out_trivial; auto.
(* Goal: @Acute Tn C' B C *)
    assumption.
Qed.


  Lemma triangle_mid_par : forall A B C P Q, ~Col A B C -> Midpoint P B C -> Midpoint Q A C -> Par_strict A B Q P.
  Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
  intros.
(* Goal: @Par_strict Tn A B Q P *)
   assert(HM:= midpoint_existence A B).
(* Goal: @Par_strict Tn A B Q P *)
   ex_and HM R.
(* Goal: @Par_strict Tn A B Q P *)
   assert(HH:= l13_1_aux A B C P Q R H H0 H1 H2).
(* Goal: @Perp2 Tn A B A B P *)
(* Goal: @Perp2 Tn A B A B P *)
   ex_and HH X.
(* Goal: @Par_strict Tn A B Q P *)
   ex_and H3 Y.
(* Goal: @Par_strict Tn A B Q P *)
assert(Coplanar X Y A P /\ Coplanar X Y A Q /\ Coplanar X Y B P /\ Coplanar X Y B Q).
(* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *)
(* Goal: @Par_strict Tn A B Q P *)
  assert(Coplanar A B C A).
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
  exists A.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
  left.
(* Goal: @Col Tn X Y' Y *)
  split; Col.
(* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *)
(* Goal: @Par_strict Tn A B Q P *)
  assert(Coplanar A B C B).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
  exists B.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
  left.
(* Goal: @Col Tn X Y' Y *)
  split; Col.
(* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *)
(* Goal: @Par_strict Tn A B Q P *)
  assert(Coplanar A B C P).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
  exists B.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
  left.
(* Goal: @Col Tn X Y' Y *)
  split; Col.
(* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *)
(* Goal: @Par_strict Tn A B Q P *)
  assert(Coplanar A B C Q).
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
  exists A.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
  left.
(* Goal: @Col Tn X Y' Y *)
  split; Col.
(* Goal: @Acute Tn C' B C *)
  repeat split; apply coplanar_pseudo_trans with A B C; assumption.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
assert(HH:= perp_in_col X Y A B R H3).
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
   apply perp_in_perp_bis in H3.
(* Goal: @Par_strict Tn A B Q P *)
unfold Midpoint in H2.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H2.
(* Goal: @Perp Tn X Y E F *)
assert(X <> Y).
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_distinct in H4.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
   induction H3.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
   assert(Perp Y X A B).
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ R); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply perp_left_comm in H15.
(* Goal: @Par_strict Tn A B Q P *)
assert(Par A B P Q).
(* Goal: @Perp Tn C D X Y *)
   apply(l12_9 A B P Q X Y);Perp.
(* Goal: @Par_strict Tn A B Q P *)
induction H16.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
assert(Col A B P).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Par_strict Tn A B Q P *)
assert(P = B).
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 A B C P); Col.
(* Goal: @Par_strict Tn A B Q B *)
unfold Midpoint in H0.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: not (@eq (@Tpoint Tn) C P) *)
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H0.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: @Par_strict Tn A B Q B *)
unfold Midpoint in H0.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q B *)
apply cong_symmetry in H21.
(* Goal: @Par_strict Tn A B Q B *)
apply cong_identity in H21.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Par_strict Tn A B Q P *)
assert(Perp X Y A B).
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ R); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Par_strict Tn A B Q P *)
assert(Par A B P Q).
(* Goal: @Perp Tn C D X Y *)
   apply(l12_9 A B P Q X Y);Perp.
(* Goal: @Par_strict Tn A B Q P *)
induction H16.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q P *)
assert(Col A B P).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Par_strict Tn A B Q P *)
assert(P = B).
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 A B C P); Col.
(* Goal: @Par_strict Tn A B Q B *)
unfold Midpoint in H0.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: not (@eq (@Tpoint Tn) C P) *)
(* Goal: @Par_strict Tn A B Q P *)
apply bet_col in H0.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: @Par_strict Tn A B Q B *)
unfold Midpoint in H0.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Par_strict Tn A B Q B *)
apply cong_symmetry in H21.
(* Goal: @Par_strict Tn A B Q B *)
apply cong_identity in H21.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
Qed.

Lemma cop4_perp_in2__col : forall A B A' B' X Y P,
  Coplanar X Y A A' -> Coplanar X Y A B' ->
  Coplanar X Y B A' -> Coplanar X Y B B' ->
  Perp_at P A B X Y -> Perp_at P A' B' X Y  -> Col A B A'.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Col Tn A B A' *)
assert(HP1:= H3).
(* Goal: @Col Tn A B A' *)
assert(HP2:=H4).
(* Goal: @Col Tn A B A' *)
assert(Col A B P /\ Col X Y P).
(* Goal: and (@Col Tn A B P) (@Col Tn X Y P) *)
(* Goal: @Col Tn A B A' *)
apply perp_in_col in H3.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn A B A' *)
unfold Perp_at in H3.
(* Goal: @Col Tn A B A' *)
unfold Perp_at in H4.
(* Goal: @Col Tn X Y' Y *)
spliter.
induction(eq_dec_points A P);
induction(eq_dec_points P X).
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
subst A.
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Col Tn P B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
assert(Per B P Y).
(* Goal: @Col Tn X Y' Y *)
apply(H14 B Y); Col.
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
assert(Per A' P Y).
(* Goal: @Col Tn X Y' Y *)
apply(H10 A' Y); Col.
(* Goal: @Col Tn P B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
apply col_permutation_2.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cop_per2__col with Y; Cop.
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
subst A.
(* Goal: @Col Tn P B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
assert(Per B P X).
(* Goal: @Col Tn X Y' Y *)
apply(H14 B X); Col.
(* Goal: @Col Tn A B A' *)
assert(Per A' P X).
(* Goal: @Col Tn X Y' Y *)
apply(H10 A' X); Col.
(* Goal: @Col Tn P B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
apply col_permutation_2.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply cop_per2__col with X; auto.
(* Goal: @Coplanar Tn X A A' P *)
(* Goal: @Col Tn A B A' *)
apply coplanar_perm_12.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply col_cop__cop with Y; Col; Cop.
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
assert(Per A P Y).
(* Goal: @Col Tn X Y' Y *)
apply(H14 A Y); Col.
(* Goal: @Col Tn A B A' *)
induction(eq_dec_points P A').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: @Col Tn A B P *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
assert(Per B' P Y).
(* Goal: @Col Tn X Y' Y *)
apply(H10 B' Y); Col.
(* Goal: @Col Tn A B P *)
(* Goal: @Col Tn A B A' *)
assert(Col A B' P).
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cop_per2__col with Y; Cop.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
assert(Per A' P Y).
(* Goal: @Col Tn X Y' Y *)
apply(H10 A' Y); Col.
(* Goal: @Col Tn A B A' *)
assert(Col A A' P).
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply cop_per2__col with Y; Cop.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Col Tn A B A' *)
assert(Per A P X).
(* Goal: @Col Tn X Y' Y *)
apply(H14 A X); Col.
(* Goal: @Col Tn A B A' *)
induction(eq_dec_points P A').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: @Col Tn A B P *)
(* Goal: @Col Tn A B A' *)
assert(Per B' P X).
(* Goal: @Col Tn X Y' Y *)
apply(H10 B' X); Col.
(* Goal: @Col Tn A B P *)
(* Goal: @Col Tn A B A' *)
assert(Col A B' P).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply cop_per2__col with X; auto.
(* Goal: @Coplanar Tn X A A' P *)
(* Goal: @Col Tn A B A' *)
apply coplanar_perm_12.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply col_cop__cop with Y; Col; Cop.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Col Tn A B A' *)
assert(Per A' P X).
(* Goal: @Col Tn X Y' Y *)
apply(H10 A' X); Col.
(* Goal: @Col Tn A B A' *)
assert(Col A A' P).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply cop_per2__col with X; auto.
(* Goal: @Coplanar Tn X A A' P *)
(* Goal: @Col Tn A B A' *)
apply coplanar_perm_12.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply col_cop__cop with Y; Col; Cop.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
Qed.


Lemma l13_2 : forall A B C D E, TS A B C D -> Per B C A -> Per B D A -> Col C D E -> Perp A E C D
    -> CongA B A C D A E /\ CongA B A D C A E /\ Bet C E D.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
    assert(HH:= H).
    unfold TS in HH.
(* Goal: @TS Tn C D A B *)
    assert(~ Col C A B).
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Acute Tn C' B C *)
      assumption.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    assert(C <> D).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
      subst D.
      assert(OS A B C C).
(* Goal: @OS Tn A' B' A A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply one_side_reflexivity.
(* Goal: @Acute Tn C' B C *)
        assumption.
      apply l9_9 in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      contradiction.
    assert(exists C', CongA B A C D A C' /\ OS D A C' B).
      apply(angle_construction_1 B A C D A B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
        apply H5.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
      apply H6.
(* Goal: @Col Tn X Y' Y *)
      Col.
    ex_and H9 E'.
    assert(A <> B /\ A <> C /\ A <> D).
      unfold CongA in H9.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      spliter; auto.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    assert(HH:=l11_22 C A E' B D A B E').
    assert(HH1:=ts_per_per_ts A B C D H H0 H1).
    unfold TS in HH1.
    assert (~ Col A C D).
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Acute Tn C' B C *)
      assumption.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    ex_and H7 T.
    ex_and H17 T2.
    assert(T = T2).
(* Goal: @Col Tn X Y' Y *)
      apply (l6_21 A B C D); Col.
    subst T2.
    assert(InAngle B D A C).
(* Goal: @InAngle Tn P A B C *)
(* Goal: @CongA Tn A B P A B P *)
      unfold InAngle.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      repeat split; auto.
      exists T.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        Between.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      right.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
      unfold Out.
(* Goal: @Out Tn O P Q *)
      repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
        subst T.
        assert(~ Col C D A /\ Per A E D).
          apply(l8_16_1 C D A D E H2).
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
          apply perp_sym.
(* Goal: @Acute Tn C' B C *)
          assumption.
(* Goal: @Col Tn X Y' Y *)
        spliter.
        apply H20.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
      left.
(* Goal: @Acute Tn C' B C *)
      assumption.
    assert(LeA C A B C A D).
(* Goal: @LeA Tn A B P A B C *)
      unfold LeA.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
      exists B.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
        apply l11_24.
(* Goal: @Acute Tn C' B C *)
        assumption.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply conga_refl; auto.
    assert(InAngle E' D A C).
      eapply lea_in_angle.
        apply lea_comm.
        eapply l11_30.
(* Goal: False *)
        apply H21.
        apply conga_comm.
(* Goal: @Acute Tn C' B C *)
        assumption.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply conga_refl; auto.
      assert(HH1:=ts_per_per_ts A B C D H H0 H1).
      assert(OS D A C B).
        apply ts_ts_os.
          apply invert_two_sides.
(* Goal: @Acute Tn C' B C *)
          assumption.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
        apply l9_2.
(* Goal: @Acute Tn C' B C *)
        assumption.
      eapply one_side_transitivity.
(* Goal: False *)
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
        apply H22.
(* Goal: @OS Tn A' B' B A *)
(* Goal: @OS Tn A' B' A B'' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
      apply one_side_symmetry.
(* Goal: @Acute Tn C' B C *)
      assumption.
    unfold InAngle in H22.
(* Goal: @Col Tn X Y' Y *)
    spliter.
    ex_and H25 E''.
(* Goal: @Col Tn B B0 C' *)
(* Goal: @Bet Tn B' O C' *)
    induction H26.
      subst E''.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
      apply False_ind.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
      apply H15.
      apply bet_col in H25.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert(CongA B A C D A E'').
      eapply (out_conga B A C D A E').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
      apply l6_6.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
    assert(A <> T).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      subst T.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
      apply H15.
(* Goal: @Col Tn X Y' Y *)
      Col.
    induction(eq_dec_points E'' T).
      subst E''.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply l13_2_1; auto.
      eapply out_conga.
        apply conga_left_comm.
        apply H27.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply out_trivial; auto.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
      unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      repeat split; auto.
    assert(D <> E'').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
      subst E''.
      apply conga_sym in H27.
      apply eq_conga_out in H27.
      apply out_col in H27.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      apply H5.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert(C <> E'').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
      subst E''.
      assert(Out A B D \/ TS C A B D).
        apply(conga_cop__or_out_ts C A B D).
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
          Cop.
        apply conga_comm.
(* Goal: @Acute Tn C' B C *)
        assumption.
      induction H31.
        apply out_col in H31.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
        apply H6.
(* Goal: @Col Tn X Y' Y *)
        Col.
      assert(OS A C B D).
        apply ts_ts_os.
(* Goal: @Acute Tn C' B C *)
          assumption.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply ts_per_per_ts; auto.
      apply invert_one_side in H32.
      apply l9_9 in H31.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      contradiction.
    assert(A <> E'').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
      subst E''.
      unfold Out in H26.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
      tauto.
    assert(~ Col E'' A B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
      apply H29.
      apply bet_col in H25.
(* Goal: @Col Tn X Y' Y *)
      apply (l6_21 A B C D); Col.
    assert(CongA C A E'' D A B).
      apply (l11_22 C A E'' B D A B E'').
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
        induction(one_side_dec A B C E'').
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
          right.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
          split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
            auto.
(* Goal: @OS Tn A' B' A B *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
          unfold OS.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
          exists C.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
          split.
(* Goal: @TS Tn C D A B *)
            unfold TS.
(* Goal: @Out Tn O P Q *)
            repeat split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
              auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
              apply H15.
              apply bet_col in H25.
              apply col_permutation_1.
(* Goal: @Col Tn X Y' Y *)
              eapply (col_transitivity_1 _ E''); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              intro.
              apply bet_col in H25.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
              apply H15.
(* Goal: @Col Tn P B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
              apply col_permutation_2.
(* Goal: @Col Tn X Y' Y *)
              eapply (col_transitivity_1 _ E''); Col.
            exists E''.
(* Goal: @Col Tn X Y' Y *)
            split; Col.
          assert(TS A E'' T C).
(* Goal: @TS Tn C D A B *)
            unfold TS.
(* Goal: @Out Tn O P Q *)
            repeat split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
              auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              intro.
              apply H29.
(* Goal: @Col Tn X Y' Y *)
              apply (l6_21 A B C D);Col.
(* Goal: @Col Tn X Y' Y *)
              eapply (col_transitivity_1 _ T); Col.
              apply bet_col in H25.
(* Goal: @Col Tn X Y' Y *)
              Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
              apply H15.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
              ColR.
            exists E''.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
            split.
(* Goal: @Col Tn X Y' Y *)
              Col.
            assert(Bet C T E'' \/ Bet C E'' T).
              eapply l5_3.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) B' A) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
                apply H18.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              Between.
            induction H35.
              assert(TS A B C E'').
(* Goal: @TS Tn C D A B *)
                unfold TS.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
                repeat split; auto.
                exists T.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
                split.
(* Goal: @Col Tn X Y' Y *)
                  Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
                auto.
              apply l9_9 in H36.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
              contradiction.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            Between.
(* Goal: @Col Tn X Y' Y *)
          eapply (l9_5 _ _ T _ A); Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
          unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          repeat split; auto.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
        left.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        apply cop__not_one_side_two_sides in H34; auto.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
        split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
        assert(OS A B D E'').
          eapply l9_8_1.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
            apply l9_2.
(* Goal: False *)
(* Goal: @Col Tn O X P *)
(* Goal: @Perp_at Tn Q O Q C D *)
            apply H.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
          apply l9_2.
(* Goal: @Acute Tn C' B C *)
          assumption.
        assert(TS A E'' T D).
(* Goal: @TS Tn C D A B *)
          unfold TS.
(* Goal: @Out Tn O P Q *)
          repeat split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
            auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
            apply H33.
(* Goal: @Col Tn P B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
            apply col_permutation_2.
(* Goal: @Col Tn X Y' Y *)
            apply(col_transitivity_1 _ T); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
            apply bet_col in H25.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
            apply H15.
            apply col_permutation_1.
(* Goal: @Col Tn X Y' Y *)
            eapply (col_transitivity_1 _ E''); Col.
          exists E''.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
          split.
(* Goal: @Col Tn X Y' Y *)
            Col.
          assert(Bet D T E'' \/ Bet D E'' T).
            eapply l5_3.
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
              apply between_symmetry.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) B' A) *)
(* Goal: not (@Col Tn C' B B') *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *)
(* Goal: @Bet Tn A B C *)
(* Goal: @Bet Tn A B C *)
              apply H18.
(* Goal: @Acute Tn C' B C *)
            assumption.
          induction H36.
            assert(TS A B D E'').
(* Goal: @TS Tn C D A B *)
              unfold TS.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
              repeat split; auto.
              exists T.
(* Goal: @Col Tn X Y' Y *)
              split; Col.
            apply l9_9 in H37.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
            contradiction.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
          Between.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
        apply l9_2.
        eapply (l9_5 _ _ T _ A).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
(* Goal: @Col Tn X Y' Y *)
          Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
        unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        repeat split; auto.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply col_cop__cop with D; Col; Cop.

(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
        apply conga_left_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
      apply conga_right_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply conga_refl; auto.
    (***********************)
    prolong B C C' B C.
    prolong B D D' B D.
    assert(Cong_3 B A D D' A D).
      apply l8_2 in H1.
      unfold Per in H1.
      ex_and H1 D''.
      assert(Midpoint D B D').
        unfold Midpoint.
(* Goal: @Cong Tn B C B C' *)
        split; Cong.
      assert(D' = D'').
        eapply symmetric_point_uniqueness.
          apply H40.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
      subst D''.
(* Goal: @Cong Tn B C B C' *)
      repeat split; Cong.
    assert(CongA B A D D' A D).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply cong3_conga; auto.
    assert(Cong_3 B A C C' A C).
      apply l8_2 in H0.
      unfold Per in H0.
      ex_and H0 C''.
      assert(Midpoint C B C').
        unfold Midpoint.
(* Goal: @Cong Tn B C B C' *)
        split; Cong.
      assert(C' = C'').
        eapply symmetric_point_uniqueness.
          apply H42.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
      subst C''.
(* Goal: @Cong Tn B C B C' *)
      repeat split; Cong.
    assert(CongA B A C C' A C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      apply cong3_conga; auto.
    assert(CongA E'' A C' D' A E'').
      apply l11_22 with C D.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
        clear HH.
        (***************************************************)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
        left.
        assert(OS C A D E'').
          eapply out_out_one_side.
(* Goal: @OS Tn A' B' A A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
            apply one_side_reflexivity.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
            apply H15.
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
          unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          repeat split; auto.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
          right.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
          Between.
        assert(OS C A B D).
          apply in_angle_one_side.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
            apply H15.
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
            apply H5.
(* Goal: @Col Tn X Y' Y *)
            Col.
          apply l11_24.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
        assert(TS C A B C').
(* Goal: @TS Tn C D A B *)
          unfold TS.
(* Goal: @Out Tn O P Q *)
          repeat split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
            auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
            apply H5.
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
            apply H5.
            apply bet_col in H35.
(* Goal: @Bet Tn A B C *)
            assert(C <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
              subst C'.
              apply cong_symmetry in H36.
              apply cong_identity in H36.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
              subst C.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
              apply H16.
(* Goal: @Col Tn X Y' Y *)
              Col.
(* Goal: @Col Tn X Y' Y *)
            eapply (col_transitivity_1 _ C'); Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
          exists C.
(* Goal: @Col Tn X Y' Y *)
          split; Col.
        assert(OS C A B E'').
          eapply one_side_transitivity.
            apply H44.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
        assert(OS D A C E'').
          eapply out_out_one_side.
(* Goal: @OS Tn A' B' A A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
            apply one_side_reflexivity.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
            apply H15.
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
          unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          repeat split; auto.
        assert(OS D A B C).
          apply in_angle_one_side.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
            apply H15.
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
            apply H6.
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
        assert(TS D A B D').
(* Goal: @TS Tn C D A B *)
          unfold TS.
(* Goal: @Out Tn O P Q *)
          repeat split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
            auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
            apply H6.
(* Goal: @Col Tn X Y' Y *)
            Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
            apply H6.
            apply bet_col in H37.
            assert(D <> D').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              intro.
(* Goal: @Bet Tn A P B *)
(* Goal: @Bet Tn A P B *)
              subst D'.
              apply cong_symmetry in H38.
              apply cong_identity in H38.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
              subst D.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
              apply H16.
(* Goal: @Col Tn X Y' Y *)
              Col.
(* Goal: @Col Tn X Y' Y *)
            eapply (col_transitivity_1 _ D'); Col.
          exists D.
(* Goal: @Col Tn X Y' Y *)
          split; Col.
        assert(OS D A B E'').
          eapply one_side_transitivity.
            apply H48.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
        split.
          apply invert_two_sides.
          eapply l9_8_2.
            apply H45.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
          auto.
        apply invert_two_sides.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
        apply l9_2.
        eapply l9_8_2.
          apply H49.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
        eapply conga_trans.
          apply conga_comm.
          apply H34.
        apply H40.
      apply conga_sym.
      eapply conga_trans.
        apply conga_sym.
        apply H27.
      apply conga_right_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
    assert(D' <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: @Bet Tn A P B *)
(* Goal: @Bet Tn A P B *)
      subst D'.
      apply between_identity in H37.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
      subst D.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
      apply H16.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert(C' <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
      subst C'.
      apply between_identity in H35.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
      subst C.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
      apply H16.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert(~ Col C' D' B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
      apply H16.
      apply bet_col in H35.
      apply  bet_col in H37.
      assert(Col C' B D).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        ColR.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
    assert(Par_strict C' D' C D).
      apply(triangle_mid_par C' D' B D C).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
        unfold Midpoint.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
        split.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
          Between.
(* Goal: @Cong Tn B C B C' *)
        Cong.
      unfold Midpoint.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
      split.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        Between.
(* Goal: @Cong Tn B C B C' *)
      Cong.
    assert(TS A E'' C D).
(* Goal: @TS Tn C D A B *)
      unfold TS.
(* Goal: @Out Tn O P Q *)
      repeat split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
        apply H15.
        apply bet_col in H25.
(* Goal: @Col Tn P B A' *)
(* Goal: @Col Tn A B A' *)
(* Goal: @Col Tn A B A' *)
        apply col_permutation_2.
(* Goal: @Col Tn X Y' Y *)
        eapply (col_transitivity_1 _ E''); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *)
(* Goal: @Bet Tn A' B' C' *)
(* Goal: @Bet Tn A' B' C' *)
        apply H15.
        apply bet_col in H25.
        apply col_permutation_1.
(* Goal: @Col Tn X Y' Y *)
        eapply (col_transitivity_1 _ E''); Col.
      exists E''.
(* Goal: @Col Tn X Y' Y *)
      split; Col.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      Between.
    assert(TS B A C D).
      apply in_angle_two_sides.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
        apply H5.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
        apply H6.
(* Goal: @Col Tn X Y' Y *)
        Col.
      apply l11_24.
(* Goal: @Acute Tn C' B C *)
      assumption.
    assert (OS A B C C').
(* Goal: @Col Tn X Y' Y *)
      apply (out_one_side_1 _ _ _ _ B); Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
      unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
      subst C.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      apply H5.
(* Goal: @Col Tn X Y' Y *)
      Col.
    assert (OS A B D D').
(* Goal: @Col Tn X Y' Y *)
      apply (out_one_side_1 _ _ _ _ B); Col.
(* Goal: @Out Tn A B C *)
(* Goal: @Out Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B C' *)
(* Goal: @Bet Tn A' B' C' *)
      unfold Out.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: @Bet Tn A P B *)
      subst D.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *)
      apply H6.
(* Goal: @Col Tn X Y' Y *)
      Col.
    apply invert_two_sides in H49.
    assert(TS A B C' D).
      eapply l9_8_2.
        apply H49.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
    assert(TS A B C' D').
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
      apply l9_2.
      eapply l9_8_2.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
        apply l9_2.
        apply H52.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
    assert(Perp  C' D' A E'').
      eapply cong_conga_perp.
        apply conga_right_comm in H43.
        apply conga_cop__or_out_ts in H43.
        induction H43.
          assert(OS A B C' D').
(* Goal: @Col Tn X Y' Y *)
            eapply (out_one_side_1 _ _ _ _ A); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
            intro.
            assert(B <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
              intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
              subst C'.
              apply H46.
(* Goal: @Col Tn X Y' Y *)
              Col.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
            apply H5.
            apply col_permutation_1.
            eapply col_transitivity_1.
              apply H55.
              apply bet_col in H35.
(* Goal: @Col Tn X Y' Y *)
              Col.
(* Goal: @Col Tn X Y' Y *)
            Col.
          apply l9_9 in H53.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
          contradiction.
        apply invert_two_sides.
(* Goal: @Acute Tn C' B C *)
        assumption.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
        apply coplanar_pseudo_trans with B C D; Cop.
        unfold Cong_3 in *.
(* Goal: @Col Tn X Y' Y *)
        spliter.
(* Goal: @Cong Tn B C B C' *)
        apply cong_transitivity with B A; Cong.
      apply conga_left_comm.
(* Goal: @Acute Tn C' B C *)
      assumption.


assert(Cong A C' A B).
apply l8_2 in H0.
unfold Per in H0.
ex_and H0 C''.
assert(C' = C'').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(symmetric_point_uniqueness B C C' C''); finish.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
split; finish.
subst C''.
(* Goal: @Cong Tn B C B C' *)
Cong.

assert(Cong A D' A B).
apply l8_2 in H1.
unfold Per in H1.
ex_and H1 D''.
assert(D' = D'').
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(symmetric_point_uniqueness B D D' D''); finish.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
split; finish.
subst D''.
(* Goal: @Cong Tn B C B C' *)
Cong.

assert(Cong A C' A D').
(* Goal: @Cong Tn B C B C' *)
apply cong_transitivity with A B; Cong.

assert(HM:=midpoint_existence C' D').
(* Goal: @Par_strict Tn A B Q P *)
ex_and HM R.
assert(exists X Y : Tpoint, Perp_at R X Y C' D' /\ Perp X Y D C /\ Coplanar C' D' B X /\ Coplanar C' D' B Y).
apply l13_1_aux;
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
finish.
(* Goal: @Cong Tn B C B C' *)
split; Between; Cong.
(* Goal: @Cong Tn B C B C' *)
split; Between; Cong.
ex_and H59 X.
ex_and H60 Y.

assert(HXY:X <> Y).
apply perp_distinct in H60.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

assert(Perp C D A E'').

induction(eq_dec_points A R).
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst R.

assert(Perp_at A C' D' A E'').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
assert_cols.
(* Goal: @Col Tn X Y' Y *)
apply(l8_14_2_1b_bis C' D' A E'' A); Col.

assert(Coplanar B C' D' E'').
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_pseudo_trans with B C D; Cop.
assert(Coplanar C' D' X E'').
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with B; Col; Cop.
assert(Coplanar C' D' Y E'').
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with B; Col; Cop.
assert(Coplanar C' D' X A).
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
assert(Coplanar C' D' Y A).
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
assert(Col X Y A).
(* Goal: @Perp Tn C D X Y *)
apply(cop4_perp_in2__col X Y A E'' C' D' A); Perp.
assert(Col X Y E'').
(* Goal: @Perp Tn C D X Y *)
apply(cop4_perp_in2__col X Y E'' A C' D' A); Perp.
(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
induction(eq_dec_points Y A).
subst Y.
apply(perp_col _ X).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
apply(perp_col _ Y).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Col Tn X Y' Y *)
apply (perp_col _ X); Col.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

assert(R <> C').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
subst R.
unfold Midpoint in H58.
(* Goal: @Col Tn X Y' Y *)
spliter.
apply cong_symmetry in H64.
apply cong_identity in H64.
(* Goal: @Bet Tn A P B *)
(* Goal: @Bet Tn A P B *)
subst D'.
apply perp_distinct in H54.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

assert(Per A R C').
(* Goal: @Per Tn B P' A' *)
unfold Per.
exists D'.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
split; finish.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply per_perp_in in H65; auto.
apply perp_in_sym in H65.
apply perp_in_perp_bis in H65.
induction H65.
apply perp_comm in H65.
assert(Perp C' D' R A).
apply(perp_col _ R).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Bet Tn A P B *)
(* Goal: @Bet Tn A P B *)
subst D'.
apply perp_distinct in H54.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
assert_cols.
(* Goal: @Col Tn X Y' Y *)
Col.

assert(Perp_at R C' D' R A).
(* Goal: @Col Tn X Y' Y *)
apply(l8_14_2_1b_bis C' D' R A R); Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
assert_cols.
(* Goal: @Col Tn X Y' Y *)
Col.

assert(Coplanar C' D' X A).
(* Goal: @Col Tn X Y' Y *)
apply coplanar_trans_1 with B; Cop; Col.
assert(Coplanar C' D' Y A).
(* Goal: @Col Tn X Y' Y *)
apply coplanar_trans_1 with B; Cop; Col.
assert(Coplanar C' D' X R).
(* Goal: @Coplanar Tn A B C R *)
(* Goal: @Coplanar Tn A B C X *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
exists R.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
assert(Coplanar C' D' Y R).
(* Goal: @Coplanar Tn A B C R *)
(* Goal: @Coplanar Tn A B C X *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
exists R.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
assert( Col X Y A).
(* Goal: @Perp Tn C D X Y *)
apply(cop4_perp_in2__col X Y A R C' D' R); Perp.
assert( Col X Y R).
(* Goal: @Perp Tn C D X Y *)
apply(cop4_perp_in2__col X Y R A C' D' R); Perp.

assert(Col A E'' R).
(* Goal: @Perp Tn C D X Y *)
apply(cop_perp2__col A E'' R C' D'); Perp.
(* Goal: @Coplanar Tn A B C R *)
(* Goal: @Coplanar Tn A B C X *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
exists R.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.

assert(Col A R X).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
assert(Col A R Y).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.


(* Goal: @Perp Tn X y P Q *)
(* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply perp_sym.
induction(eq_dec_points X A).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (perp_col _ Y); finish.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply (perp_col _ X); finish.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Par_strict Tn A B Q P *)
(* Goal: @Par_strict Tn A B Q P *)
apply(perp_col _ Y); finish.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
apply perp_distinct in H65.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

    assert(Col A E E'').
(* Goal: @Perp Tn C D X Y *)
      apply cop_perp2__col with C D; Perp.
      exists E.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
      left.
(* Goal: @Col Tn X Y' Y *)
      split; Col.
    assert(E'' = E).
(* Goal: @Col Tn X Y' Y *)
      apply (l6_21 C D A E); Col.
(* Goal: not (@eq (@Tpoint Tn) X' Y') *)
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Perp Tn X Y E F *)
      apply perp_not_eq_1 in H3.
(* Goal: @Acute Tn C' B C *)
      assumption.
    subst E''.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
    split.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
    split.
      apply conga_sym.
      apply conga_right_comm.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
    Between.
Qed.

Lemma perp2_refl : forall A B P, A <> B -> Perp2 A B A B P.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Perp2 Tn A B A B P *)
    induction(col_dec A B P).
(* Goal: @Perp2 Tn A B A B P *)
(* Goal: @Perp2 Tn A B A B P *)
      assert(HH:=not_col_exists A B H).
(* Goal: @Perp2 Tn A B A B P *)
(* Goal: @Perp2 Tn A B A B P *)
      ex_and HH X.
      assert(HH:=l10_15 A B P X  H0 H1).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
      ex_and HH Q.
(* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A D C P *)
      unfold Perp2.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D))))) *)
      exists Q.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
      exists P.
(* Goal: @Perp Tn C D X Y *)
      split; Perp.
(* Goal: @Col Tn X Y' Y *)
      Col.
(* Goal: @Perp2 Tn A B A B P *)
    assert(HH:=l8_18_existence A B P H0).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
    ex_and HH Q.
(* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A D C P *)
    unfold Perp2.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
    exists P.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D))))) *)
    exists Q.
(* Goal: @Perp Tn C D X Y *)
    split; Perp.
(* Goal: @Col Tn X Y' Y *)
    Col.
Qed.


Lemma perp2_sym : forall A B C D P, Perp2 A B C D P -> Perp2 C D A B P.
Proof.
(* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A D C P *)
    unfold Perp2.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @Par Tn A B C D *)
    ex_and H0 Y.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    exists X.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *)
    exists Y.
(* Goal: @Perp Tn C D X Y *)
    repeat split; Perp.
Qed.


Lemma perp2_left_comm : forall A B C D P, Perp2 A B C D P -> Perp2 B A C D P.
Proof.
(* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A D C P *)
    unfold Perp2.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @Par Tn A B C D *)
    ex_and H0 Y.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    exists X.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *)
    exists Y.
(* Goal: @Perp Tn C D X Y *)
    repeat split; Perp.
Qed.


Lemma perp2_right_comm : forall A B C D P, Perp2 A B C D P -> Perp2 A B D C P.
Proof.
(* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A D C P *)
    unfold Perp2.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @Par Tn A B C D *)
    ex_and H0 Y.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    exists X.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *)
    exists Y.
(* Goal: @Perp Tn C D X Y *)
    repeat split; Perp.
Qed.


Lemma perp2_comm : forall A B C D P, Perp2 A B C D P -> Perp2 B A D C P.
Proof.
(* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A D C P *)
    unfold Perp2.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @Par Tn A B C D *)
    ex_and H0 Y.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    exists X.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *)
    exists Y.
(* Goal: @Perp Tn C D X Y *)
    repeat split; Perp.
Qed.


Lemma perp2_pseudo_trans : forall A B C D E F P, Perp2 A B C D P -> Perp2 C D E F P -> ~ Col C D P ->
  Perp2 A B E F P.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Perp2 Tn A B E F P *)
    unfold Perp2 in *.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    ex_and H2 Y.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    ex_and H0 X'.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    ex_and H4 Y'.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    assert(Par X Y X' Y').
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      assert(Coplanar P C D X).
(* Goal: @Coplanar Tn P C D X *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      induction(eq_dec_points X P).
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
        subst.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
        left.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply coplanar_perm_9.
(* Goal: @Coplanar Tn Y' P C D *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply perp__coplanar.
(* Goal: @Col Tn X Y' Y *)
      apply perp_col with Y; Col.
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      assert(Coplanar P C D Y).
(* Goal: @Coplanar Tn P C D Y *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      induction(eq_dec_points Y P).
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
        subst.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
        left.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply coplanar_perm_9.
(* Goal: @Coplanar Tn Y' P C D *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply perp__coplanar.
(* Goal: @Col Tn X Y' Y *)
      apply perp_col with X; Perp; Col.
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      assert(Coplanar P C D X').
(* Goal: @Coplanar Tn P C D X' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      induction(eq_dec_points X' P).
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
        subst.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
        left.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply coplanar_perm_9.
(* Goal: @Coplanar Tn Y' P C D *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply perp__coplanar.
(* Goal: @Col Tn X Y' Y *)
      apply perp_col with Y'; Col.
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      assert(Coplanar P C D Y').
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      induction(eq_dec_points Y' P).
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
        subst.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
        left.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Coplanar Tn P C D Y' *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply coplanar_perm_9.
(* Goal: @Coplanar Tn Y' P C D *)
(* Goal: @Par Tn X Y X' Y' *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
      apply perp__coplanar.
(* Goal: @Col Tn X Y' Y *)
      apply perp_col with X'; Perp; Col.
(* Goal: @Col Tn X Y' Y *)
      apply (l12_9 _ _ _ _ C D); Perp; apply coplanar_trans_1 with P; Col.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    exists X.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *)
    exists Y.
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
    assert(Col X X' Y').
(* Goal: @Col Tn X Y' Y *)
      induction H6.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        unfold Par_strict in H6.
(* Goal: @Col Tn X Y' Y *)
        spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
        apply H9.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
    assert(Col Y X' Y').
(* Goal: @Col Tn X Y' Y *)
      induction H6.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        unfold Par_strict in H6.
(* Goal: @Col Tn X Y' Y *)
        spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
        apply H10.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
    repeat split; auto.
(* Goal: @Perp Tn X Y E F *)
    assert(X <> Y).
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
      apply perp_not_eq_1 in H2.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Perp Tn X Y E F *)
    induction(eq_dec_points X Y').
(* Goal: @Perp Tn X Y E F *)
(* Goal: @Perp Tn X Y E F *)
      subst Y'.
(* Goal: @Perp Tn Y' X E F *)
(* Goal: @Col Tn X Y' Y *)
      apply (perp_col _ X').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Perp Tn C D X Y *)
        Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
(* Goal: @Perp Tn X Y E F *)
    apply (perp_col _ Y').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
      apply perp_left_comm.
(* Goal: @Perp Tn Y' X E F *)
(* Goal: @Col Tn X Y' Y *)
      apply(perp_col _ X').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Perp Tn C D X Y *)
        Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
(* Goal: @Col Tn X Y' Y *)
    apply par_symmetry in H6.
(* Goal: @Col Tn X Y' Y *)
    induction H6.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
      unfold Par_strict in H6.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
      apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
      apply H13.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
      exists P.
(* Goal: @Col Tn X Y' Y *)
      split; Col.
(* Goal: @Col Tn X Y' Y *)
    spliter.
(* Goal: @Col Tn X Y' Y *)
    Col.
Qed.

Lemma perp2_preserves_bet23 : forall O A B A' B', Bet O A B -> Col O A' B' -> ~Col O A A' ->
    Perp2 A A' B B' O -> Bet O A' B'.

Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.

(* Goal: @Bet Tn O A' B' *)
assert(HD1: A <> A').
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn O A' B' *)
induction(eq_dec_points A' B').
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn O A' B' *)
assert(A <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: @Bet Tn B' O C' *)
unfold Perp2 in H2.
(* Goal: @Bet Tn B' O C' *)
ex_and H2 X.
(* Goal: False *)
(* Goal: @Bet Tn O A' B' *)
ex_and H4 Y.
(* Goal: False *)
(* Goal: @Bet Tn O A' B' *)
assert(Col A A' B').
(* Goal: @Perp Tn C D X Y *)
apply(cop_perp2__col A A' B' X Y); Perp.
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn O A' B' *)
assert(Par A A' B B').
(* Goal: @Bet Tn B' O C' *)
unfold Perp2 in H2.
(* Goal: @Bet Tn B' O C' *)
ex_and H2 X.
(* Goal: @Par Tn A A' B B' *)
(* Goal: @Bet Tn O A' B' *)
ex_and H5 Y.
(* Goal: @Par Tn A A' B B' *)
(* Goal: @Bet Tn O A' B' *)
assert(Coplanar X Y A B).
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Perp Tn C D X Y *)
apply (l12_9 _ _ _ _ X Y); Perp.
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
induction(col_dec B X Y).
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with B; Cop.
(* Goal: @Coplanar Tn X Y A' B *)
(* Goal: @Coplanar Tn X Y A' B' *)
(* Goal: @Bet Tn O A' B' *)
induction(col_dec A X Y).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with A; Cop.
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
induction H5.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
assert(OS A A' B B').
(* Goal: @OS Tn A A' B B' *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply l12_6; Par.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
assert(TS A A' O B).
(* Goal: @Col Tn X Y' Y *)
repeat split; Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply H5.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
exists A.
(* Goal: @Col Tn X Y' Y *)
split; Col.

(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
assert(TS A A' B' O).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply( l9_8_2 A A' B B' O); auto.
(* Goal: @TS Tn A A' B O *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply l9_2.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.

(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
unfold TS in H8.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
ex_and H10 T.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
assert(T = A').
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 A A' O B'); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: False *)
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
apply between_identity in H11.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: @Bet Tn O A' B' *)
(* Goal: @Bet Tn O A' B' *)
subst T.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
Qed.

Lemma perp2_preserves_bet13 : forall O B C B' C', Bet B O C -> Col O B' C' -> ~Col O B B' ->
    Perp2 B C' C B' O -> Bet B' O C'.

Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.

(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points C' O).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points B' O).
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn B' O C' *)
assert(B <> O).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn B' O C' *)
assert(B' <> O).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn B' O C' *)
assert(Col B O C).
(* Goal: @Col Tn B O C *)
(* Goal: @Bet Tn B' O C' *)
apply bet_col.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points B C).
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply between_identity in H.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.

(* Goal: @Bet Tn B' O C' *)
assert(Par B C' C B').
(* Goal: @Bet Tn B' O C' *)
unfold Perp2 in H2.
(* Goal: @Bet Tn B' O C' *)
ex_and H2 X.
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
ex_and H9 Y.
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
assert(Coplanar X Y B C).
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
assert(Coplanar X Y C' B').
(* Goal: @Coplanar Tn X Y C' B' *)
(* Goal: @Par Tn B C' C B' *)
(* Goal: @Bet Tn B' O C' *)
exists O.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Perp Tn C D X Y *)
apply (l12_9 _ _ _ _ X Y); Perp.
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
induction(col_dec C' X Y).
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y B B' *)
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
exists B'.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with C'; Cop.
(* Goal: @Coplanar Tn X Y C' C *)
(* Goal: @Bet Tn B' O C' *)
induction(col_dec B X Y).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; ColR.
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply coplanar_trans_1 with B; Cop.

(* Goal: @Bet Tn B' O C' *)
assert(Par_strict B C' C B').
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H9.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn B' O C' *)
assert(C<> O).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
assert(Par_strict B C' O C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(par_strict_col_par_strict _ _ _ B'); auto.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H11.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *)
(* Goal: @Bet Tn B' O C' *)
exists C'.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn B' O C' *)
assert(B' <> O).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst B'.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
assert(Par_strict B C' O B).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(par_strict_col_par_strict _ _ _ C); auto.
(* Goal: @Par_strict Tn B C' O C *)
(* Goal: @Col Tn O C B *)
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply par_strict_right_comm.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
apply H12.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: @Col Tn X Y' Y *)
split; Col.

(* Goal: @Bet Tn B' O C' *)
unfold Perp2 in H2.
(* Goal: @Bet Tn B' O C' *)
ex_and H2 X.
(* Goal: @Bet Tn B' O C' *)
ex_and H13 Y.

(* Goal: @Perp Tn X Y E F *)
assert(X <> Y).
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Bet Tn B' O C' *)
apply perp_distinct in H13.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Bet Tn B' O C' *)
induction(col_dec X Y B).
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Col X Y C).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply(per13_preserves_bet_inv  B' O C' C B); Between.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn C O C C B' *)
(* Goal: @Per Tn O B C' *)
(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points X C).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Perp_at Tn C O C C B' *)
(* Goal: @Per Tn O B C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp C O B' C).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H18.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp_at Tn C O C C B' *)
(* Goal: @Per Tn O B C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp X C C B').
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Perp_at Tn C O C C B' *)
(* Goal: @Per Tn O B C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp C O B' C).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ X); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H20.
(* Goal: @Perp Tn C D X Y *)
Perp.

(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points X B).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp B O C' B).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H18.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp X B C' B).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp B O C' B).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ X); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn B O B B C' *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H20.
(* Goal: @Perp Tn C D X Y *)
Perp.

(* Goal: @Bet Tn B' O C' *)
assert(HP1:=l8_18_existence X Y B H16).
(* Goal: @Bet Tn B' O C' *)
ex_and HP1 B0.
(* Goal: @Bet Tn B' O C' *)
assert(~Col X Y C).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H16.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Bet Tn B' O C' *)
assert(HP1:=l8_18_existence X Y C H19).
(* Goal: @Bet Tn B' O C' *)
ex_and HP1 C0.

(* Goal: @Bet Tn B' O C' *)
assert(B0 <> O).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn B B0 C' *)
(* Goal: @Bet Tn B' O C' *)
subst B0.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
assert(Par B O B C').
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply(l12_9 B O B C' X Y); Perp; Cop.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
induction H22.
(* Goal: False *)
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H22.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn B' O C' *)
assert(C0 <> O).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst C0.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
assert(Par C O C B').
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply(l12_9 C O C B' X Y); Perp; Cop.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
induction H23.
(* Goal: False *)
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H23.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.

(* Goal: @Bet Tn B' O C' *)
assert(Bet B0 O C0).

(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(per13_preserves_bet B O C B0 C0); auto.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn B0 O B0 B0 B *)
(* Goal: @Per Tn O C0 C *)
(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points X B0).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Perp_at Tn B0 O B0 B0 B *)
(* Goal: @Per Tn O C0 C *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp B0 O B B0).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H24.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp_at Tn B0 O B0 B0 B *)
(* Goal: @Per Tn O C0 C *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp X B0 B B0).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Perp_at Tn B0 O B0 B0 B *)
(* Goal: @Per Tn O C0 C *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp B0 O B B0).
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ X); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H26.
(* Goal: @Perp Tn C D X Y *)
Perp.

(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn C0 O C0 C0 B' *)
(* Goal: @Per Tn O B0 C' *)
induction(eq_dec_points X C0).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp C0 O C C0).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H24.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp X C0 C C0).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
assert(Perp C0 O C C0).
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ X); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn C0 O C0 C0 C *)
(* Goal: @Bet Tn B' O C' *)
apply perp_perp_in in H26.
(* Goal: @Perp Tn C D X Y *)
Perp.

(* Goal: @Bet Tn B' O C' *)
induction(eq_dec_points C' B0).
(* Goal: False *)
(* Goal: @Col Tn B B0 C' *)
(* Goal: @Bet Tn B' O C' *)
subst B0.
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
assert(B' = C0).
(* Goal: @eq (@Tpoint Tn) B' C0 *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply bet_col in H24.
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 C' O C C0); Col.
(* Goal: not (@Col Tn C' O C) *)
(* Goal: not (@eq (@Tpoint Tn) C C0) *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Par C B' C C0).
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply(l12_9 C B' C C0 X Y); Perp; Cop.

(* Goal: not (@Col Tn C' O C) *)
(* Goal: not (@eq (@Tpoint Tn) C C0) *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
induction H25.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H25.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst C0.
(* Goal: False *)
(* Goal: @Col Tn C C0 B' *)
(* Goal: @Bet Tn B' O C' *)
(* Goal: @Bet Tn B' O C' *)
apply H1.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp Tn C D X Y *)
apply(cop_perp2__col C C0 B' X Y); Perp.
(* Goal: @Coplanar Tn X Y C0 B' *)
(* Goal: @Bet Tn B' O C' *)
exists C0.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst C0.
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.

(* Goal: @Bet Tn B' O C' *)
assert(B' <> C0).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
subst C0.
(* Goal: False *)
(* Goal: @Bet Tn B' O C' *)
apply H25.
(* Goal: @Col Tn X Y' Y *)
apply (l6_21 B' O B B0); Col.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Col Tn B B0 C' *)
(* Goal: @Bet Tn B' O C' *)
subst B0.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Col Tn B B0 C' *)
(* Goal: @Bet Tn B' O C' *)
assert(Par B C' B B0).
(* Goal: @Coplanar Tn R y A B' *)
(* Goal: @Coplanar Tn R y B A' *)
(* Goal: @Coplanar Tn R y B B' *)
(* Goal: @Perp Tn A B R y *)
(* Goal: False *)
(* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *)
apply(l12_9 B C' B B0 X Y); Perp; Cop.

(* Goal: @Col Tn B B0 C' *)
(* Goal: @Bet Tn B' O C' *)
induction H26.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn B B0 C' *)
(* Goal: @Bet Tn B' O C' *)
apply H26.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Bet Tn B' O C' *)
assert(Col C C0 B').
(* Goal: @Perp Tn C D X Y *)
apply(cop_perp2__col C C0 B' X Y); Perp.
(* Goal: @Coplanar Tn X Y C0 B' *)
(* Goal: @Bet Tn B' O C' *)
exists C0.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Bet Tn B' O C' *)
assert(Col B B0 C').
(* Goal: @Perp Tn C D X Y *)
apply(cop_perp2__col B B0 C' X Y); Perp.
(* Goal: @Coplanar Tn X Y B0 C' *)
(* Goal: @Bet Tn B' O C' *)
exists B0.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.

(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
apply(per13_preserves_bet_inv B' O C' C0 B0); Between.
(* Goal: @Col Tn X Y' Y *)
Col.

(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn C0 O C0 C0 B' *)
(* Goal: @Per Tn O B0 C' *)
induction(eq_dec_points X C0).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Perp_at Tn C0 O C0 C0 B' *)
(* Goal: @Per Tn O B0 C' *)
assert(Perp C0 O C B').
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ Y); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp_at Tn C0 O C0 C0 B' *)
(* Goal: @Per Tn O B0 C' *)
assert(Perp B' C0 C0 O).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ C); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_comm in H30.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_perp_in in H30.
(* Goal: @Perp Tn C D X Y *)
Perp.

(* Goal: @Perp_at Tn C0 O C0 C0 B' *)
(* Goal: @Per Tn O B0 C' *)
assert(Perp X C0 C B').
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Perp_at Tn C0 O C0 C0 B' *)
(* Goal: @Per Tn O B0 C' *)
assert(Perp C0 O C B').
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ X); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn C0 O C0 C0 B' *)
(* Goal: @Per Tn O B0 C' *)
assert(Perp B' C0 C0 O).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ C); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_comm in H32.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_perp_in in H32.
(* Goal: @Perp Tn C D X Y *)
Perp.


(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.

(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
assert(Perp C' B0 X Y).
(* Goal: @Perp Tn C D X Y *)
apply (perp_col _ B); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp_at Tn Q O Q C D *)
induction (eq_dec_points X O).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
subst X.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
assert(Perp O B0 B0 C').
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y);Perp.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_comm in H30.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_perp_in in H30.
(* Goal: @Perp Tn C D X Y *)
Perp.
 
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
assert(Perp X O C' B0).
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ Y); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
assert(Perp O B0 B0 C').
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ X); Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
ColR.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_comm in H32.
(* Goal: @Perp_at Tn B0 O B0 B0 C' *)
apply perp_perp_in in H32.
(* Goal: @Perp Tn C D X Y *)
Perp.

Qed.


Lemma is_image_perp_in : forall A A' X Y, A <> A' -> X <> Y -> Reflect A A' X Y ->
  exists P, Perp_at P A A' X Y.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
unfold Reflect in H.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
induction H1.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
unfold ReflectL in H2.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
ex_and H2 P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
induction H3.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
exists P.

(* Goal: @Perp_at Tn P A P P C *)
apply perp_in_sym.
(* Goal: @Perp_at Tn P B P P C *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
apply perp_in_right_comm.
(* Goal: @Col Tn X Y' Y *)
apply(l8_14_2_1b_bis X Y A' A P); Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
assert_cols.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *)
subst A'.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
Qed.

Lemma perp_inter_perp_in_n
     : forall A B C D : Tpoint,
       Perp A B C D ->
       exists P : Tpoint, Col A B P /\ Col C D P /\ Perp_at P A B C D.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
assert(A <> B /\ C <> D).
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
apply perp_distinct in H.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
induction(col_dec A B C).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
exists C.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
apply(l8_14_2_1b_bis A B C D C); Col.

(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *)
assert(HH:=l8_18_existence A B C H2).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
ex_and HH P.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
exists P.
(* Goal: and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D)) *)
assert(Col C D P).
(* Goal: @Perp Tn C D X Y *)
apply(cop_perp2__col C D P A B); Perp.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
exists P.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
split; Col.
(* Goal: @Col Tn X Y' Y *)
apply(l8_14_2_1b_bis A B C D P); Col.
Qed.

Lemma perp2_perp_in : forall A B C D O, Perp2 A B C D O -> ~Col O A B /\ ~Col O C D ->
    exists P, exists Q, Col A B P /\ Col C D Q /\ Col O P Q /\ Perp_at P O P A B /\ Perp_at Q O Q C D.
  Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Par Tn A B C D *)
    unfold Perp2 in H.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    ex_and H1 Y.
(* Goal: @Perp Tn X Y E F *)
    assert(X <> Y).
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
      apply perp_not_eq_1 in H2.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
    assert(HH:= perp_inter_perp_in_n X Y A B H2).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
    ex_and HH P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
    assert(HH:= perp_inter_perp_in_n X Y C D H3).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *)
    ex_and HH Q.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
    exists P.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D))))) *)
    exists Q.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
    split; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
    split; auto.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
    split.
(* Goal: @Col Tn X Y' Y *)
      apply (col3 X Y); Col.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
    split.
(* Goal: @Perp_at Tn Q O Q C D *)
      induction(eq_dec_points X O).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
        subst X.
(* Goal: @Perp_at Tn P A P P C *)
        apply perp_in_sym.
(* Goal: @Perp_at Tn P A B O P *)
(* Goal: @Perp_at Tn P O P A B *)
(* Goal: @Perp_at Tn Q O Q C D *)
        apply(perp_in_col_perp_in A B O Y P P).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
          intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
          subst P.
(* Goal: False *)
(* Goal: @Col Tn O X P *)
(* Goal: @Perp_at Tn Q O Q C D *)
          apply H.
(* Goal: @Col Tn X Y' Y *)
          Col.
(* Goal: @Col Tn X Y' Y *)
          Col.
(* Goal: @Perp_at Tn P A P P C *)
        apply perp_in_sym.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Perp_at Tn P O P A B *)
(* Goal: @Perp_at Tn Q O Q C D *)
      assert(Perp_at P A B X O).
(* Goal: @Perp_at Tn P A B X O *)
(* Goal: @Perp_at Tn P O P A B *)
(* Goal: @Perp_at Tn Q O Q C D *)
        apply(perp_in_col_perp_in A B X Y O P H11).
(* Goal: @Col Tn X Y' Y *)
          Col.
(* Goal: @Perp_at Tn P A P P C *)
        apply perp_in_sym.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Perp_at Tn Q O Q C D *)
      apply perp_in_right_comm in H12.
(* Goal: @Perp_at Tn P O P A B *)
(* Goal: @Perp_at Tn Q O Q C D *)
      eapply (perp_in_col_perp_in _ _ _ _ P) in H12 .
(* Goal: @Perp_at Tn P A P P C *)
        apply perp_in_sym.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
        subst P.
(* Goal: False *)
(* Goal: @Col Tn O X P *)
(* Goal: @Perp_at Tn Q O Q C D *)
        apply H.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
(* Goal: @Perp_at Tn Q O Q C D *)
    induction(eq_dec_points X O).
(* Goal: @Perp_at Tn Q O Q C D *)
(* Goal: @Perp_at Tn Q O Q C D *)
      subst X.
(* Goal: @Perp_at Tn P A P P C *)
      apply perp_in_sym.
(* Goal: @Perp_at Tn Q C D O Q *)
(* Goal: @Perp_at Tn Q O Q C D *)
      apply(perp_in_col_perp_in C D O Y Q Q).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
        intro.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
        subst Q.
(* Goal: False *)
(* Goal: @Col Tn O X Q *)
        apply H0.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: @Perp_at Tn P A P P C *)
      apply perp_in_sym.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Perp_at Tn Q O Q C D *)
    assert(Perp_at Q C D X O).
(* Goal: @Perp_at Tn Q C D X O *)
(* Goal: @Perp_at Tn Q O Q C D *)
      apply(perp_in_col_perp_in C D X Y O Q H11).
(* Goal: @Col Tn X Y' Y *)
        Col.
(* Goal: @Perp_at Tn P A P P C *)
      apply perp_in_sym.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Perp_at Tn Q O Q C D *)
    apply perp_in_right_comm in H12.
(* Goal: @Perp_at Tn Q O Q C D *)
    eapply (perp_in_col_perp_in _ _ _ _ Q) in H12 .
(* Goal: @Perp_at Tn P A P P C *)
      apply perp_in_sym.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      subst Q.
(* Goal: False *)
(* Goal: @Col Tn O X Q *)
      apply H0.
(* Goal: @Col Tn X Y' Y *)
      Col.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
    ColR.
Qed.


Lemma l13_8 : forall O P Q U V, U <> O -> V <> O -> Col O P Q -> Col O U V
    -> Per P U O -> Per Q V O -> (Out O P Q <-> Out O U V).
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
    induction(eq_dec_points P U).
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      subst P.
(* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
      assert(Col Q V O).
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        ColR.
(* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
      assert(HH:= l8_9 Q V O H4 H5).
(* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
      induction HH.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
        subst Q.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
        tauto.
(* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
      subst V.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
      tauto.
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
    assert(Q <> V).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
      intro.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
      subst Q.
(* Goal: False *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
      assert(HH:= per_not_col P U O H5 H H3).
(* Goal: False *)
(* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *)
      apply HH.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Out Tn O P Q *)
unfold Out in H7.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H9.

(* Goal: @Out Tn O U V *)
(* Goal: @Out Tn O U V *)
(* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *)
assert(HH:= per23_preserves_bet O P Q U V).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(per23_preserves_bet O P Q U V); auto.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
right.
(* Goal: @Col Tn X Y' Y *)
apply(per23_preserves_bet O Q P V U); Col.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: @Perp Tn C D X Y *)
Perp.

(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: @Out Tn O P Q *)
unfold Out in H7.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Out Tn O P Q *)
repeat split.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst P.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) Q O) *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
apply l8_8 in H3.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
subst Q.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
apply l8_8 in H4.
(* Goal: False *)
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
contradiction.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
induction H9.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Perp Tn C D X Y *)
apply(per23_preserves_bet_inv O P Q U V); Perp.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
right.
(* Goal: @Perp Tn C D X Y *)
apply(per23_preserves_bet_inv O Q P V U); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
Qed.

Lemma perp_in_rewrite : forall A B C D P, Perp_at P A B C D ->
                                          Perp_at P A P P C \/
                                          Perp_at P A P P D \/
                                          Perp_at P B P P C \/
                                          Perp_at P B P P D.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
assert(HH:= perp_in_col A B C D P H).
(* Goal: @Col Tn X Y' Y *)
spliter.
induction(eq_dec_points A P);
induction(eq_dec_points C P).
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
subst A .
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *)
right;right;right.
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
subst A.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
right; right; left.
(* Goal: @Perp_at Tn P B P P C *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
apply perp_in_right_comm.
(* Goal: @Perp_at Tn P B P C P *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
assert(HP:=perp_in_col_perp_in P B C D P P H3 H1 H).
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
right; left.
(* Goal: @Perp_at Tn P A P P C *)
apply perp_in_sym.
(* Goal: @Perp_at Tn P P D A P *)
(* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *)
apply(perp_in_col_perp_in P D A B P P H2 H0).
(* Goal: @Perp Tn C D X Y *)
Perp.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Perp_at Tn P A P P C *)
assert(HP:= perp_in_col_perp_in A B C D P P H3 H1 H).
(* Goal: @Perp_at Tn P A P P C *)
apply perp_in_sym.
(* Goal: @Perp_at Tn P P C A P *)
apply perp_in_left_comm.
(* Goal: @Perp_at Tn P C P A P *)
apply(perp_in_col_perp_in C P A B P P H2 H0).
(* Goal: @Perp Tn C D X Y *)
Perp.
Qed.

Lemma gta_to_lta : forall A B C D E F, GtA A B C D E F -> LtA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LtA Tn A B C D E F), @GtA Tn D E F A B C *)
unfold GtA.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
Qed.

Lemma lta_to_gta : forall A B C D E F, LtA A B C D E F -> GtA D E F A B C.
Proof.
(* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LtA Tn A B C D E F), @GtA Tn D E F A B C *)
unfold GtA.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
Qed.

Lemma perp_out_acute : forall A B C C', Out B A C' -> Perp A B C C' -> Acute A B C.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Acute Tn A B C *)
assert(A <> B /\ C' <> B).
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C' B)) *)
(* Goal: @Acute Tn A B C *)
apply out_distinct.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Acute Tn A B C *)
assert(Perp B C' C C').
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ A); Perp.
(* Goal: @Col Tn B A C' *)
(* Goal: @Acute Tn A B C *)
apply out_col in H.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Acute Tn A B C *)
assert(Per C C' B).
(* Goal: @Per Tn C C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_per.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_sym in H3.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_left_comm in H3.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_perp_in in H3.
(* Goal: @Perp_at Tn C' C C' C' B *)
(* Goal: @Acute Tn A B C *)
apply perp_in_comm.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Acute Tn A B C *)
assert(Acute C' C B /\ Acute C' B C).
(* Goal: and (@Acute Tn C' C B) (@Acute Tn C' B C) *)
(* Goal: @Acute Tn A B C *)
apply( l11_43 C' C B).

(* Goal: not (@eq (@Tpoint Tn) C' C) *)
(* Goal: not (@eq (@Tpoint Tn) C' B) *)
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
assert_diffs.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
auto.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *)
(* Goal: @Acute Tn A B C *)
left.
(* Goal: @Acute Tn C' B C *)
assumption.
(* Goal: @Col Tn X Y' Y *)
spliter.

(* Goal: @Acute Tn A B C *)
assert(C <> B).
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
apply l8_8 in H4.
(* Goal: False *)
(* Goal: @Acute Tn A B C *)
subst C'.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
apply perp_distinct in H0.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.

(* Goal: @Acute Tn A B C *)
assert(CongA C' B C A B C ).
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply(out_conga A B C A B C C' C A C); auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply conga_refl; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply out_trivial; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply (acute_conga__acute C' B C); auto.
Qed.

Lemma flat_all_lea : forall A B C, A <> B -> C <> B -> Bet A B C -> forall P, P <> B -> LeA A B P A B C.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @LeA Tn A B P A B C *)
unfold LeA.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
exists P.
(* Goal: @Col Tn X Y' Y *)
spliter.
(* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *)
split.
(* Goal: @InAngle Tn P A B C *)
(* Goal: @CongA Tn A B P A B P *)
unfold InAngle.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
repeat split; auto.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *)
(* Goal: @CongA Tn A B P A B P *)
exists B.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
split; auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply conga_refl; auto.
Qed.

Lemma perp_bet_obtuse : forall A B C C', B <> C' -> Perp A B C C' -> Bet A B C' -> Obtuse A B C.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
intros.
(* Goal: @Obtuse Tn A B C *)
assert(HPO:=perp_out_acute).
(* Goal: @Obtuse Tn A B C *)
assert(HBO:=acute_bet__obtuse).
(* Goal: @Obtuse Tn A B C *)
assert(Col A B C').
(* Goal: @Col Tn A B C' *)
(* Goal: @Obtuse Tn A B C *)
apply bet_col in H1.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Obtuse Tn A B C *)
assert(Acute C' B C).
(* Goal: @Acute Tn C' B C *)
(* Goal: @Obtuse Tn A B C *)
apply (HPO _ _ _ C').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
apply out_trivial; auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
apply perp_left_comm.
(* Goal: @Perp Tn C D X Y *)
apply(perp_col _ A); Perp.
(* Goal: @Col Tn X Y' Y *)
Col.
(* Goal: @Obtuse Tn A B C *)
apply (HBO C').
(* Goal: @Bet Tn C' B A *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
Between.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Acute Tn C' B C *)
intro.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
subst B.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
apply perp_distinct in H0.
(* Goal: False *)
(* Goal: @Acute Tn C' B C *)
tauto.
(* Goal: @Acute Tn C' B C *)
assumption.
Qed.

End L13_1.

Section L13_1_2D.

Context `{T2D:Tarski_2D}.

Lemma perp_in2__col : forall A B A' B' X Y P, Perp_at P A B X Y -> Perp_at P A' B' X Y  ->
  Col A B A'.
Proof.
(* Goal: forall (A B A' B' X Y P : @Tpoint Tn) (_ : @Perp_at Tn P A B X Y) (_ : @Perp_at Tn P A' B' X Y), @Col Tn A B A' *)
intros A B A' B' X Y P.
(* Goal: forall (_ : @Perp_at Tn P A B X Y) (_ : @Perp_at Tn P A' B' X Y), @Col Tn A B A' *)
apply cop4_perp_in2__col; apply all_coplanar.
Qed.

Lemma perp2_trans : forall A B C D E F P, Perp2 A B C D P -> Perp2 C D E F P -> Perp2 A B E F P.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Perp2 Tn A B E F P *)
    unfold Perp2 in *.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    ex_and H1 Y.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    ex_and H0 X'.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    ex_and H3 Y'.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    assert(Par X Y X' Y').
(* Goal: @Perp Tn C D X Y *)
      apply (l12_9_2D _ _ _ _ C D); Perp.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)))) *)
    exists X.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *)
    exists Y.
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
    assert(Col X X' Y').
(* Goal: @Col Tn X Y' Y *)
      induction H5.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        unfold Par_strict in H5.
(* Goal: @Col Tn X Y' Y *)
        spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
        apply H8.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
    assert(Col Y X' Y').
(* Goal: @Col Tn X Y' Y *)
      induction H5.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        unfold Par_strict in H5.
(* Goal: @Col Tn X Y' Y *)
        spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
        apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn Y X' Y' *)
(* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *)
        apply H9.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
        exists P.
(* Goal: @Col Tn X Y' Y *)
        split; Col.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
    repeat split; auto.
(* Goal: @Perp Tn X Y E F *)
    assert(X <> Y).
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Perp Tn X Y E F *)
      apply perp_not_eq_1 in H1.
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Perp Tn X Y E F *)
      assert(X' <> Y').
(* Goal: not (@eq (@Tpoint Tn) X' Y') *)
(* Goal: not (@eq (@Tpoint Tn) X Y) *)
(* Goal: @Perp Tn X Y E F *)
        apply perp_not_eq_1 in H3.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Perp Tn X Y E F *)
    induction(eq_dec_points X Y').
(* Goal: @Perp Tn X Y E F *)
(* Goal: @Perp Tn X Y E F *)
      subst Y'.
(* Goal: @Perp Tn Y' X E F *)
(* Goal: @Col Tn X Y' Y *)
      apply (perp_col _ X').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Perp Tn C D X Y *)
        Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
(* Goal: @Perp Tn X Y E F *)
    apply (perp_col _ Y').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      auto.
(* Goal: @Perp Tn X Y' E F *)
(* Goal: @Col Tn X Y' Y *)
      apply perp_left_comm.
(* Goal: @Perp Tn Y' X E F *)
(* Goal: @Col Tn X Y' Y *)
      apply(perp_col _ X').
(* Goal: not (@eq (@Tpoint Tn) Y' X) *)
(* Goal: @Perp Tn Y' X' E F *)
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
        auto.
(* Goal: @Perp Tn C D X Y *)
        Perp.
(* Goal: @Col Tn Y' X' X *)
(* Goal: @Col Tn X Y' Y *)
      ColR.
(* Goal: @Col Tn X Y' Y *)
    apply par_symmetry in H5.
(* Goal: @Col Tn X Y' Y *)
    induction H5.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
      unfold Par_strict in H5.
(* Goal: @Col Tn X Y' Y *)
      spliter.
(* Goal: @Col Tn X Y' Y *)
(* Goal: @Col Tn X Y' Y *)
      apply False_ind.
(* Goal: False *)
(* Goal: @Col Tn X Y' Y *)
      apply H12.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *)
(* Goal: @Col Tn X Y' Y *)
      exists P.
(* Goal: @Col Tn X Y' Y *)
      split; Col.
(* Goal: @Col Tn X Y' Y *)
    spliter.
(* Goal: @Col Tn X Y' Y *)
    Col.
Qed.

Lemma perp2_par : forall A B C D O, Perp2 A B C D O -> Par A B C D.
Proof.
(* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *)
    intros.
(* Goal: @Par Tn A B C D *)
    unfold Perp2 in H.
(* Goal: @Par Tn A B C D *)
    ex_and H X.
(* Goal: @Par Tn A B C D *)
    ex_and H0 Y.
(* Goal: @Par Tn A B C D *)
    apply (l12_9_2D _ _ _ _ X Y).
(* Goal: @Perp Tn C D X Y *)
      Perp.
(* Goal: @Perp Tn C D X Y *)
    Perp.
Qed.

End L13_1_2D.