Require Import Description.
Require Import Ring.
Require Import Field.
Require Import Nsatz.
Require Import Rtauto.
Require Import GeoCoq.Tarski_dev.Annexes.midpoint_theorems.
Require Export GeoCoq.Tarski_dev.Ch16_coordinates.
Require Import GeoCoq.Tarski_dev.Ch15_pyth_rel.

Ltac cnf2 f :=
  match f with
   | ?A \/ (?B /\ ?C) =>
     let c1 := cnf2 (A\/B) in
     let c2 := cnf2 (A\/C) in constr:(c1/\c2)
   | (?B /\ ?C) \/ ?A =>
     let c1 := cnf2 (B\/A) in
     let c2 := cnf2 (C\/A) in constr:(c1/\c2)
   | (?A \/ ?B) \/ ?C =>
     let c1 := cnf2 (B\/C) in cnf2 (A \/ c1)
   | _ => f
  end
with cnf f :=
  match f with
   | ?A \/ ?B =>
     let c1 := cnf A in
       let c2 := cnf B in
         cnf2 (c1 \/ c2)
   | ?A /\ ?B =>
     let c1 := cnf A in
       let c2 := cnf B in
         constr:(c1 /\ c2)
   | _ => f
  end.

Ltac scnf :=
  match goal with
    | |- ?f => let c := cnf f in
      assert c; [repeat split|]
  end.

Section T17.

Context `{T2D:Tarski_2D}.
Context `{TE:@Tarski_euclidean Tn TnEQD}.

Definition O := PA.
Definition E := PB.
Definition E' := PC.

Lemma ncolOEE' : ~ Col O E E'.
Proof.
(* Goal: not (@Col Tn O E E') *)
exact lower_dim.
Qed.

Lemma sum_col: forall A B C, Sum O E E' A B C -> Col O E C.
Proof. intros; unfold Sum, Ar2 in *; spliter; Col. Qed.

Lemma sum_f : forall A B, Col O E A -> Col O E B -> {C | Sum O E E' A B C}.
Proof.
(* Goal: forall P : @Tpoint Tn, @sig (prod (@Tpoint Tn) (@Tpoint Tn)) (fun C : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) C) (@snd (@Tpoint Tn) (@Tpoint Tn) C)) *)
intros; apply constructive_definite_description; rewrite <- unique_existence.
(* Goal: and (@ex (@Tpoint Tn) (fun x : @Tpoint Tn => @Sum Tn O E E' A B x)) (@uniqueness (@Tpoint Tn) (@Sum Tn O E E' A B)) *)
split; [apply sum_exists; auto|unfold uniqueness; apply sum_uniqueness].
(* Goal: not (@Col Tn O E E') *)
apply ncolOEE'.
Qed.

Lemma prod_col: forall A B C, Prod O E E' A B C -> Col O E C.
Proof.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
 intros;  unfold Prod, Ar2 in *; spliter; Col.
Qed.

Lemma prod_f : forall A B, Col O E A -> Col O E B -> {C | Prod O E E' A B C}.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: @sig (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *)
apply constructive_definite_description; rewrite <- unique_existence.
(* Goal: and (@ex (@Tpoint Tn) (fun x : @Tpoint Tn => @Prod Tn O E E' A B x)) (@uniqueness (@Tpoint Tn) (@Prod Tn O E E' A B)) *)
split; [apply prod_exists; auto|unfold uniqueness; apply prod_uniqueness].
(* Goal: not (@Col Tn O E E') *)
apply ncolOEE'.
Qed.

Lemma diff_col: forall A B C, Diff O E E' A B C -> Col O E C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Diff Tn O E E' A B C), @Col Tn O E C *)
intros A B C H; destruct H as [MB HMB]; spliter; apply sum_col with A MB; auto.
Qed.

Lemma diff_f : forall A B, Col O E A -> Col O E B -> {C | Diff O E E' A B C}.
Proof.
(* Goal: forall P : @Tpoint Tn, @sig (prod (@Tpoint Tn) (@Tpoint Tn)) (fun C : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) C) (@snd (@Tpoint Tn) (@Tpoint Tn) C)) *)
intros; apply constructive_definite_description; rewrite <- unique_existence.
(* Goal: and (@ex (@Tpoint Tn) (fun x : @Tpoint Tn => @Diff Tn O E E' A B x)) (@uniqueness (@Tpoint Tn) (@Diff Tn O E E' A B)) *)
split; [apply diff_exists; auto|unfold uniqueness; apply diff_uniqueness].
(* Goal: not (@Col Tn O E E') *)
apply ncolOEE'.
Qed.

Lemma opp_col : forall A B, Opp O E E' A B -> Col O E B.
Proof.
(* Goal: forall (A B : @Tpoint Tn) (_ : @Opp Tn O E E' A B), @Col Tn O E B *)
intros; unfold Opp, Sum, Ar2 in *; spliter; Col.
Qed.

Lemma opp_f : forall A, Col O E A -> {B | Opp O E E' A B}.
Proof.
(* Goal: forall P : @Tpoint Tn, @sig (prod (@Tpoint Tn) (@Tpoint Tn)) (fun C : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) C) (@snd (@Tpoint Tn) (@Tpoint Tn) C)) *)
intros; apply constructive_definite_description; rewrite <- unique_existence.
(* Goal: and (@ex (@Tpoint Tn) (fun x : @Tpoint Tn => @Opp Tn O E E' A x)) (@uniqueness (@Tpoint Tn) (@Opp Tn O E E' A)) *)
split; [apply opp_exists|unfold uniqueness; apply opp_uniqueness]; auto.
(* Goal: not (@Col Tn O E E') *)
apply ncolOEE'.
(* Goal: not (@Col Tn O E E') *)
apply ncolOEE'.
Qed.

Lemma opp_pythrel : forall O E E' A B C C' , Opp O E E' C C' -> PythRel O E E' A B C -> PythRel O E E' A B C'.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.

(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
unfold PythRel in *.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
unfold Ar2 in *.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: and (@Perp Tn O0 B' O0 B) (and (@Cong Tn O0 B' O0 B) (@Cong Tn O0 C' A B')) *)
repeat split; auto.
(* Goal: @Col Tn O0 E0 C' *)
(* Goal: or (and (@eq (@Tpoint Tn) O0 B) (or (@eq (@Tpoint Tn) A C') (@Opp Tn O0 E0 E'0 A C'))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O0 B' O0 B) (and (@Cong Tn O0 B' O0 B) (@Cong Tn O0 C' A B')))) *)
unfold Opp in H.
(* Goal: @Col Tn O0 E0 C' *)
(* Goal: or (and (@eq (@Tpoint Tn) O0 B) (or (@eq (@Tpoint Tn) A C') (@Opp Tn O0 E0 E'0 A C'))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O0 B' O0 B) (and (@Cong Tn O0 B' O0 B) (@Cong Tn O0 C' A B')))) *)
unfold Sum in H.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: and (@eq (@Tpoint Tn) A O0) (@eq (@Tpoint Tn) B O0) *)
unfold Ar2 in H.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.

(* Goal: or (and (@eq (@Tpoint Tn) O0 B) (or (@eq (@Tpoint Tn) A C') (@Opp Tn O0 E0 E'0 A C'))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O0 B' O0 B) (and (@Cong Tn O0 B' O0 B) (@Cong Tn O0 C' A B')))) *)
unfold Ar2 in H0.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.

(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
induction H1.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
left.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: False *)
(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
induction H5.
(* Goal: @eq (@Tpoint Tn) x O *)
subst A.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
auto.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
right; auto.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
auto.
(* Goal: @eq (@Tpoint Tn) x O *)
subst B.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
left.

(* Goal: @eq (@Tpoint Tn) A C' *)
(* Goal: or (and (@eq (@Tpoint Tn) O0 B) (or (@eq (@Tpoint Tn) A C') (@Opp Tn O0 E0 E'0 A C'))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O0 B' O0 B) (and (@Cong Tn O0 B' O0 B) (@Cong Tn O0 C' A B')))) *)
unfold Opp in *.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply(sum_uniquenessA O0 E0 E'0 H0 C A C' O0); auto.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply sum_comm; auto.

(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
ex_and H1 B'.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
right.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O0 B' O0 B) (and (@Cong Tn O0 B' O0 B) (@Cong Tn O0 C' A B'))) *)
exists B'.
(* Goal: and (@Perp Tn O0 B' O0 B) (and (@Cong Tn O0 B' O0 B) (@Cong Tn O0 C' A B')) *)
repeat split; auto.

(* Goal: @Cong Tn O0 C' A B' *)
apply opp_midpoint in H.
(* Goal: @Cong Tn O0 C' A B' *)
unfold Midpoint in H.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @Cong Tn O0 C' A B' *)
apply cong_transitivity with O0 C; Cong.
Qed.

Lemma pythrel_null : forall O E E' A B, PythRel O E E' A B O -> A = O /\ B = O.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: @eq (@Tpoint Tn) C O0 *)
unfold PythRel in H.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) C O0 *)
induction H0.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
induction H1.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split; auto.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply opp_midpoint in H1.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
unfold Midpoint in H1.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply cong_identity in H2.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split; auto.

(* Goal: @eq (@Tpoint Tn) C O0 *)
ex_and H0 B'.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply cong_symmetry in H2.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply cong_identity in H2.
(* Goal: and (@eq (@Tpoint Tn) A O0) (@eq (@Tpoint Tn) B O0) *)
subst B'.
(* Goal: and (@eq (@Tpoint Tn) A O0) (@eq (@Tpoint Tn) B O0) *)
unfold Ar2 in H.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: and (@eq (@Tpoint Tn) A O0) (@eq (@Tpoint Tn) B O0) *)
apply perp_right_comm in H0.
(* Goal: and (@eq (@Tpoint Tn) A O0) (@eq (@Tpoint Tn) B O0) *)
apply perp_not_col in H0.
(* Goal: and (@eq (@Tpoint Tn) A O0) (@eq (@Tpoint Tn) B O0) *)
apply False_ind.
(* Goal: False *)
apply H0.
(* Goal: @Col Tn O0 A B *)
assert(O0 <> E0).
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: False *)
(* Goal: @Col Tn O0 A B *)
subst E0.
(* Goal: False *)
(* Goal: @Col Tn O0 A B *)
apply H; Col.
(* Goal: @Col Tn O0 A B *)
ColR.
Qed.

Lemma pythrel_not_null : forall O E E' A B C, C <> O -> PythRel O E E' A B C -> A <> O \/ B <> O.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
unfold PythRel in H0.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
unfold Ar2 in H0; spliter.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
induction H1.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
left.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: @eq (@Tpoint Tn) x O *)
subst A.
(* Goal: False *)
(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
induction H5.
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
subst C.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.
(* Goal: @eq (@Tpoint Tn) x O *)
subst B.
(* Goal: False *)
(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
apply opp_midpoint in H5.
(* Goal: False *)
(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
unfold Midpoint in H5.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: False *)
(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
apply cong_symmetry in H5.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) E O) *)
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply cong_identity in H5.
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
subst C.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.
(* Goal: or (not (@eq (@Tpoint Tn) A O0)) (not (@eq (@Tpoint Tn) B O0)) *)
ex_and H1 B'.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
right.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: @eq (@Tpoint Tn) x O *)
subst B.
(* Goal: False *)
apply perp_distinct in H1.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.
Qed.

Lemma pythrelOO : forall O E E' C, PythRel O E E' O O C -> C = O.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: @eq (@Tpoint Tn) C O0 *)
unfold PythRel in H.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) C O0 *)
induction H0.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
induction H1.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
auto.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply opp_midpoint in H1.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
unfold Midpoint in H1.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply cong_symmetry in H2.
(* Goal: @eq (@Tpoint Tn) C O0 *)
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply cong_identity in H2.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
auto.
(* Goal: @eq (@Tpoint Tn) C O0 *)
ex_and H0 B'.
(* Goal: @eq (@Tpoint Tn) C O0 *)
apply perp_distinct in H0.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.
Qed.

Lemma Pyth_f : forall A B, Col O E A -> Col O E B -> {C | PythRel O E E' A B C /\ (Ps O E C \/ C = O)}.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: forall P : @Tpoint Tn, @sig (prod (@Tpoint Tn) (@Tpoint Tn)) (fun C : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) C) (@snd (@Tpoint Tn) (@Tpoint Tn) C)) *)
intros; apply constructive_definite_description; rewrite <- unique_existence.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
assert(HE := PythRel_exists O E E' ncolOEE' A B H H0).
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
ex_and HE C.

(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B2 (@prod_col Tn B B B2 HB2))) P HP))) *)
assert(HC:Col O E C).
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
unfold PythRel in *.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @Col Tn O E C *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
unfold Ar2 in H1.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.

(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
induction(out_dec O E C).
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
exists C.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split; auto.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
left.
(* Goal: @Ps Tn (@O Tn) (@E Tn) (@E Tn) *)
unfold Ps.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply l6_6; auto.

(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
induction(eq_dec_points C O).
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
subst C.
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
exists O.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
auto.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
right;auto.

(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
assert(HH:= opp_exists O E E' ncolOEE' C HC).
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
ex_and HH C'.
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
exists C'.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.

(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply (opp_pythrel _ _ _ _ _ C); auto.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
left.
(* Goal: @Ps Tn (@O Tn) (@E Tn) (@E Tn) *)
unfold Ps.
(* Goal: @Out Tn O C' E *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply opp_midpoint in H4.
(* Goal: @Out Tn O C' E *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
unfold Midpoint in H4.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @Out Tn (@O Tn) (@E Tn) (@E Tn) *)
unfold Out.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
repeat split.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.

(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) E O) *)
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
subst C'.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) E O) *)
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply cong_identity in H5.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) E O) *)
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
contradiction.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: False *)
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
rewrite H6 in *.
(* Goal: False *)
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply H1;Col.
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply not_out_bet in H2.
(* Goal: or (@Bet Tn O C' E) (@Bet Tn O E C') *)
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply(l5_2 C O C' E H3 H4); bet.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
Col.
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
unfold uniqueness.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.

(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply (PythRel_uniqueness O E E' A B); auto.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
induction H4; induction H3.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
left.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split; auto.

(* Goal: @eq (@Tpoint Tn) x O *)
subst y.
(* Goal: @eq (@Tpoint Tn) x O *)
apply pythrel_null in H2.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) x O *)
subst A.
(* Goal: @eq (@Tpoint Tn) x O *)
subst B.

(* Goal: @eq (@Tpoint Tn) x O *)
assert(HH:= pythrelOO O E E' x H1).
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
subst x.
(* Goal: or (and (@Ps Tn O E O) (@Ps Tn O E O)) (@eq (@Tpoint Tn) O O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
unfold Ps in H4.
(* Goal: or (and (@Ps Tn O E O) (@Ps Tn O E O)) (@eq (@Tpoint Tn) O O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
unfold Out in H4.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
subst x.
(* Goal: or (and (@Ps Tn O E O) (@Ps Tn O E y)) (@eq (@Tpoint Tn) O O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
apply pythrel_null in H1.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) x O *)
subst A.
(* Goal: @eq (@Tpoint Tn) x O *)
subst B.
(* Goal: or (and (@Ps Tn O E O) (@Ps Tn O E y)) (@eq (@Tpoint Tn) O O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
assert(HH:= pythrelOO O E E' y H2).
(* Goal: @eq (@Tpoint Tn) x O *)
subst y.
(* Goal: or (and (@Ps Tn O E O) (@Ps Tn O E O)) (@eq (@Tpoint Tn) O O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
unfold Ps in H3.
(* Goal: or (and (@Ps Tn O E O) (@Ps Tn O E O)) (@eq (@Tpoint Tn) O O) *)
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
unfold Out in H3.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
tauto.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
right.
(* Goal: @eq (@Tpoint Tn) x O *)
subst y.
(* Goal: @eq (@Tpoint Tn) x O *)
apply pythrel_null in H2.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: @eq (@Tpoint Tn) x O *)
subst A.
(* Goal: @eq (@Tpoint Tn) x O *)
subst B.
(* Goal: @eq (@Tpoint Tn) x O *)
assert(HH:= pythrelOO O E E' x H1).
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
assumption.
Qed.

(** One needs to define a predicate for which MA is uniquely defined. *)
Definition inv O E E' A MA :=
  (A <> O /\ Prod O E E' MA A E) \/ (A = O /\ MA = O).

Lemma inv_exists_with_notation : forall A,
  Col O E A -> exists B, inv O E E' A B.
Proof.
(* Goal: forall (A : @Tpoint Tn) (_ : @Col Tn O E A), @ex (@Tpoint Tn) (fun B : @Tpoint Tn => inv O E E' A B) *)
intros; induction (eq_dec_points A O); [subst; exists O; right; auto|].
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
destruct (inv_exists O E E' A) as [IA HIA]; try (exists IA; left); auto.
(* Goal: not (@Col Tn O E E') *)
apply ncolOEE'.
Qed.

Lemma inv_col : forall A B, inv O E E' A B -> Col O E B.
Proof.
intros A B H; elim (eq_dec_points A O); intro HNEq;
[induction H; spliter;[subst; intuition|treat_equalities; Col]|].
(* Goal: @Col Tn O E B *)
(* Goal: @Col Tn O E B *)
try (subst;Col).
(* Goal: @Col Tn O E B *)
elim H; clear H; intro H; [clear HNEq|spliter; subst; intuition].
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
destruct H as [IA [HNEq HIA]]; unfold Ar2 in *; spliter; Col.
Qed.

Lemma inv_uniqueness : forall A B1 B2,
  inv O E E' A B1 -> inv O E E' A B2 -> B1 = B2.
Proof.
intros A B1 B2 HB1 HB2; elim (eq_dec_points A O); intro HNEq;
[induction HB1; induction HB2; spliter; treat_equalities; intuition|].
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
subst;auto.
(* Goal: @eq (@Tpoint Tn) B1 B2 *)
elim HB1; clear HB1; intro HB1; [clear HNEq|spliter; subst; intuition].
(* Goal: @eq (@Tpoint Tn) B1 B2 *)
elim HB2; clear HB2; intro HB2; [|spliter; subst; intuition].
(* Goal: @eq (@Tpoint Tn) B1 B2 *)
destruct HB1 as [HNEq HB1]; destruct HB2 as [H HB2]; clear H.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
apply prod_uniquenessA with O E E' A E; assumption.
Qed.

Lemma inv_f : forall A, Col O E A -> {B | inv O E E' A B}.
Proof.
(* Goal: forall P : @Tpoint Tn, @sig (prod (@Tpoint Tn) (@Tpoint Tn)) (fun C : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) C) (@snd (@Tpoint Tn) (@Tpoint Tn) C)) *)
intros; apply constructive_definite_description; rewrite <- unique_existence.
split; [apply inv_exists_with_notation|
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
        unfold uniqueness; apply inv_uniqueness]; auto.
Qed.

Definition div O E E' A B C :=
  exists IB : Tpoint, inv O E E' B IB /\ Prod O E E' A IB C.

Lemma div_exists : forall A B,
  Col O E A -> Col O E B -> exists C, div O E E' A B C.
Proof.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
intros A B HColA HColB; destruct (inv_exists_with_notation B) as [IB HIB]; auto.
destruct (prod_exists O E E' ncolOEE' A IB) as [C HC];
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
try (exists C; exists IB); Col.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
apply inv_col with B; assumption.
Qed.

Lemma div_uniqueness : forall A B C1 C2,
  div O E E' A B C1 -> div O E E' A B C2 -> C1 = C2.
Proof.
(* Goal: forall (A B C1 C2 : @Tpoint Tn) (_ : div O E E' A B C1) (_ : div O E E' A B C2), @eq (@Tpoint Tn) C1 C2 *)
intros A B C1 C2 HC1 HC2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
destruct HC1 as [IB [HIB HB1]]; destruct HC2 as [IB' [HIB' HC2]].
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
apply (inv_uniqueness B IB IB' HIB) in HIB'; treat_equalities.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
apply prod_uniqueness with O E E' A IB; assumption.
Qed.

Lemma div_col : forall A B C : Tpoint, div O E E' A B C -> Col O E C.
Proof.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
intros A B C H; destruct H as [IB [HIB HC]]; apply prod_col with A IB; auto.
Qed.

Lemma div_f : forall A B, Col O E A -> Col O E B -> {C | div O E E' A B C}.
Proof.
(* Goal: forall P : @Tpoint Tn, @sig (prod (@Tpoint Tn) (@Tpoint Tn)) (fun C : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) C) (@snd (@Tpoint Tn) (@Tpoint Tn) C)) *)
intros; apply constructive_definite_description; rewrite <- unique_existence.

(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split; [apply div_exists|unfold uniqueness; apply div_uniqueness]; auto.
Qed.

End T17.

Section T18.

Context `{T2D:Tarski_2D}.
Context `{TE:@Tarski_euclidean Tn TnEQD}.

Variable SS U1 U2 : Tpoint.
Variable orthonormal_grid : Cs O E SS U1 U2.

Definition F : Type := {P : Tpoint | Col O E P}.

Definition EqF (x y : F) := (proj1_sig x) = (proj1_sig y).

Instance eqF_Reflexive : Reflexive EqF.
Proof. unfold Reflexive, EqF; auto. Qed.

Instance eqF_Symmetric : Symmetric EqF.
Proof. unfold Symmetric, EqF; auto. Qed.

Instance eqF_Transitive : Transitive EqF.
Proof. unfold Transitive, EqF; intros x y z H; rewrite H; auto. Qed.

Global Instance eqF_Equivalence : Equivalence EqF.
Proof.
(* Goal: @Equivalence F EqF *)
exact (@Build_Equivalence F EqF eqF_Reflexive eqF_Symmetric eqF_Transitive).
(* For 8.4 remove @ *)
Qed.

Lemma eq_dec_F : forall A B, EqF A B \/ ~ EqF A B.
Proof.
(* Goal: forall A B : F, or (EqF A B) (not (EqF A B)) *)
intros; unfold EqF; simpl.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P0) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @Ps Tn (@O Tn) (@E Tn) P0 => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P0 (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP0))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P0) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @Ps Tn (@O Tn) (@E Tn) P0 => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P0 (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP0))) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P HP))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 HP0))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0 HP0))) P HP))) *)
destruct A as [A HA]; destruct B as [B HB]; simpl.
(* Goal: or (@eq (@Tpoint Tn) A B) (not (@eq (@Tpoint Tn) A B)) *)
exact (eq_dec_points A B).
Qed.

Lemma neg_and_eqF : forall A B C D,
  ~ (EqF A B /\ EqF C D) <-> ~ EqF A B \/ ~ EqF C D.
Proof.
intros A B C D; split; intro H;
induction (eq_dec_F A B); induction (eq_dec_F C D); intuition.
Qed.

Definition LeF (x y : F) := LeP O E E' (proj1_sig x) (proj1_sig y).

Instance leF_Antisymmetric : Antisymmetric F EqF LeF.
(* For 8.5 Instance leF_Antisymmetric : Antisymmetric eqF leF. *)
Proof. unfold Antisymmetric, LeF, EqF; intros x y; apply leP_asym. Qed.

Instance leF_Transitive : Transitive LeF.
Proof. unfold Transitive, LeF; intros x y z; apply leP_trans. Qed.

Lemma coordinates_of_point_f : forall P,
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {C | Cd O E SS U1 U2 P (fst C) (snd C)}.
Proof.
(* Goal: forall P : @Tpoint Tn, @sig (prod (@Tpoint Tn) (@Tpoint Tn)) (fun C : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) C) (@snd (@Tpoint Tn) (@Tpoint Tn) C)) *)
intros; apply constructive_definite_description; rewrite <- unique_existence.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: @ex (prod (@Tpoint Tn) (@Tpoint Tn)) (fun x : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) x) (@snd (@Tpoint Tn) (@Tpoint Tn) x)) *)
  destruct (coordinates_of_point O E SS U1 U2 P orthonormal_grid) as [X [Y H]].
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
  exists (X,Y); auto.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: @uniqueness (prod (@Tpoint Tn) (@Tpoint Tn)) (fun x : prod (@Tpoint Tn) (@Tpoint Tn) => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@fst (@Tpoint Tn) (@Tpoint Tn) x) (@snd (@Tpoint Tn) (@Tpoint Tn) x)) *)
  intros x y Hx Hy; destruct x as [Xx Xy]; destruct y as [Yx Yy]; simpl in *.
(* Goal: @eq (prod (@Tpoint Tn) (@Tpoint Tn)) (@pair (@Tpoint Tn) (@Tpoint Tn) Xx Xy) (@pair (@Tpoint Tn) (@Tpoint Tn) Yx Yy) *)
  assert (T:=eq_points_coordinates O E SS U1 U2 P Xx Xy P Yx Yy Hx Hy).
(* Goal: @eq (prod (@Tpoint Tn) (@Tpoint Tn)) (@pair (@Tpoint Tn) (@Tpoint Tn) Xx Xy) (@pair (@Tpoint Tn) (@Tpoint Tn) Yx Yy) *)
  assert (U: Xx = Yx /\ Xy = Yy) by intuition.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
  destruct U; subst; auto.
  }
Qed.

Lemma coordinates_of_point_F : forall P,
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {C: F*F | Cd O E SS U1 U2 P (proj1_sig (fst C)) (proj1_sig (snd C))}.
Proof.
(* Goal: forall P : @Tpoint Tn, @sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@snd F F C))) *)
intros; destruct (coordinates_of_point_f P) as [C HC].
(* Goal: @sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) *)
assert (T:=HC); apply Cd_Col in HC; destruct HC as [HCol1 HCol2].
exists (exist (fun P => Col O E P) (fst C) HCol1,
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
        exist (fun P => Col O E P) (snd C) HCol2); simpl; assumption.
Defined.

Definition OF : F.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
Proof. exists O; Col. Defined.

Definition OneF : F.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
Proof. exists E; Col. Defined.

Definition AddF (x y : F) : F.
Proof.
destruct (sum_f
                (proj1_sig x) (proj1_sig y)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r)) *)
                (proj2_sig x) (proj2_sig y)) as [P HP]; exists P.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
apply (sum_col (proj1_sig x) (proj1_sig y) P HP).
Defined.

Definition TwoF := AddF OneF OneF.

Global Instance addF_morphism : Proper (EqF ==> EqF ==> EqF) AddF.
Proof.
(* Goal: @Proper (forall (_ : F) (_ : F), F) (@respectful F (forall _ : F, F) EqF (@respectful F F EqF EqF)) AddF *)
unfold Proper, respectful, EqF, AddF; intros x y Hxy x' y' Hx'y'.
destruct x as [x Hx]; destruct x' as [x' Hx'];
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
destruct y as [y Hy]; destruct y' as [y' Hy']; simpl in *.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE x x' Hx Hx' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn x x' P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn y y' P HP))) *)
destruct (sum_f x x' Hx Hx').
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x0 (@sum_col Tn x x' x0 s))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn y y' P HP))) *)
destruct (sum_f y y' Hy Hy'); simpl.
(* Goal: @eq (@Tpoint Tn) x0 x1 *)
treat_equalities; eauto using sum_uniqueness.
Defined.

Lemma neq20 : ~ EqF (AddF OneF OneF) OF.
Proof.
(* Goal: not (EqF (AddF OneF OneF) OF) *)
unfold addition, add_notation, AddF, EqF; simpl.
destruct (sum_f E E (col_trivial_2 O E)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                (col_trivial_2 O E)) as [EPE HEPE]; simpl.
(* Goal: not (@eq (@Tpoint Tn) EPE (@O Tn)) *)
intro; treat_equalities.
subst;
 apply double_null_null in HEPE.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply ncolOEE';rewrite HEPE;Col.
Qed.

Definition MulF (x y : F) : F.
Proof.
destruct (prod_f
                 (proj1_sig x) (proj1_sig y)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r)) *)
                 (proj2_sig x) (proj2_sig y)) as [P HP]; exists P.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
apply (prod_col (proj1_sig x) (proj1_sig y) P HP).
Defined.

Global Instance mulF_morphism : Proper (EqF ==> EqF ==> EqF) MulF.
Proof.
(* Goal: @Proper (forall (_ : F) (_ : F), F) (@respectful F (forall _ : F, F) EqF (@respectful F F EqF EqF)) MulF *)
unfold Proper, respectful, EqF, MulF; intros x y Hxy x' y' Hx'y'.
destruct x as [x Hx]; destruct x' as [x' Hx'];
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
destruct y as [y Hy]; destruct y' as [y' Hy']; simpl in *.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE x x' Hx Hx' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn x x' P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn y y' P HP))) *)
destruct (prod_f x x' Hx Hx').
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x0 (@prod_col Tn x x' x0 p))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn y y' P HP))) *)
destruct (prod_f y y' Hy Hy'); simpl.
(* Goal: @eq (@Tpoint Tn) x0 x1 *)
treat_equalities; eauto using prod_uniqueness.
Defined.

Definition SubF (x y : F) : F.
Proof.
destruct (diff_f
                 (proj1_sig x) (proj1_sig y)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r)) *)
                 (proj2_sig x) (proj2_sig y)) as [P HP]; exists P.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
apply (diff_col (proj1_sig x) (proj1_sig y) P HP).
Defined.

Global Instance subF_morphism : Proper (EqF ==> EqF ==> EqF) SubF.
Proof.
(* Goal: @Proper (forall (_ : F) (_ : F), F) (@respectful F (forall _ : F, F) EqF (@respectful F F EqF EqF)) SubF *)
unfold Proper, respectful, EqF, SubF; intros x y Hxy x' y' Hx'y'.
destruct x as [x Hx]; destruct x' as [x' Hx'];
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
destruct y as [y Hy]; destruct y' as [y' Hy']; simpl in *.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @diff_f Tn TnEQD T2D TE x x' Hx Hx' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@diff_col Tn x x' P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @diff_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@diff_col Tn y y' P HP))) *)
destruct (diff_f x x' Hx Hx').
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x0 (@diff_col Tn x x' x0 d))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @diff_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@diff_col Tn y y' P HP))) *)
destruct (diff_f y y' Hy Hy'); simpl.
(* Goal: @eq (@Tpoint Tn) x0 x1 *)
treat_equalities; eauto using diff_uniqueness.
Defined.

Definition OppF (x : F) : F.
Proof.
(* Goal: F *)
destruct (opp_f (proj1_sig x) (proj2_sig x)) as [P HP].
(* Goal: F *)
exists P; apply (opp_col (proj1_sig x) P HP).
Defined.

Global Instance oppF_morphism : Proper (EqF ==> EqF) OppF.
Proof.
(* Goal: @Proper (forall _ : F, F) (@respectful F F EqF EqF) OppF *)
unfold Proper, respectful, EqF, OppF; intros x y Hxy.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) x) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) y) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) y) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) y) P HP))) *)
destruct x as [x Hx]; destruct y as [y Hy]; simpl in *.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @opp_f Tn TnEQD T2D TE x Hx in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@opp_col Tn x P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @opp_f Tn TnEQD T2D TE y Hy in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@opp_col Tn y P HP))) *)
destruct (opp_f x Hx).
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x0 (@opp_col Tn x x0 o))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @opp_f Tn TnEQD T2D TE y Hy in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@opp_col Tn y P HP))) *)
destruct (opp_f y Hy); simpl.
(* Goal: @eq (@Tpoint Tn) x0 x1 *)
rewrite Hxy in *.
(* Goal: @eq (@Tpoint Tn) x0 x1 *)
eauto using (opp_uniqueness O E E' ncolOEE').
Defined.

Definition InvF (x : F) : F.
Proof.
(* Goal: F *)
destruct (inv_f (proj1_sig x) (proj2_sig x)) as [P HP].
(* Goal: F *)
exists P; apply (inv_col (proj1_sig x) P HP).
Defined.

Global Instance invF_morphism : Proper (EqF ==> EqF) InvF.
Proof.
(* Goal: @Proper (forall _ : F, F) (@respectful F F EqF EqF) InvF *)
unfold Proper, respectful, EqF, InvF; intros x y Hxy.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) x) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) y) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) y) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) y) P HP))) *)
destruct x as [x Hx]; destruct y as [y Hy]; simpl in *.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE x Hx in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD x P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE y Hy in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD y P HP))) *)
destruct (inv_f x Hx).
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x0 (@inv_col Tn TnEQD x x0 i))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE y Hy in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD y P HP))) *)
destruct (inv_f y Hy); simpl.
(* Goal: @eq (@Tpoint Tn) x0 x1 *)
treat_equalities; eauto using inv_uniqueness.
Defined.

Definition DivF (x y : F) : F.
Proof.
destruct (div_f (proj1_sig x) (proj1_sig y)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r)) *)
                (proj2_sig x) (proj2_sig y)) as [P HP]; exists P.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
apply (div_col (proj1_sig x) (proj1_sig y) P HP).
Defined.

Global Instance divF_morphism : Proper (EqF ==> EqF ==> EqF) DivF.
Proof.
(* Goal: @Proper (forall (_ : F) (_ : F), F) (@respectful F (forall _ : F, F) EqF (@respectful F F EqF EqF)) DivF *)
unfold Proper, respectful, EqF, DivF; intros x y Hxy x' y' Hx'y'.
destruct x as [x Hx]; destruct x' as [x' Hx'];
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
destruct y as [y Hy]; destruct y' as [y' Hy']; simpl in *.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @div_f Tn TnEQD T2D TE x x' Hx Hx' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@div_col Tn x x' P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @div_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@div_col Tn y y' P HP))) *)
destruct (div_f x x' Hx Hx').
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x0 (@div_col Tn x x' x0 d))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @div_f Tn TnEQD T2D TE y y' Hy Hy' in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@div_col Tn y y' P HP))) *)
destruct (div_f y y' Hy Hy'); simpl.
(* Goal: @eq (@Tpoint Tn) x0 x1 *)
treat_equalities; eauto using div_uniqueness.
Defined.

Definition PythF (x y : F) : F.
Proof.
(* Goal: F *)
destruct (Pyth_f (proj1_sig x) (proj1_sig y) (proj2_sig x) (proj2_sig y)) as [P HP]; exists P.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
unfold PythRel in *.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
use HP.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
unfold Ar2 in *.
(* Goal: @Col Tn (@O Tn) (@E Tn) P *)
intuition idtac.
Defined.

(*
Global Instance pythF_morphism : Proper (EqF ==> EqF ==> EqF) PythF.
Proof.
unfold Proper, respectful, EqF.
intros x y Hxy x' y' Hx'y'.
destruct x as [x Hx]; destruct x' as [x' Hx'];
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
destruct y as [y Hy]; destruct y' as [y' Hy']; simpl in *.
*)

Lemma ringF : (ring_theory OF OneF AddF MulF SubF OppF EqF).
Proof.
split; unfold OF, OneF, AddF, MulF, SubF, OppF, EqF, sig_rect;
intro x; try intro y; try intro z.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; simpl.
  elim (sum_f O x (col_trivial_3 O E) Hx).
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  intros; simpl; apply sum_uniqueness with O E E' O x; try assumption.
  apply sum_O_B; auto using ncolOEE'.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; destruct y as [y Hy]; simpl.
  elim (sum_f x y Hx Hy).
  elim (sum_f y x Hy Hx).
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  intros; simpl; apply sum_uniqueness with O E E' x y; try assumption.
  apply sum_comm; auto using ncolOEE'.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; destruct y as [y Hy]; destruct z as [z Hz]; simpl.
  destruct (sum_f y z Hy Hz) as [yPz HyPz]; simpl.
  destruct (sum_f x yPz Hx
                  (sum_col y z yPz HyPz)) as [xPyPz HxPyPz].
  destruct (sum_f x y Hx Hy) as [xPy HxPy]; simpl.
  destruct (sum_f xPy z
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                  (sum_col x y xPy HxPy) Hz) as [xPyPz' HxPyPz']; simpl.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  apply sum_uniqueness with O E E' x yPz; try assumption.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  apply (sum_assoc O E E' x y z xPy yPz xPyPz'); assumption.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; simpl.
  destruct (prod_f E x (col_trivial_2 O E) Hx) as [x' Hx'].
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  simpl; apply prod_uniqueness with O E E' E x; try assumption.
  apply prod_1_l; auto using ncolOEE'.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; destruct y as [y Hy]; simpl.
  destruct (prod_f x y Hx Hy) as [xMy HxMy].
  destruct (prod_f y x Hy Hx) as [yMx HyMx]; simpl.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  apply prod_uniqueness with O E E' x y; try assumption.
  apply prod_comm; auto using ncolOEE'.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; destruct y as [y Hy]; destruct z as [z Hz]; simpl.
  destruct (prod_f y z Hy Hz) as [yMz HyMz]; simpl.
  destruct (prod_f x yMz Hx
                   (prod_col y z yMz HyMz)) as [xMyMz HxMyMz].
  destruct (prod_f x y Hx Hy) as [xMy HxMy]; simpl.
  destruct (prod_f xMy z
                   (prod_col x y xMy HxMy) Hz) as [xMyMz' HxMyMz'].
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  simpl; apply prod_uniqueness with O E E' x yMz; try assumption.

(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  apply (prod_assoc O E E' x y z xMy yMz xMyMz');assumption.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; destruct y as [y Hy]; destruct z as [z Hz]; simpl.
  destruct (sum_f x y Hx Hy) as [xPy HxPy]; simpl.
  destruct (prod_f xPy z
                   (sum_col x y xPy HxPy) Hz) as [xPyMz HxPyMz].
  destruct (prod_f x z Hx Hz) as [xMz HxMz]; simpl.
  destruct (prod_f y z Hy Hz) as [yMz HyMz]; simpl.
  destruct (sum_f xMz yMz (prod_col x z xMz HxMz)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                  (prod_col y z yMz HyMz)) as [xPyMz' HxPyMz']; simpl.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  apply sum_uniqueness with O E E' xMz yMz; try assumption.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  apply distr_r with x y z xPy; assumption.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; destruct y as [y Hy]; simpl.
  destruct (diff_f x y Hx Hy) as [xSy HxSy].
  destruct (opp_f y Hy) as [Oy HOy]; simpl.
  destruct (sum_f x Oy Hx
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                  (opp_col y Oy HOy)) as [xSy' HxSy']; simpl.
  destruct HxSy as [Oy' [HOy' HxSy]].
  assert (Oy = Oy') by
    ((apply opp_uniqueness with O E E' y);auto using ncolOEE').
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
     subst; apply sum_uniqueness with O E E' x Oy';assumption.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct x as [x Hx]; simpl.
  destruct (opp_f x Hx) as [Ox HOx]; simpl.
  destruct (sum_f x Ox Hx
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                  (opp_col x Ox HOx)) as [O' HO']; simpl.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  unfold Opp in HOx; apply sum_uniqueness with O E E' x Ox; try assumption.
  apply sum_comm; auto using ncolOEE'.
  }
Qed.

Lemma fieldF : field_theory OF OneF AddF MulF SubF OppF DivF InvF EqF.
Proof.
split; unfold OF, OneF, MulF, DivF, InvF, EqF, sig_rect; simpl;
[apply ringF|assert (T:=ncolOEE');assert_diffs; auto|intros p q|intros p Hp].

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct (div_f (proj1_sig p) (proj1_sig q)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                  (proj2_sig p) (proj2_sig q)) as [pDq HpDq]; simpl.
  destruct (inv_f
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                  (proj1_sig q)(proj2_sig q)) as [Iq HIq]; simpl.
  destruct (prod_f (proj1_sig p) Iq (proj2_sig p)
                   (inv_col (proj1_sig q) Iq HIq)) as [pDq' HpDq'].
(* Goal: @eq (@Tpoint Tn) pDq (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) pDq' (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) p) Iq pDq' HpDq'))) *)
  simpl; destruct HpDq as [Iq' [HIq' HpDq]].
  assert (Iq = Iq'); [apply inv_uniqueness with (proj1_sig q)|
                      subst; apply prod_uniqueness with O E E' (proj1_sig p) Iq'];
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  assumption.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) p) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) p) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) p) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) p) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @inv_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) p) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) p) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@inv_col Tn TnEQD (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) p) P HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) p) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @inv_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) p) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) p) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@inv_col Tn TnEQD (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) p) P0 HP0))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) p) P HP))) (@E Tn) *)
  destruct (inv_f (proj1_sig p) (proj2_sig p)) as [Ip HIp]; simpl.
  destruct (prod_f Ip (proj1_sig p)
                   (inv_col (proj1_sig p) Ip HIp) (proj2_sig p)) as [E'' HE''].
  simpl; elim HIp; clear HIp; intro HIp;
  [|spliter; treat_equalities; intuition].
(* Goal: @eq (@Tpoint Tn) E'' (@E Tn) *)
  destruct HIp as [H HIp]; clear H.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
  apply prod_uniqueness with O E E' Ip (proj1_sig p); assumption.
  }
Qed.

Add Ring GeometricRing : ringF.
Add Field GeometricField : fieldF.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
Global Instance Fops: (@Ring_ops F OF OneF AddF MulF SubF OppF EqF) := {}.

Global Instance FRing : (Ring (Ro:=Fops)).
Proof.
split; [exact eqF_Equivalence|exact addF_morphism|exact mulF_morphism|
        exact subF_morphism|exact oppF_morphism|exact (Radd_0_l ringF)|
        exact (Radd_comm ringF)|exact (Radd_assoc ringF)|exact (Rmul_1_l ringF)|
        |exact (Rmul_assoc ringF)|exact (Rdistr_l ringF)|
        |exact (Rsub_def ringF)|exact (Ropp_def ringF)].
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: forall x : F, @equality F (@eq_notation F OF OneF AddF MulF SubF OppF EqF Fops) (@multiplication F F (@mul_notation F OF OneF AddF MulF SubF OppF EqF Fops) x (@one F (@one_notation F OF OneF AddF MulF SubF OppF EqF Fops))) x *)
  intros; rewrite (Rmul_comm ringF); apply (Rmul_1_l ringF).
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: forall x y z : F, @equality F (@eq_notation F OF OneF AddF MulF SubF OppF EqF Fops) (@multiplication F F (@mul_notation F OF OneF AddF MulF SubF OppF EqF Fops) z (@addition F (@add_notation F OF OneF AddF MulF SubF OppF EqF Fops) x y)) (@addition F (@add_notation F OF OneF AddF MulF SubF OppF EqF Fops) (@multiplication F F (@mul_notation F OF OneF AddF MulF SubF OppF EqF Fops) z x) (@multiplication F F (@mul_notation F OF OneF AddF MulF SubF OppF EqF Fops) z y)) *)
  intros; rewrite (Rmul_comm ringF); rewrite (Rdistr_l ringF).
  rewrite (Rmul_comm ringF); rewrite (Radd_comm ringF);
  rewrite (Rmul_comm ringF); rewrite (Radd_comm ringF); reflexivity.
  }
Defined.

Global Instance Fcri: (Cring (Rr:=FRing)).
Proof. exact (Rmul_comm ringF). Defined.

Notation "0" := OF : FScope.
Notation "1" := OneF : FScope.
Notation "2" := TwoF : FScope.
Infix "+" := AddF : FScope.
Infix "*" := MulF : FScope.
Infix "-" := SubF : FScope.
Notation "- x" := (OppF x) : FScope.
Infix "/" := DivF : FScope.
Infix "<=" := LeF : FScope.

Infix "=F=" := EqF (at level 70) : FScope.

Open Scope FScope.

Lemma Fmult_integral : forall A B, A * B =F= 0 -> A =F= 0 \/ B =F= 0.
Proof.
(* Goal: forall (A B : F) (_ : EqF (MulF A B) OF), or (EqF A OF) (EqF B OF) *)
intros A B HAB; apply prod_null with E E'.
(* Goal: @Prod Tn (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) OF) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) OF) *)
destruct A as [x Hx]; destruct B as [y Hy]; simpl.
(* Goal: @Prod Tn (@O Tn) (@E Tn) (@E' Tn) x y (@O Tn) *)
red in HAB; unfold eq_notation, EqF, multiplication, mul_notation, MulF in HAB.
destruct (prod_f
             (proj1_sig (exist (fun P : Tpoint => Col O E P) x Hx))
             (proj1_sig (exist (fun P : Tpoint => Col O E P) y Hy))
             (proj2_sig (exist (fun P : Tpoint => Col O E P) x Hx))
             (proj2_sig (exist (fun P : Tpoint => Col O E P) y Hy))).
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
simpl in *; subst; assumption.
Qed.

Global Instance Fintegral : (Integral_domain (Rcr:=Fcri)).
Proof. split; [exact Fmult_integral|assert (T:=ncolOEE');assert_diffs; auto]. Defined.

Lemma PythFOk : forall A B, (PythF A B) * (PythF A B) =F= A*A + B*B.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (MulF (PythF A B) (PythF A B)) (AddF (MulF A A) (MulF B B)) *)
unfold PythF, MulF, AddF, EqF;simpl.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B)) (@Cong Tn (@O Tn) P (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P0) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @Ps Tn (@O Tn) (@E Tn) P0 => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P0 (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP0))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @Pyth_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0))) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A)) (H6 : and (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0)) => @and_ind (@Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Col Tn (@O Tn) (@E Tn) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H8 : @Col Tn (@O Tn) (@E Tn) P0) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @Ps Tn (@O Tn) (@E Tn) P0 => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P0 (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (H12 : or (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0)) => @or_ind (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (and (@Cong Tn (@O Tn) B' (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B)) (@Cong Tn (@O Tn) P0 (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) B'))) => H8) H2) H0) H6) H4) H1) H) HP0))) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) P HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) P HP))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) A) P0 HP0))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) (@proj2_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B) in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) (@proj1_sig (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) B) P0 HP0))) P HP))) *)
destruct A as [A HA];destruct B as [B HB];simpl.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE A B HA HB in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE A B HA HB in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE A B HA HB in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) H0) H6) H4) H1) H) HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @Pyth_f Tn TnEQD T2D TE A B HA HB in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) (@Col Tn (@O Tn) (@E Tn) P) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) P) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P) (@eq (@Tpoint Tn) P (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @Ps Tn (@O Tn) (@E Tn) P => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B')))) (@Col Tn (@O Tn) (@E Tn) P) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) (@Col Tn (@O Tn) (@E Tn) P) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P)) => @or_ind (@eq (@Tpoint Tn) A P) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P) (@Col Tn (@O Tn) (@E Tn) P) (fun _ : @eq (@Tpoint Tn) A P => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P A B'))) => H8) H2) H0) H6) H4) H1) H) HP))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @Pyth_f Tn TnEQD T2D TE A B HA HB in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) P0) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @Ps Tn (@O Tn) (@E Tn) P0 => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @or_ind (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) A P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P0 (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @or_ind (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) A P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))) => H8) H2) H0) H6) H4) H1) H) HP0))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @Pyth_f Tn TnEQD T2D TE A B HA HB in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B P0) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0))) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) P0) => @or_ind (@Ps Tn (@O Tn) (@E Tn) P0) (@eq (@Tpoint Tn) P0 (@O Tn)) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @Ps Tn (@O Tn) (@E Tn) P0 => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @or_ind (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) A P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) P0 (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B')))) (@Col Tn (@O Tn) (@E Tn) P0) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) (@Col Tn (@O Tn) (@E Tn) P0) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0)) => @or_ind (@eq (@Tpoint Tn) A P0) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0) (@Col Tn (@O Tn) (@E Tn) P0) (fun _ : @eq (@Tpoint Tn) A P0 => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A P0 => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) P0 A B'))) => H8) H2) H0) H6) H4) H1) H) HP0))) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE A A HA HA in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn A A P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE B B HB HB in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn B B P HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE A A HA HA in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn A A P HP))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE B B HB HB in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn B B P HP))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @prod_f Tn TnEQD T2D TE A A HA HA in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@prod_col Tn A A P0 HP0))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (let (P0, HP0) := @prod_f Tn TnEQD T2D TE B B HB HB in @exist (@Tpoint Tn) (fun P1 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P1) P0 (@prod_col Tn B B P0 HP0))) P HP))) *)
destruct (Pyth_f A B HA HB) as [C [HC1 HC2]].
destruct (prod_f A A HA HA) as [A2  HA2].
destruct (prod_f B B HB HB) as [B2  HB2].
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B2 (@prod_col Tn B B B2 HB2))) P HP))) *)
assert (HC : Col O E C).
(* Goal: @Col Tn (@O Tn) (@E Tn) C *)
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B2 (@prod_col Tn B B B2 HB2))) P HP))) *)
destruct HC2;[apply Ps_Col;auto|subst;Col].
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) C (@and_ind (and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H : and (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))))) (H0 : or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) => @and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H4 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H6 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H8 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H10 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H12 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H8) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H8) H12) H10) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H8) H2) H0) H6) H4) H1) H) (@conj (@PythRel Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn))) HC1 HC2)))) P HP))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @sum_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) A2 (@prod_col Tn A A A2 HA2))) (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) B2 (@prod_col Tn B B B2 HB2))) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@sum_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) A2 (@prod_col Tn A A A2 HA2))) (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) (@exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) B2 (@prod_col Tn B B B2 HB2))) P HP))) *)
destruct (sum_f A2 B2) as [x Hx].
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.
destruct (prod_f C C HC HC) as [C2  HC2'].
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE C C (@and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H3 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H5 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H7 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) HC2) H5) H3) H1) HC1) (@and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H3 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H5 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H7 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) HC2) H5) H3) H1) HC1) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn C C P HP))) x *)
assert (T:=PythOK O E E' A B C A2 B2 C2 HC1 HA2 HB2 HC2') .
(* Goal: @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE C C (@and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H3 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H5 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H7 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) HC2) H5) H3) H1) HC1) (@and_ind (@Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) (@Col Tn (@O Tn) (@E Tn) C) (fun (H1 : @Ar2 Tn (@O Tn) (@E Tn) (@E' Tn) A B C) (H2 : or (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))))) => @and_ind (not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : not (@Col Tn (@O Tn) (@E Tn) (@E' Tn))) (H3 : and (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C))) => @and_ind (@Col Tn (@O Tn) (@E Tn) A) (and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) A) (H5 : and (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C)) => @and_ind (@Col Tn (@O Tn) (@E Tn) B) (@Col Tn (@O Tn) (@E Tn) C) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @Col Tn (@O Tn) (@E Tn) B) (H7 : @Col Tn (@O Tn) (@E Tn) C) => @or_ind (@Ps Tn (@O Tn) (@E Tn) C) (@eq (@Tpoint Tn) C (@O Tn)) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @Ps Tn (@O Tn) (@E Tn) C => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) (fun _ : @eq (@Tpoint Tn) C (@O Tn) => @or_ind (and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B')))) (@Col Tn (@O Tn) (@E Tn) C) (fun H0 : and (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @and_ind (@eq (@Tpoint Tn) (@O Tn) B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) (@Col Tn (@O Tn) (@E Tn) C) (fun (_ : @eq (@Tpoint Tn) (@O Tn) B) (H10 : or (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C)) => @or_ind (@eq (@Tpoint Tn) A C) (@Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C) (@Col Tn (@O Tn) (@E Tn) C) (fun _ : @eq (@Tpoint Tn) A C => H7) (fun _ : @Opp Tn (@O Tn) (@E Tn) (@E' Tn) A C => H7) H10) H0) (fun _ : @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn (@O Tn) B' (@O Tn) B) (and (@Cong Tn (@O Tn) B' (@O Tn) B) (@Cong Tn (@O Tn) C A B'))) => H7) H2) HC2) H5) H3) H1) HC1) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn C C P HP))) x *)
assert (x= C2) by (apply (sum_uniqueness O E E' A2 B2);auto).
(* Goal: AM_Perp U V C D *)
(* Goal: AM_Perp U V C D *)
subst.
destruct (prod_f C C) as [C2'  HC2''].
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply (prod_uniqueness O E E' C C C2' C2);auto.
Qed.

Lemma subF__eq0 : forall x y:F, x - y =F= 0 <-> x =F= y.
Proof. intros; split; intro; nsatz. Qed.

Lemma mulF__eq0 : forall x y z t:F,
  (x - y) * (z - t) =F= 0 <-> x =F= y \/ z =F= t.
Proof.
(* Goal: forall x y z t : F, iff (EqF (MulF (SubF x y) (SubF z t)) OF) (or (EqF x y) (EqF z t)) *)
intros x y z t; split; intro H; [|destruct H; nsatz].
(* Goal: or (EqF x y) (EqF z t) *)
setoid_replace (x =F= y) with (x-y =F= 0); [|symmetry; apply subF__eq0].
(* Goal: or (EqF (SubF x y) OF) (EqF z t) *)
setoid_replace (z =F= t) with (z-t =F= 0); [|symmetry; apply subF__eq0].
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
apply Fmult_integral; assumption.
Qed.

Lemma neqO_mul_neqO : forall x y:F,  ~ x =F= 0 -> ~ y =F= 0 -> ~ x * y =F= 0.
Proof. intros x y Hx Hy Hxy; apply Fmult_integral in Hxy; intuition. Qed.

Lemma oppF_neq0 : forall f, ~ f =F= 0 <-> ~ - f =F= 0.
Proof. intro; split; intro HF; intro H; apply HF; clear HF; nsatz. Qed.

Lemma Ps_One : Ps O E E.
Proof.
(* Goal: @Ps Tn (@O Tn) (@E Tn) (@E Tn) *)
unfold Ps.
(* Goal: @Out Tn (@O Tn) (@E Tn) (@E Tn) *)
unfold Out.
(* Goal: and (not (@eq (@Tpoint Tn) (@E Tn) (@O Tn))) (and (not (@eq (@Tpoint Tn) (@E Tn) (@O Tn))) (or (@Bet Tn (@O Tn) (@E Tn) (@E Tn)) (@Bet Tn (@O Tn) (@E Tn) (@E Tn)))) *)
assert (T:=ncolOEE').
(* Goal: and (not (@eq (@Tpoint Tn) (@E Tn) (@O Tn))) (and (not (@eq (@Tpoint Tn) (@E Tn) (@O Tn))) (or (@Bet Tn (@O Tn) (@E Tn) (@E Tn)) (@Bet Tn (@O Tn) (@E Tn) (@E Tn)))) *)
assert_diffs.
(* Goal: and (not (@eq (@Tpoint Tn) (@E Tn) (@O Tn))) (and (not (@eq (@Tpoint Tn) (@E Tn) (@O Tn))) (or (@Bet Tn (@O Tn) (@E Tn) (@E Tn)) (@Bet Tn (@O Tn) (@E Tn) (@E Tn)))) *)
repeat split;Between.
Qed.

Lemma Cd_Cd_EqF : forall P Px1 Py1 Px2 Py2,
 Cd O E SS U1 U2 P (proj1_sig Px1) (proj1_sig Py1) ->
 Cd O E SS U1 U2 P (proj1_sig Px2) (proj1_sig Py2) ->
 Px1 =F= Px2 /\ Py1 =F= Py2.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: and (EqF Px1 Px2) (EqF Py1 Py2) *)
unfold EqF.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
rewrite <- (eq_points_coordinates O E SS U1 U2 P _ _ P);auto.
Qed.

Definition sqrt3 := PythF 1 (PythF 1 1).

Lemma sqrt3_square : sqrt3* sqrt3 =F= 1+2.
Proof.
(* Goal: EqF (MulF sqrt3 sqrt3) (AddF OneF TwoF) *)
unfold sqrt3.
(* Goal: EqF (AddF (MulF OneF OneF) (MulF (PythF OneF OneF) (PythF OneF OneF))) (AddF OneF TwoF) *)
rewrite PythFOk.
(* Goal: EqF (AddF (MulF OneF OneF) (MulF (PythF OneF OneF) (PythF OneF OneF))) (AddF OneF TwoF) *)
rewrite PythFOk.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
Qed.

Lemma characterization_of_congruence_F : forall A B C D,
  Cong A B C D <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let (Dc, _) := coordinates_of_point_F D in
  let (Dx, Dy) := Dc in
  (Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) -
  ((Cx - Dx) * (Cx - Dx) + (Cy - Dy) * (Cy - Dy)) =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F I in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
elim (coordinates_of_point_F A); intros Ac HAc.
(* Goal: iff (@Col Tn A B C) (let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) *)
elim (coordinates_of_point_F B); intros Bc HBc.
(* Goal: iff (@Col Tn A B C) (let (Ax, Ay) := Ac in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) *)
elim (coordinates_of_point_F C); intros Cc HCc.
(* Goal: iff (@Cong Tn A B C D) (let (Ax, Ay) := Ac in let (Bx, By) := Bc in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in EqF (SubF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) OF) *)
elim (coordinates_of_point_F D); intros Dc HDc.
(* Goal: forall _ : let (Ax, Ay) := Ac in let (Bx, By) := Ac in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ax, Ay) := Ac in let (Bx, By) := Ic in and (EqF Ax Bx) (EqF Ay By) *)
destruct Ac as [[Ax HAx] [Ay HAy]].
(* Goal: iff (@Col Tn A B C) (let (Bx, By) := Bc in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) Bx) (SubF By Cy)) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) By) (SubF Bx Cx))) OF) *)
destruct Bc as [[Bx HBx] [By HBy]].
(* Goal: iff (@Col Tn A B C) (let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy) Cy)) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx) Cx))) OF) *)
destruct Cc as [[Cx HCx] [Cy HCy]].
(* Goal: iff (@Cong Tn A B C D) (let (Dx, Dy) := Dc in EqF (SubF (AddF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx))) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy)))) (AddF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Cx HCx) Dx) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Cx HCx) Dx)) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Cy HCy) Dy) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Cy HCy) Dy)))) OF) *)
destruct Dc as [[Dx HDx] [Dy HDy]].
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
rewrite subF__eq0; unfold AddF, MulF, SubF, EqF; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Ax Bx HAx HBx) as [AxMBx HAxMBx]; simpl.
destruct (prod_f AxMBx AxMBx
                 (diff_col Ax Bx AxMBx HAxMBx)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                 (diff_col Ax Bx AxMBx HAxMBx)) as [ABx HABx]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Ay By HAy HBy) as [AyMBy HAyMBy]; simpl.
destruct (prod_f AyMBy AyMBy
                 (diff_col Ay By AyMBy HAyMBy)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                 (diff_col Ay By AyMBy HAyMBy)) as [ABy HABy]; simpl.
destruct (sum_f  ABx ABy
                (prod_col AxMBx AxMBx ABx HABx)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                (prod_col AyMBy AyMBy ABy HABy)) as [AB2 HAB2]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Cx Dx HCx HDx) as [CxMDx HCxMDx]; simpl.
destruct (prod_f CxMDx CxMDx
                 (diff_col Cx Dx CxMDx HCxMDx)
                 (diff_col Cx Dx CxMDx HCxMDx)) as [CDx HCDx].
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Cy Dy HCy HDy) as [CyMDy HCyMDy]; simpl.
destruct (prod_f CyMDy CyMDy
                 (diff_col Cy Dy CyMDy HCyMDy)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                 (diff_col Cy Dy CyMDy HCyMDy)) as [CDy HCDy]; simpl.
destruct (sum_f CDx CDy
            (prod_col CxMDx CxMDx CDx HCDx)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
            (prod_col CyMDy CyMDy CDy HCDy)) as [CD2 HCD2]; simpl.
apply (characterization_of_congruence O E E' SS U1 U2
                                        A Ax Ay B Bx By
                                        C Cx Cy D Dx Dy
                                        AxMBx ABx AyMBy ABy AB2
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
                                        CxMDx CDx CyMDy CDy CD2); auto.
Qed.

Lemma characterization_of_betweenness_F : forall A B C,
  Bet A B C <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  exists T, 0 <= T /\ T <= 1 /\
            T * (Cx - Ax) =F= Bx - Ax /\ T * (Cy - Ay) =F= By - Ay.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F I in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
elim (coordinates_of_point_F A); intros Ac HAc.
(* Goal: iff (@Col Tn A B C) (let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) *)
elim (coordinates_of_point_F B); intros Bc HBc.
(* Goal: iff (@Col Tn A B C) (let (Ax, Ay) := Ac in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) *)
elim (coordinates_of_point_F C); intros Cc HCc.
(* Goal: forall _ : let (Ax, Ay) := Ac in let (Bx, By) := Ac in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ax, Ay) := Ac in let (Bx, By) := Ic in and (EqF Ax Bx) (EqF Ay By) *)
destruct Ac as [[Ax HAx] [Ay HAy]].
(* Goal: iff (@Col Tn A B C) (let (Bx, By) := Bc in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) Bx) (SubF By Cy)) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) By) (SubF Bx Cx))) OF) *)
destruct Bc as [[Bx HBx] [By HBy]].
(* Goal: iff (@Col Tn A B C) (let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy) Cy)) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx) Cx))) OF) *)
destruct Cc as [[Cx HCx] [Cy HCy]].
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold MulF, SubF, EqF, LeF; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Bx Ax HBx HAx) as [BxMAx HBxMAx]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f By Ay HBy HAy) as [ByMAy HByMAy]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Cx Ax HCx HAx) as [CxMAx HCxMAx]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Cy Ay HCy HAy) as [CyMAy HCyMAy]; simpl.
(* Goal: iff (@Bet Tn A B C) (@ex F (fun T : F => and (@LeP Tn (@O Tn) (@E Tn) (@E' Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T)) (and (@LeP Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) (@E Tn)) (and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) CxMAx (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) (@diff_col Tn Cx Ax CxMAx HCxMAx) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) T) CxMAx P HP))) BxMAx) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) CyMAy (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) (@diff_col Tn Cy Ay CyMAy HCyMAy) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) T) CyMAy P HP))) ByMAy))))) *)
split; intro HBet; [|destruct HBet as [T HBet]].

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  apply -> (characterization_of_betweenness O E E' SS U1 U2
                                            A Ax Ay B Bx By C Cx Cy
                                            BxMAx ByMAy CxMAx CyMAy) in HBet;
  auto; destruct HBet as [T [H [HCol [HGe0 [HLe1 [HTx HTy]]]]]]; clear H.
(* Goal: @ex F (fun T : F => and (@LeP Tn (@O Tn) (@E Tn) (@E' Tn) (@O Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T)) (and (@LeP Tn (@O Tn) (@E Tn) (@E' Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) (@E Tn)) (and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) CxMAx (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) (@diff_col Tn Cx Ax CxMAx HCxMAx) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) T) CxMAx P HP))) BxMAx) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (let (P, HP) := @prod_f Tn TnEQD T2D TE (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) CyMAy (@proj2_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) (@diff_col Tn Cy Ay CyMAy HCyMAy) in @exist (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) P (@prod_col Tn (@proj1_sig (@Tpoint Tn) (fun P0 : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P0) T) CyMAy P HP))) ByMAy)))) *)
  exists (exist (fun P => Col O E P) T HCol); simpl; do 2 (split; auto).
  destruct (prod_f T CxMAx HCol
                   (diff_col Cx Ax CxMAx HCxMAx)) as [Tx HTx'].
  destruct (prod_f T CyMAy HCol
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                   (diff_col Cy Ay CyMAy HCyMAy)) as [Ty HTy']; simpl.
  split; [apply prod_uniqueness with O E E' T CxMAx|
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
          apply prod_uniqueness with O E E' T CyMAy]; assumption.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct (prod_f (proj1_sig T) CxMAx (proj2_sig T)
                   (diff_col Cx Ax CxMAx HCxMAx)) as [Tx HTx'].
  destruct (prod_f (proj1_sig T) CyMAy (proj2_sig T)
                   (diff_col Cy Ay CyMAy HCyMAy)) as [Ty HTy'].
(* Goal: @Bet Tn A B C *)
  simpl in *; destruct HBet as [HGe0 [HLe1 [HTx HTy]]]; treat_equalities.
  apply <- (characterization_of_betweenness O E E' SS U1 U2
                                            A Ax Ay B Bx By C Cx Cy
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
                                            Tx Ty CxMAx CyMAy); auto.
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (not (@eq (@Tpoint Tn) (@O Tn) (@E Tn))) (and (@Col Tn (@O Tn) (@E Tn) T) (and (@LeP Tn (@O Tn) (@E Tn) (@E' Tn) (@O Tn) T) (and (@LeP Tn (@O Tn) (@E Tn) (@E' Tn) T (@E Tn)) (and (@Prod Tn (@O Tn) (@E Tn) (@E' Tn) T CxMAx Tx) (@Prod Tn (@O Tn) (@E Tn) (@E' Tn) T CyMAy Ty)))))) *)
  exists (proj1_sig T); repeat (split; auto); [assert (TT:=ncolOEE');assert_diffs; auto|].
(* Goal: @Col Tn (@O Tn) (@E Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) T) *)
  apply (proj2_sig T).
  }
Qed.

Lemma characterization_of_collinearity_F : forall A B C,
  Col A B C <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  (Ax - Bx) * (By - Cy) - (Ay - By) * (Bx - Cx) =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F I in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
elim (coordinates_of_point_F A); intros Ac HAc.
(* Goal: iff (@Col Tn A B C) (let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) *)
elim (coordinates_of_point_F B); intros Bc HBc.
(* Goal: iff (@Col Tn A B C) (let (Ax, Ay) := Ac in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) *)
elim (coordinates_of_point_F C); intros Cc HCc.
(* Goal: forall _ : let (Ax, Ay) := Ac in let (Bx, By) := Ac in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ax, Ay) := Ac in let (Bx, By) := Ic in and (EqF Ax Bx) (EqF Ay By) *)
destruct Ac as [[Ax HAx] [Ay HAy]].
(* Goal: iff (@Col Tn A B C) (let (Bx, By) := Bc in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) Bx) (SubF By Cy)) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) By) (SubF Bx Cx))) OF) *)
destruct Bc as [[Bx HBx] [By HBy]].
(* Goal: iff (@Col Tn A B C) (let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy) Cy)) (MulF (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy)) (SubF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx) Cx))) OF) *)
destruct Cc as [[Cx HCx] [Cy HCy]].
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
rewrite subF__eq0; unfold AddF, MulF, SubF, EqF; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Ax Bx HAx HBx) as [AxMBx HAxMBx]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f By Cy HBy HCy) as [ByMCy HByMCy]; simpl.
destruct (prod_f AxMBx ByMCy
                 (diff_col Ax Bx AxMBx HAxMBx)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                 (diff_col By Cy ByMCy HByMCy)) as [P1 HP1]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Ay By HAy HBy) as [AyMBy HAyMBy]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Bx Cx HBx HCx) as [BxMCx HBxMCx]; simpl.
destruct (prod_f AyMBy BxMCx
                 (diff_col Ay By AyMBy HAyMBy)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                 (diff_col Bx Cx BxMCx HBxMCx)) as [P2 HP2]; simpl.
apply (characterization_of_collinearity O E E' SS U1 U2
                                        A Ax Ay B Bx By C Cx Cy
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
                                        AxMBx AyMBy BxMCx ByMCy P1 P2); auto.
Qed.

Lemma characterization_of_equality_F : forall A B,
  A = B <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  Ax =F= Bx /\ Ay =F= By.
Proof.
(* Goal: and (EqF Px1 Px2) (EqF Py1 Py2) *)
intros A B; unfold EqF.
(* Goal: iff (@eq (@Tpoint Tn) A B) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx)) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By))) *)
elim (coordinates_of_point_F A); intros [[Ax HAx] [Ay HAy]] HAc.
(* Goal: iff (@eq (@Tpoint Tn) A B) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx)) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By))) *)
elim (coordinates_of_point_F B); intros [[Bx HBx] [By HBy]] HBc.
(* Goal: iff (@eq (@Tpoint Tn) A B) (and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx))) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy)))) *)
rewrite (eq_points_coordinates O E SS U1 U2 A Ax Ay B Bx By HAc HBc).
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split; intro; spliter; split; treat_equalities; simpl; auto.
Qed.

Lemma characterization_of_neq_F_bis : forall A B,
  A <> B <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  ~ (Ax =F= Bx) \/ ~ (Ay =F= By).
Proof.
(* Goal: and (EqF Px1 Px2) (EqF Py1 Py2) *)
intros A B; rewrite characterization_of_equality_F; unfold EqF.
(* Goal: iff (not (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx)) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By)))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx))) (not (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By)))) *)
elim (coordinates_of_point_F A); intros [[Ax HAx] [Ay HAy]] _.
(* Goal: iff (not (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx)) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By)))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx))) (not (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By)))) *)
elim (coordinates_of_point_F B); intros [[Bx HBx] [By HBy]] _.
(* Goal: iff (not (and (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx))) (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy))))) (or (not (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Bx HBx)))) (not (@eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) By HBy))))) *)
simpl; split; intro; spliter; [|intuition].
(* Goal: or (not (@eq (@Tpoint Tn) Ax Bx)) (not (@eq (@Tpoint Tn) Ay By)) *)
destruct (eq_dec_points Ax Bx); destruct (eq_dec_points Ay By); intuition.
Qed.

Lemma characterization_of_equality_F_aux : forall Ax Ay Bx By,
  Ax =F= Bx /\ Ay =F= By <->
  (Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) =F= OF.
Proof.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
intros [Ax HAx] [Ay HAy] [Bx HBx] [By HBy]; unfold SubF, MulF, AddF, EqF; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Ax Bx HAx HBx) as [AxMBx HAxMBx]; simpl.
destruct (prod_f AxMBx AxMBx
                 (diff_col Ax Bx AxMBx HAxMBx)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                 (diff_col Ax Bx AxMBx HAxMBx)) as [ABx HABx]; simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct (diff_f Ay By HAy HBy) as [AyMBy HAyMBy]; simpl.
destruct (prod_f AyMBy AyMBy
                 (diff_col Ay By AyMBy HAyMBy)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                 (diff_col Ay By AyMBy HAyMBy)) as [ABy HABy]; simpl.
destruct (sum_f ABx ABy
                (prod_col AxMBx AxMBx ABx HABx)
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
                (prod_col AyMBy AyMBy ABy HABy)) as [s Hs]; simpl.
split; intro H; [|apply eq_sym in H]; spliter; try split; treat_equalities.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  apply sum_uniqueness with O E E' O O; [|apply sum_A_O; Col].
  assert (AxMBx = O /\ AyMBy = O).
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
    split; [apply diff_uniqueness with O E E' Ax Ax|
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
            apply diff_uniqueness with O E E' Ay Ay]; try apply diff_null; Col.
(* Goal: not (@Col Tn O E E') *)
    apply ncolOEE'.
(* Goal: not (@Col Tn O E E') *)
    apply ncolOEE'.
    }
  spliter; subst; assert (ABx = O /\ ABy = O);
  [|spliter; subst; assumption].
  split; apply prod_uniqueness with O E E' O O;
  [|apply prod_0_l| |apply prod_0_l]; Col; auto using ncolOEE'.
(* Goal: not (@Col Tn O E E') *)
  apply ncolOEE'.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  elim (eq_dec_points Ax Bx); intro Hx; [assumption|exfalso].
  apply (O_not_positive O E); elim (eq_dec_points O AyMBy); intro Hy.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
(* Goal: AM_Perp U V C D *)
(* Goal: AM_Perp U V C D *)
    treat_equalities; apply prod_O_l_eq in HABy; subst.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
    apply sum_A_O_eq in Hs; subst; try apply square_pos with E' AxMBx; Col.
    intro; treat_equalities; apply diff_null_eq in HAxMBx; intuition.
(* Goal: not (@Col Tn O E E') *)
    apply ncolOEE'.
    }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
    apply sum_pos_pos with E' ABx ABy;
    [apply square_pos with E' AxMBx|apply square_pos with E' AyMBy|assumption];
    try assumption; intro; treat_equalities;
    apply diff_null_eq in HAxMBx; intuition.
    }
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  subst; elim (eq_dec_points Ay By); intro Hy; [assumption|exfalso].
  apply (O_not_positive O E); elim (eq_dec_points O AxMBx); intro Hx.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
(* Goal: AM_Perp U V C D *)
(* Goal: AM_Perp U V C D *)
    treat_equalities; apply prod_O_l_eq in HABx; subst.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
    apply sum_O_B_eq in Hs; subst; try apply square_pos with E' AyMBy; Col.
    intro; treat_equalities; apply diff_null_eq in HAyMBy; intuition.
(* Goal: not (@Col Tn O E E') *)
    apply ncolOEE'.
    }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
    apply sum_pos_pos with E' ABx ABy;
    [apply square_pos with E' AxMBx|apply square_pos with E' AyMBy|assumption];
    try assumption; intro; treat_equalities;
    apply diff_null_eq in HAyMBy; intuition.
    }
  }
Qed.

Lemma characterization_of_equality_F_bis : forall A B,
  A = B <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  (Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) =F= OF.
Proof.
(* Goal: forall A B : @Tpoint Tn, iff (@eq (@Tpoint Tn) A B) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF) *)
intros A B; rewrite characterization_of_equality_F.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (and (EqF Ax Bx) (EqF Ay By)) (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF) *)
apply characterization_of_equality_F_aux.
Qed.

Lemma characterization_of_neq_F : forall A B,
  A <> B <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  ~ ((Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) =F= OF).
Proof.
(* Goal: forall A B : @Tpoint Tn, iff (not (@eq (@Tpoint Tn) A B)) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) *)
intros; rewrite characterization_of_equality_F_bis.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
elim (coordinates_of_point_F B); intros [Bx By] _; simpl; split; auto.
Qed.

Lemma characterization_of_midpoint_F : forall A B I,
  Midpoint I A B <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Ic, _) := coordinates_of_point_F I in
  let (Ix, Iy) := Ic in
  Ix * 2 - (Ax + Bx) =F= 0 /\ Iy * 2 - (Ay + By) =F= 0.
Proof.
(* Goal: forall A B I : @Tpoint Tn, iff (@Midpoint Tn I A B) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF)) *)
intros; elim (eq_dec_points A B); intro HAB.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: iff (@Midpoint Tn I A B) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF)) *)
  split; intro HMid; treat_equalities.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
(* Goal: forall _ : let (Ax, Ay) := Ac in let (Bx, By) := Ac in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F I in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
    elim (coordinates_of_point_F I); intros Ic HIc.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
    destruct Ic as [[Ix HIx] [Iy HIy]]; split; nsatz.
    }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
(* Goal: @Midpoint Tn I A A *)
    cut (A = I); [intro; treat_equalities; Midpoint|].
(* Goal: @eq (@Tpoint Tn) A I *)
    rewrite characterization_of_equality_F; revert HMid.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F I in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
    elim (coordinates_of_point_F A); intros Ac HAc.
(* Goal: forall _ : let (Ax, Ay) := Ac in let (Bx, By) := Ac in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F I in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
    elim (coordinates_of_point_F I); intros Ic HIc.
(* Goal: forall _ : let (Ax, Ay) := Ac in let (Bx, By) := Ac in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), let (Ax, Ay) := Ac in let (Bx, By) := Ic in and (EqF Ax Bx) (EqF Ay By) *)
    destruct Ac as [[Ax HAx] [Ay HAy]].
(* Goal: forall _ : let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx))) OF) (EqF (SubF (MulF Iy TwoF) (AddF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy))) OF), let (Bx, By) := Ic in and (EqF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ax HAx) Bx) (EqF (@exist (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) Ay HAy) By) *)
    destruct Ic as [[Ix HIx] [Iy HIy]].
(* Goal: forall _ : and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), and (EqF (SubF (AddF (MulF (SubF Ix Ax) (SubF Ix Ax)) (MulF (SubF Iy Ay) (SubF Iy Ay))) (AddF (MulF (SubF Ix Bx) (SubF Ix Bx)) (MulF (SubF Iy By) (SubF Iy By)))) OF) (EqF (SubF (MulF (SubF Ax Ix) (SubF Iy By)) (MulF (SubF Ay Iy) (SubF Ix Bx))) OF) *)
    intro; spliter; split; nsatz; apply neq20.
    }
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: iff (@Midpoint Tn I A B) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF)) *)
  split; intro HMid.

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
(* Goal: let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF) *)
    destruct HMid as [H HCong].
(* Goal: let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF) *)
    assert (HCol : Col A B I) by (assert_cols; Col); clear H.
(* Goal: let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF) *)
    revert HCol; revert HCong; revert HAB.
    rewrite characterization_of_neq_F, characterization_of_congruence_F,
            characterization_of_collinearity_F.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: forall _ : let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), and (let (Ac, _) := coordinates_of_point_F I in let (Ax0, Ay0) := Ac in let (Cc, _) := coordinates_of_point_F I in let (Cx, Cy) := Cc in EqF (SubF (AddF (MulF (SubF Ax0 Ax) (SubF Ax0 Ax)) (MulF (SubF Ay0 Ay) (SubF Ay0 Ay))) (AddF (MulF (SubF Cx Bx) (SubF Cx Bx)) (MulF (SubF Cy By) (SubF Cy By)))) OF) (let (Bc, _) := coordinates_of_point_F I in let (Bx0, By0) := Bc in EqF (SubF (MulF (SubF Ax Bx0) (SubF By0 By)) (MulF (SubF Ay By0) (SubF Bx0 Bx))) OF) *)
    elim (coordinates_of_point_F I); intros [Ix Iy] _.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
    intros HAB HCong HCol.
    cut ((Ix * 2 - (Ax + Bx) =F= 0 /\ Iy * 2 - (Ay + By) =F= 0) \/
         (Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) =F= 0); [intuition|].
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
    clear HAB; scnf; repeat rewrite <- mulF__eq0; try nsatz; rtauto.
    }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
    cut (Cong I A I B /\ Col A I B);
    [intros [HCong HCol]; induction (l7_20 I A B HCol HCong); intuition|].
    clear HAB; rewrite characterization_of_congruence_F,
                       characterization_of_collinearity_F.
(* Goal: and (let (Ac, _) := coordinates_of_point_F I in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F I in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in EqF (SubF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) OF) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F I in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F B in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) *)
    revert HMid.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: forall _ : let (Ic, _) := coordinates_of_point_F I in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), and (let (Ac, _) := coordinates_of_point_F I in let (Ax0, Ay0) := Ac in let (Cc, _) := coordinates_of_point_F I in let (Cx, Cy) := Cc in EqF (SubF (AddF (MulF (SubF Ax0 Ax) (SubF Ax0 Ax)) (MulF (SubF Ay0 Ay) (SubF Ay0 Ay))) (AddF (MulF (SubF Cx Bx) (SubF Cx Bx)) (MulF (SubF Cy By) (SubF Cy By)))) OF) (let (Bc, _) := coordinates_of_point_F I in let (Bx0, By0) := Bc in EqF (SubF (MulF (SubF Ax Bx0) (SubF By0 By)) (MulF (SubF Ay By0) (SubF Bx0 Bx))) OF) *)
    elim (coordinates_of_point_F I); intros [Ix Iy] _.
(* Goal: forall _ : and (EqF (SubF (MulF Ix TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Iy TwoF) (AddF Ay By)) OF), and (EqF (SubF (AddF (MulF (SubF Ix Ax) (SubF Ix Ax)) (MulF (SubF Iy Ay) (SubF Iy Ay))) (AddF (MulF (SubF Ix Bx) (SubF Ix Bx)) (MulF (SubF Iy By) (SubF Iy By)))) OF) (EqF (SubF (MulF (SubF Ax Ix) (SubF Iy By)) (MulF (SubF Ay Iy) (SubF Ix Bx))) OF) *)
    intro; spliter; split; nsatz; apply neq20.
    }
  }
Qed.

Lemma characterization_of_right_triangle_F : forall A B C,
  Per A B C <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  (Ax - Bx) * (Bx - Cx) + (Ay - By) * (By - Cy) =F= 0.
Proof.
(* Goal: forall A B C : @Tpoint Tn, iff (@Per Tn A B C) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF) *)
intros; unfold Per.
(* Goal: iff (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF) *)
destruct (symmetric_point_construction C B) as [D HM]; revert HM.
(* Goal: forall _ : @Midpoint Tn B C D, iff (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF) *)
setoid_rewrite characterization_of_congruence_F.
(* Goal: forall (_ : @Midpoint Tn Q B P) (_ : @Midpoint Tn C A P) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))), and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (@ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Midpoint Tn C A P) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Midpoint Tn Q B P) (@Col Tn C D Q)))))) *)
setoid_rewrite characterization_of_midpoint_F.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx0, By0) := Bc in and (EqF (SubF (MulF Bx TwoF) (AddF Ax Bx0)) OF) (EqF (SubF (MulF By TwoF) (AddF Ay By0)) OF), iff (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C' in let (Bx0, By0) := Bc in and (EqF (SubF (MulF Bx TwoF) (AddF Ax Bx0)) OF) (EqF (SubF (MulF By TwoF) (AddF Ay By0)) OF)) (let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in let (Dc, _) := coordinates_of_point_F C' in let (Dx, Dy) := Dc in EqF (SubF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) OF))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF) *)
elim (coordinates_of_point_F C); intros [Cx Cy] _; intro H.
split; [clear H; clear D;
        intro H; destruct H as [D [H1 H2]];
        revert H2; revert H1|
        intro H1; exists D; split;
        [assumption|revert H1; revert H]];
elim (coordinates_of_point_F D); intros Dc _;
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
destruct Dc as [Dx Dy]; intros; spliter; nsatz.
(* Goal: not (@equality F (@eq_notation F OF OneF AddF MulF SubF OppF (fun x y : F => @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) y)) Fops) (@interpret3 F OF OneF AddF MulF SubF OppF EqF Fops (@PEc Z (Zpos (xO (xO xH)))) (@cons F Bx (@cons F Cx (@cons F Dx (@cons F By (@cons F Cy (@cons F Dy (@cons F Ax (@cons F Ay (@nil F)))))))))) (@zero F (@zero_notation F OF OneF AddF MulF SubF OppF (fun x y : F => @eq (@Tpoint Tn) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) x) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) y)) Fops))) *)
simpl; apply neqO_mul_neqO; apply neq20.
Qed.

Lemma characterization_of_parallelism_F_aux : forall A B C D,
  Par A B C D <->
  A <> B /\ C <> D /\
  exists P, Midpoint C A P /\ exists Q, Midpoint Q B P /\ Col C D Q.
Proof.
intros; split; intro H; [do 2 (split; try solve [assert_diffs; auto])|
                         destruct H as [HAB [HCD [P [HP [Q [HQ HCol]]]]]]].

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
  destruct (symmetric_point_construction A C) as [P HP];
  exists P; split; [assumption|]; destruct (midpoint_existence B P) as [Q HQ].
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Midpoint Tn Q B P) (@Col Tn C D Q)) *)
  exists Q; split; [assumption|].
(* Goal: @Par Tn A B C D *)
  assert (Par B A Q C) by (apply triangle_mid_par with P; assert_diffs; Col).
(* Goal: @Col Tn C D Q *)
  destruct (parallel_uniqueness A B C D C Q C); finish.
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: @Par Tn A B C D *)
  assert (Par B A Q C) by (apply triangle_mid_par with P; assert_diffs; Col).
(* Goal: @Par Tn A B C D *)
  apply par_col_par with Q; finish.
  }
Qed.

Lemma characterization_of_parallelism_F_bis : forall A B C D,
  Par A B C D <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let (Dc, _) := coordinates_of_point_F D in
  let (Dx, Dy) := Dc in
  (Ax - Bx) * (Cy - Dy) - (Ay - By) * (Cx - Dx) =F= 0 /\
  (~ (Ax =F= Bx) \/ ~ (Ay =F= By)) /\ (~ (Cx =F= Dx) \/ ~ (Cy =F= Dy)).
Proof.
(* Goal: forall A B C D : @Tpoint Tn, iff (@Par Tn A B C D) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) *)
intros; rewrite characterization_of_parallelism_F_aux.
(* Goal: iff (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (@ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Midpoint Tn C A P) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Midpoint Tn Q B P) (@Col Tn C D Q))))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) *)
split; [intro H; destruct H as [HAB [HCD [P [HP [Q [HQ HCol]]]]]]|].

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  revert HCol; revert HQ; revert HP; revert HCD; revert HAB.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_neq_F_bis.
(* Goal: forall (_ : @Midpoint Tn Q B P) (_ : @Midpoint Tn C A P) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))), and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (@ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Midpoint Tn C A P) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Midpoint Tn Q B P) (@Col Tn C D Q)))))) *)
  setoid_rewrite characterization_of_midpoint_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_collinearity_F.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: forall (_ : or (not (EqF Ax Bx)) (not (EqF Ay By))) (_ : or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (_ : let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in and (EqF (SubF (MulF Cx TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay By)) OF)) (_ : let (Bc, _) := coordinates_of_point_F P in let (Bx0, By0) := Bc in let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Bx0)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By By0)) OF)) (_ : let (Cc, _) := coordinates_of_point_F Q in let (Cx0, Cy0) := Cc in EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Cy0)) (MulF (SubF Cy Dy) (SubF Dx Cx0))) OF), and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  elim (coordinates_of_point_F P); intros [Px Py] _.
(* Goal: forall (_ : or (not (EqF Ax Bx)) (not (EqF Ay By))) (_ : or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (_ : and (EqF (SubF (MulF Cx TwoF) (AddF Ax Px)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay Py)) OF)) (_ : let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Px)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By Py)) OF)) (_ : let (Cc, _) := coordinates_of_point_F Q in let (Cx0, Cy0) := Cc in EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Cy0)) (MulF (SubF Cy Dy) (SubF Dx Cx0))) OF), and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  elim (coordinates_of_point_F Q); intros [Qx Qy] _.
(* Goal: forall (_ : or (not (EqF Ax Bx)) (not (EqF Ay By))) (_ : or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (_ : and (EqF (SubF (MulF Cx TwoF) (AddF Ax Px)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay Py)) OF)) (_ : and (EqF (SubF (MulF Qx TwoF) (AddF Bx Px)) OF) (EqF (SubF (MulF Qy TwoF) (AddF By Py)) OF)) (_ : EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Qy)) (MulF (SubF Cy Dy) (SubF Dx Qx))) OF), and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  intros HAB HCD [HPx HPy] [HQx HQy] HCol; split; [|split; assumption].
(* Goal: EqF (AddF (MulF (SubF Ux Xx) (SubF Xx Vx)) (MulF (SubF Uy Xy) (SubF Xy Vy))) OF *)
  rewrite <- neg_and_eqF in HAB; rewrite <- neg_and_eqF in HCD.
  cut ((Ax - Bx) * (Cy - Dy) - (Ay - By) * (Cx - Dx) =F= 0 \/
       ((Ax =F= Bx) /\ (Ay =F= By)) \/
       ((Cx =F= Dx) /\ (Cy =F= Dy))); [intuition|].
  scnf; try solve[clear HAB; clear HCD; repeat rewrite <- mulF__eq0; nsatz;
                  simpl; try rewrite <- oppF_neq0;
                  apply neqO_mul_neqO; apply neq20].
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
  clear HPx; clear HPy; clear HQx; clear HQy; clear HCol.
  destruct H as [[H1 H2] [H3 H4]];
  elim H1; clear H1; [auto|intro H1];
  elim H2; clear H2; [auto|intro H2];
  elim H3; clear H3; [auto|intro H3];
  elim H4; clear H4; [auto|intro H4; exfalso; rtauto].
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (@ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Midpoint Tn C A P) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Midpoint Tn Q B P) (@Col Tn C D Q)))))) *)
  destruct (symmetric_point_construction A C) as [P HP]; revert HP.
(* Goal: forall (_ : @Midpoint Tn C A P) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (@ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Midpoint Tn C A P) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Midpoint Tn Q B P) (@Col Tn C D Q)))))) *)
  destruct (midpoint_existence B P) as [Q HQ]; revert HQ.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_neq_F_bis.
(* Goal: forall (_ : @Midpoint Tn Q B P) (_ : @Midpoint Tn C A P) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))), and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (@ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Midpoint Tn C A P) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Midpoint Tn Q B P) (@Col Tn C D Q)))))) *)
  setoid_rewrite characterization_of_midpoint_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_collinearity_F.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: forall (_ : let (Bc, _) := coordinates_of_point_F P in let (Bx0, By0) := Bc in let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Bx0)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By By0)) OF)) (_ : let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in and (EqF (SubF (MulF Cx TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay By)) OF)) (_ : and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))), and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (@ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in and (EqF (SubF (MulF Cx TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay By)) OF)) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (let (Bc, _) := coordinates_of_point_F P in let (Bx0, By0) := Bc in let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Bx0)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By By0)) OF)) (let (Cc, _) := coordinates_of_point_F Q in let (Cx0, Cy0) := Cc in EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Cy0)) (MulF (SubF Cy Dy) (SubF Dx Cx0))) OF)))))) *)
  intros HP HQ [HPar [HAB HCD]]; split; [assumption|split; [assumption|]].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in and (EqF (SubF (MulF Cx TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay By)) OF)) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (let (Bc, _) := coordinates_of_point_F P in let (Bx0, By0) := Bc in let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Bx0)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By By0)) OF)) (let (Cc, _) := coordinates_of_point_F Q in let (Cx0, Cy0) := Cc in EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Cy0)) (MulF (SubF Cy Dy) (SubF Dx Cx0))) OF)))) *)
  exists P; revert HQ; revert HP.
(* Goal: forall (_ : let (Bc, _) := coordinates_of_point_F P in let (Bx0, By0) := Bc in let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Bx0)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By By0)) OF)) (_ : let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in and (EqF (SubF (MulF Cx TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay By)) OF)), and (let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in and (EqF (SubF (MulF Cx TwoF) (AddF Ax Bx)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay By)) OF)) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (let (Bc, _) := coordinates_of_point_F P in let (Bx0, By0) := Bc in let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Bx0)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By By0)) OF)) (let (Cc, _) := coordinates_of_point_F Q in let (Cx0, Cy0) := Cc in EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Cy0)) (MulF (SubF Cy Dy) (SubF Dx Cx0))) OF))) *)
  elim (coordinates_of_point_F P); intros [Px Py] _; intros HQ [HPx HPy].
(* Goal: and (and (EqF (SubF (MulF Cx TwoF) (AddF Ax Px)) OF) (EqF (SubF (MulF Cy TwoF) (AddF Ay Py)) OF)) (@ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Px)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By Py)) OF)) (let (Cc, _) := coordinates_of_point_F Q in let (Cx0, Cy0) := Cc in EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Cy0)) (MulF (SubF Cy Dy) (SubF Dx Cx0))) OF))) *)
  split; [split; assumption|]; exists Q; revert HQ.
(* Goal: forall _ : let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Px)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By Py)) OF), and (let (Ic, _) := coordinates_of_point_F Q in let (Ix, Iy) := Ic in and (EqF (SubF (MulF Ix TwoF) (AddF Bx Px)) OF) (EqF (SubF (MulF Iy TwoF) (AddF By Py)) OF)) (let (Cc, _) := coordinates_of_point_F Q in let (Cx0, Cy0) := Cc in EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Cy0)) (MulF (SubF Cy Dy) (SubF Dx Cx0))) OF) *)
  elim (coordinates_of_point_F Q); intros [Qx Qy] _; intros [HQx HQy].
(* Goal: and (and (EqF (SubF (MulF Qx TwoF) (AddF Bx Px)) OF) (EqF (SubF (MulF Qy TwoF) (AddF By Py)) OF)) (EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Qy)) (MulF (SubF Cy Dy) (SubF Dx Qx))) OF) *)
  split; [split; assumption|].
(* Goal: EqF (AddF (MulF (SubF Ux Xx) (SubF Xx Vx)) (MulF (SubF Uy Xy) (SubF Xy Vy))) OF *)
  rewrite <- neg_and_eqF in HAB; rewrite <- neg_and_eqF in HCD.
  cut ((Cx - Dx) * (Dy - Qy) - (Cy - Dy) * (Dx - Qx) =F= 0 \/
       ((Ax =F= Bx) /\ (Ay =F= By)) \/
       ((Cx =F= Dx) /\ (Cy =F= Dy))); [intuition|].
  scnf; clear HAB; clear HCD; repeat rewrite <- mulF__eq0;
  try solve [nsatz;simpl; repeat try apply neqO_mul_neqO;try apply neq20;try ( apply  (oppF_neq0 (_+_ one one)));  apply neq20].
(* Goal: or (EqF (SubF (MulF (SubF Cx Dx) (SubF Dy Qy)) (MulF (SubF Cy Dy) (SubF Dx Qx))) OF) (or (and (EqF Ax Bx) (EqF Ay By)) (and (EqF Cx Dx) (EqF Cy Dy))) *)
  clear HPx; clear HPy; clear HQx; clear HQy; clear HPar.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
  decompose [and or] H;clear H;auto.
  }
Qed.

Lemma characterization_of_parallelism_F : forall A B C D,
  Par A B C D <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let (Dc, _) := coordinates_of_point_F D in
  let (Dx, Dy) := Dc in
  (Ax - Bx) * (Cy - Dy) - (Ay - By) * (Cx - Dx) =F= 0 /\
  ~ ((Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) =F= OF) /\
  ~ ((Cx - Dx) * (Cx - Dx) + (Cy - Dy) * (Cy - Dy) =F= OF).
Proof.
(* Goal: forall A B C D : @Tpoint Tn, iff (@Par Tn A B C D) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
intros; rewrite characterization_of_parallelism_F_bis.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: iff (and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
setoid_rewrite <- characterization_of_equality_F_aux.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
setoid_rewrite <- neg_and_eqF; tauto.
Qed.

Lemma characterization_of_perpendicularity_F_bis : forall A B C D,
  Perp A B C D <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let (Dc, _) := coordinates_of_point_F D in
  let (Dx, Dy) := Dc in
  (Ax - Bx) * (Cx - Dx) + (Ay - By) * (Cy - Dy) =F= OF /\
  (~ (Ax =F= Bx) \/ ~ (Ay =F= By)) /\ (~ (Cx =F= Dx) \/ ~ (Cy =F= Dy)).
Proof.
(* Goal: forall A B C D : @Tpoint Tn, iff (@Perp Tn A B C D) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) *)
intros; split; [intro H; destruct H as [X [HAB [HCD [HC1 [HC2 HPer]]]]]|].

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
  assert (HA : Col A A B) by Col; assert (HB : Col B A B) by Col.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
  assert (HC : Col C C D) by Col; assert (HD : Col D C D) by Col.
(* Goal: let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  assert (HPer1:=HPer A C HA HC); assert (HPer2:=HPer B C HB HC); clear HC.
(* Goal: let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  assert (HPer3:=HPer A D HA HD); assert (HPer4:=HPer B D HB HD); clear HD.
  clear HA; clear HB; clear HPer; revert HPer4; revert HPer3;
  revert HPer2; revert HPer1; revert HC2; revert HC1; revert HCD; revert HAB.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_neq_F_bis.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_collinearity_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F B in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F D in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (forall (U V : @Tpoint Tn) (_ : let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F B in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F D in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_right_triangle_F.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: forall (_ : or (not (EqF Ax Bx)) (not (EqF Ay By))) (_ : or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (_ : let (Ac, _) := coordinates_of_point_F X in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF) (_ : let (Bc, _) := coordinates_of_point_F X in let (Bx, By) := Bc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF) (_ : let (Bc, _) := coordinates_of_point_F X in let (Bx0, By0) := Bc in EqF (AddF (MulF (SubF Bx Bx0) (SubF Bx0 Cx)) (MulF (SubF By By0) (SubF By0 Cy))) OF) (_ : let (Bc, _) := coordinates_of_point_F X in let (Bx, By) := Bc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Dx)) (MulF (SubF Ay By) (SubF By Dy))) OF) (_ : let (Bc, _) := coordinates_of_point_F X in let (Bx0, By0) := Bc in EqF (AddF (MulF (SubF Bx Bx0) (SubF Bx0 Dx)) (MulF (SubF By By0) (SubF By0 Dy))) OF), and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  elim (coordinates_of_point_F X); intros [Xx Xy] _.
(* Goal: forall (_ : or (not (EqF Ax Bx)) (not (EqF Ay By))) (_ : or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (_ : EqF (SubF (MulF (SubF Xx Ax) (SubF Ay By)) (MulF (SubF Xy Ay) (SubF Ax Bx))) OF) (_ : EqF (SubF (MulF (SubF Xx Cx) (SubF Cy Dy)) (MulF (SubF Xy Cy) (SubF Cx Dx))) OF) (_ : EqF (AddF (MulF (SubF Ax Xx) (SubF Xx Cx)) (MulF (SubF Ay Xy) (SubF Xy Cy))) OF) (_ : EqF (AddF (MulF (SubF Bx Xx) (SubF Xx Cx)) (MulF (SubF By Xy) (SubF Xy Cy))) OF) (_ : EqF (AddF (MulF (SubF Ax Xx) (SubF Xx Dx)) (MulF (SubF Ay Xy) (SubF Xy Dy))) OF) (_ : EqF (AddF (MulF (SubF Bx Xx) (SubF Xx Dx)) (MulF (SubF By Xy) (SubF Xy Dy))) OF), and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))) *)
  intros; split; [nsatz|split; assumption].
  }

(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
  {
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @Perp Tn A B C D *)
  unfold Perp, Perp_at; intro HPerp.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  assert (HX : ~ Par A B C D); revert HPerp.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    {
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    intro H; assert (HAB : A <> B); revert H.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
      {
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@eq (@Tpoint Tn) A B) *)
      rewrite characterization_of_neq_F_bis.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
      elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
      elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
      elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
      elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
      intro; spliter; auto.
      }
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (@Par Tn A B C D) *)
    rewrite characterization_of_parallelism_F_bis.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), not (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) *)
    rewrite characterization_of_neq_F in HAB; revert HAB.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
    elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: forall (_ : not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))), not (and (EqF (SubF (MulF (SubF Ax Bx) (SubF Cy Dy)) (MulF (SubF Ay By) (SubF Cx Dx))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) *)
    intros HAB [HPerp [_ HCD]]; intros [HPar _]; apply HAB.
    cut ((Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) =F= 0 \/
         ((Cx =F= Dx) /\ (Cy =F= Dy))); [intuition|].
    rewrite <- neg_and_eqF in HCD; scnf; [| |exfalso; rtauto];
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
    clear HCD; repeat rewrite <- mulF__eq0; nsatz.
    }
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_neq_F_bis.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_collinearity_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F B in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F D in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (forall (U V : @Tpoint Tn) (_ : let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F B in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F D in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF), @Per Tn U X V))))) *)
  setoid_rewrite characterization_of_right_triangle_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F B in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F D in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (forall (U V : @Tpoint Tn) (_ : let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F A in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F B in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F D in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF), let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F X in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F V in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF))))) *)
  apply not_par_inter_exists in HX; destruct HX as [X [H1 H2]].
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
  revert H2; revert H1; setoid_rewrite characterization_of_collinearity_F.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
  elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F X in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF) (_ : and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF) (forall (U V : @Tpoint Tn) (_ : let (Ac, _) := coordinates_of_point_F U in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF), let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F X in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F V in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF))))) *)
  intros H1 H2 [HPerp [HAB HCD]].
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (or (not (EqF Cx Dx)) (not (EqF Cy Dy))) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (and (let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF) (forall (U V : @Tpoint Tn) (_ : let (Ac, _) := coordinates_of_point_F U in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF), let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F X in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F V in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF))))) *)
  exists X; repeat split; auto; intros U V; revert H2; revert H1.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F X in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F X in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF) (_ : let (Ac, _) := coordinates_of_point_F U in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF), let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F X in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F V in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF *)
  elim (coordinates_of_point_F X); intros [Xx Xy] _; intros H1 H2.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F U in let (Ax0, Ay0) := Ac in EqF (SubF (MulF (SubF Ax0 Ax) (SubF Ay By)) (MulF (SubF Ay0 Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF), let (Ac, _) := coordinates_of_point_F U in let (Ax, Ay) := Ac in let (Cc, _) := coordinates_of_point_F V in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Xx) (SubF Xx Cx)) (MulF (SubF Ay Xy) (SubF Xy Cy))) OF *)
  elim (coordinates_of_point_F U); intros [Ux Uy] _.
(* Goal: forall (_ : EqF (SubF (MulF (SubF Ux Ax) (SubF Ay By)) (MulF (SubF Uy Ay) (SubF Ax Bx))) OF) (_ : let (Ac, _) := coordinates_of_point_F V in let (Ax, Ay) := Ac in EqF (SubF (MulF (SubF Ax Cx) (SubF Cy Dy)) (MulF (SubF Ay Cy) (SubF Cx Dx))) OF), let (Cc, _) := coordinates_of_point_F V in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ux Xx) (SubF Xx Cx)) (MulF (SubF Uy Xy) (SubF Xy Cy))) OF *)
  elim (coordinates_of_point_F V); intros [Vx Vy] _; intros H3 H4.
(* Goal: EqF (AddF (MulF (SubF Ux Xx) (SubF Xx Vx)) (MulF (SubF Uy Xy) (SubF Xy Vy))) OF *)
  rewrite <- neg_and_eqF in HAB; rewrite <- neg_and_eqF in HCD.
  cut ((Ux - Xx) * (Xx - Vx) + (Uy - Xy) * (Xy - Vy) =F= 0 \/
       ((Ax =F= Bx) /\ (Ay =F= By)) \/
       ((Cx =F= Dx) /\ (Cy =F= Dy))); [intuition|].
(* Goal: or (EqF (AddF (MulF (SubF Ux Xx) (SubF Xx Vx)) (MulF (SubF Uy Xy) (SubF Xy Vy))) OF) (or (and (EqF Ax Bx) (EqF Ay By)) (and (EqF Cx Dx) (EqF Cy Dy))) *)
  scnf; try solve [clear HAB; clear HCD; repeat rewrite <- mulF__eq0; nsatz].
(* Goal: or (EqF (AddF (MulF (SubF Ux Xx) (SubF Xx Vx)) (MulF (SubF Uy Xy) (SubF Xy Vy))) OF) (or (and (EqF Ax Bx) (EqF Ay By)) (and (EqF Cx Dx) (EqF Cy Dy))) *)
  clear HPerp; clear H1; clear H2; clear H3; clear H4.
  destruct H as [[H1 H2] [H3 H4]];
  elim H1; clear H1; [auto|intro H1];
  elim H2; clear H2; [auto|intro H2];
  elim H3; clear H3; [auto|intro H3];
  elim H4; clear H4; [auto|intro H4; exfalso; rtauto].
  }
Qed.

Lemma characterization_of_perpendicularity_F : forall A B C D,
  Perp A B C D <->
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let (Dc, _) := coordinates_of_point_F D in
  let (Dx, Dy) := Dc in
  (Ax - Bx) * (Cx - Dx) + (Ay - By) * (Cy - Dy) =F= OF /\
  ~ ((Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By) =F= OF) /\
  ~ ((Cx - Dx) * (Cx - Dx) + (Cy - Dy) * (Cy - Dy) =F= OF).
Proof.
(* Goal: forall A B C D : @Tpoint Tn, iff (@Perp Tn A B C D) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
intros; rewrite characterization_of_perpendicularity_F_bis.
(* Goal: iff (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F A); intros [Ax Ay] _.
(* Goal: iff (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F B); intros [Bx By] _.
(* Goal: iff (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F C); intros [Cx Cy] _.
(* Goal: iff (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
elim (coordinates_of_point_F D); intros [Dx Dy] _.
(* Goal: iff (and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy))))) (and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
setoid_rewrite <- characterization_of_equality_F_aux.
(* Goal: forall (A B : Prop) (_ : or A B) (_ : not A), B *)
setoid_rewrite <- neg_and_eqF; tauto.
Qed.

Lemma field_prop: forall a b c d: F,
 ~ b=F=0 -> ~ d =F= 0 -> a*d =F= b*c -> a/b =F= c/d.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (DivF a b) (DivF c d) *)
assert (a*d / d =F= b * c /d).
(* Goal: EqF (DivF (MulF a d) d) (DivF (MulF b c) d) *)
(* Goal: EqF (DivF a b) (DivF c d) *)
 rewrite H1;reflexivity.
(* Goal: EqF (DivF a b) (DivF c d) *)
setoid_replace (a * d / d) with a in H2 by (field;auto).
(* Goal: EqF (DivF a b) (DivF c d) *)
rewrite H2.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
field;split;auto.
Qed.

Lemma field_prop_zero : forall a b, ~ b =F= 0 -> a/b =F= 0 -> a=F=0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF a OF *)
assert (a/b * b =F= 0*b).
(* Goal: EqF (MulF (DivF a b) b) (MulF OF b) *)
(* Goal: EqF a OF *)
rewrite H0.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: EqF a OF *)
setoid_replace (a/b*b) with (a) in H1.
(* Goal: EqF a OF *)
(* Goal: EqF (MulF (DivF a b) b) a *)
rewrite H1.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
assumption.
Qed.

Lemma field_prop_1 : forall a b c, ~ b =F= 0 -> a/b =F= c -> a=F=c*b.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF a (MulF c b) *)
assert (a / b * b =F= c*b ).
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) OF *)
rewrite <- H0.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
assumption.
(* Goal: EqF a (MulF c b) *)
rewrite <- H1.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
assumption.
Qed.

Ltac decompose_coordinates :=
  repeat
  match goal with
    H: _ |- context[ (coordinates_of_point_F ?X) ] =>
      let fx := fresh X "x" in
      let fy := fresh X "y" in
      destruct (coordinates_of_point_F X) as [[fx fy] _]
  end.

Ltac convert_to_algebra :=
  try setoid_rewrite characterization_of_betweenness_F;
  try setoid_rewrite characterization_of_congruence_F;
  try setoid_rewrite characterization_of_midpoint_F;
  try setoid_rewrite characterization_of_collinearity_F;
  try setoid_rewrite characterization_of_right_triangle_F;
  try setoid_rewrite characterization_of_perpendicularity_F;
  try setoid_rewrite characterization_of_parallelism_F;
  try setoid_rewrite characterization_of_equality_F;
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
  try setoid_rewrite characterization_of_neq_F.

Ltac express_disj_as_a_single_poly := repeat rewrite <- mulF__eq0.

Lemma centroid_theorem : forall A B C A1 B1 C1 G,
  Midpoint A1 B C ->
  Midpoint B1 A C ->
  Midpoint C1 A B ->
  Col A A1 G ->
  Col B B1 G ->
  Col C C1 G \/ Col A B C.
Proof.
(* Goal: forall (A B C A1 B1 C1 G : @Tpoint Tn) (_ : @Midpoint Tn A1 B C) (_ : @Midpoint Tn B1 A C) (_ : @Midpoint Tn C1 A B) (_ : @Col Tn A A1 G) (_ : @Col Tn B B1 G), or (@Col Tn C C1 G) (@Col Tn A B C) *)
intros A B C A1 B1 C1 G; convert_to_algebra; decompose_coordinates.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros; spliter. express_disj_as_a_single_poly; nsatz.
Qed.

Lemma put_neg_in_goal : forall A B, A \/ B -> (~ A -> B).
Proof. tauto. Qed.

Ltac put_negs_in_goal :=
  repeat
  match goal with
    H: ~ ?X |- _ => revert H; apply put_neg_in_goal
  end.

(** We only need to prove discrimination results
as so far the only constant different from 0 or 1 which occurs is 2. *)
Ltac prove_discr_for_powers_of_2 :=
  simpl; try rewrite <- oppF_neq0; repeat apply neqO_mul_neqO; apply neq20.


Lemma nine_point_circle : forall A B C A1 B1 C1 A2 B2 C2 A3 B3 C3 H O,
  ~ Col A B C ->
  Col A B C2 -> Col B C A2 -> Col A C B2 ->
  Perp A B C C2 -> Perp B C A A2 -> Perp A C B B2 ->
  Perp A B C2 H -> Perp B C A2 H -> Perp A C B2 H ->
  Midpoint A3 A H -> Midpoint B3 B H -> Midpoint C3 C H ->
  Midpoint C1 A B -> Midpoint A1 B C -> Midpoint B1 C A ->
  Cong O A1 O B1 -> Cong O A1 O C1 ->
  Cong O A2 O A1 /\ Cong O B2 O A1 /\ Cong O C2 O A1 /\
  Cong O A3 O A1 /\ Cong O B3 O A1 /\ Cong O C3 O A1.
Proof.
(* Goal: forall (A B C A1 B1 C1 A2 B2 C2 A3 B3 C3 H O : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Col Tn A B C2) (_ : @Col Tn B C A2) (_ : @Col Tn A C B2) (_ : @Perp Tn A B C C2) (_ : @Perp Tn B C A A2) (_ : @Perp Tn A C B B2) (_ : @Perp Tn A B C2 H) (_ : @Perp Tn B C A2 H) (_ : @Perp Tn A C B2 H) (_ : @Midpoint Tn A3 A H) (_ : @Midpoint Tn B3 B H) (_ : @Midpoint Tn C3 C H) (_ : @Midpoint Tn C1 A B) (_ : @Midpoint Tn A1 B C) (_ : @Midpoint Tn B1 C A) (_ : @Cong Tn O A1 O B1) (_ : @Cong Tn O A1 O C1), and (@Cong Tn O A2 O A1) (and (@Cong Tn O B2 O A1) (and (@Cong Tn O C2 O A1) (and (@Cong Tn O A3 O A1) (and (@Cong Tn O B3 O A1) (@Cong Tn O C3 O A1))))) *)
intros A B C A1 B1 C1 A2 B2 C2 A3 B3 C3 H O0; convert_to_algebra.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
decompose_coordinates; intros; spliter.
clear H24; clear H25; clear H26; clear H27; clear H28; clear H29;
clear H30; clear H31; clear H32; clear H33; clear H34; clear H35;
(* Goal: EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy)))) *)
put_negs_in_goal.
scnf; [| | | | | |spliter; rtauto]; express_disj_as_a_single_poly;
(* Goal: not (EqF TwoF OF) *)
nsatz; prove_discr_for_powers_of_2.
Qed.

(** We deduce the axioms of the area method. *)

Definition vect := (F * F)%type.

Definition cross_product (u v : vect) : F :=
  fst u * snd v - snd u * fst v.

Definition scalar_product (u v : vect) : F :=
  fst u * fst v + snd u * snd v.

Definition ratio A B C D :=
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let (Dc, _) := coordinates_of_point_F D in
  let (Dx, Dy) := Dc in
  let VAB := (Bx-Ax, By-Ay) in
  let VCD := (Dx-Cx, Dy-Cy) in
  scalar_product VAB VCD / scalar_product VCD VCD.

Definition signed_area A B C :=
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let VAB := (Bx-Ax, By-Ay) in
  let VAC := (Cx-Ax, Cy-Ay) in
  1 / 2 * cross_product VAB VAC.

(** We introduce this definition to simplify the automatic proofs:*)

Definition twice_signed_area A B C :=
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  let (Cc, _) := coordinates_of_point_F C in
  let (Cx, Cy) := Cc in
  let VAB := (Bx-Ax, By-Ay) in
  let VAC := (Cx-Ax, Cy-Ay) in
  cross_product VAB VAC.

Lemma signed_area_cyclic :
  forall A B C, signed_area A B C =F= signed_area B C A.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: forall _ : @Par Tn A D B C, EqF (signed_area A B C) (signed_area D B C) *)
unfold signed_area.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: EqF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Cx Bx) (SubF Ay By)) (MulF (SubF Cy By) (SubF Ax Bx))) *)
field;prove_discr_for_powers_of_2.
Qed.

Lemma signed_area_perm :
 forall A B C, signed_area A B C =F= - signed_area B A C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: forall _ : @Par Tn A D B C, EqF (signed_area A B C) (signed_area D B C) *)
unfold signed_area.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: EqF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Cx Bx) (SubF Ay By)) (MulF (SubF Cy By) (SubF Ax Bx))) *)
field;prove_discr_for_powers_of_2.
Qed.

Lemma signed_area_sum :
 forall A B C D, signed_area A B C =F= signed_area A B D + signed_area A D C + signed_area D B C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: forall _ : @Par Tn A D B C, EqF (signed_area A B C) (signed_area D B C) *)
unfold signed_area.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: EqF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Cx Bx) (SubF Ay By)) (MulF (SubF Cy By) (SubF Ax Bx))) *)
field;prove_discr_for_powers_of_2.
Qed.


Lemma co_side :
 forall A B C P,
  A <> C ->
  ~ twice_signed_area P A C =F= 0 ->
  twice_signed_area A B C =F= 0 ->
  ratio A B A C =F= twice_signed_area P A B / twice_signed_area P A C.
Proof.
intros A B C P.
intro HAC.
setoid_rewrite characterization_of_neq_F in HAC.
unfold twice_signed_area, ratio.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product, scalar_product;simpl.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.

assert ( ((Bx - Ax) * (Cx - Ax) + (By - Ay) * (Cy - Ay)) * ((Ax - Px) * (Cy - Py) - (Ay - Py) * (Cx - Px))
 =F= ((Ax - Px) * (By - Py) - (Ay - Py) * (Bx - Px)) * ((Cx - Ax) * (Cx - Ax) + (Cy - Ay) * (Cy - Ay))).  
(* Goal: EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy)))) *)
put_negs_in_goal.
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.

apply field_prop.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
apply HAC.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
rewrite <- H2. ring.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
assumption.

(* Goal: EqF a OF *)
(* Goal: EqF (MulF (DivF a b) b) a *)
rewrite H1.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.


Definition square_dist A B :=
  let (Ac, _) := coordinates_of_point_F A in
  let (Ax, Ay) := Ac in
  let (Bc, _) := coordinates_of_point_F B in
  let (Bx, By) := Bc in
  (Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By).

Definition twice_signed_area4 A B C D :=
  twice_signed_area A B C + twice_signed_area A C D.
Definition Py A B C := square_dist A B + square_dist B C - square_dist A C.
Definition Py4 A B C D := Py A B D - Py C B D.
Definition AM_Cong A B C D := Py A B A =F= Py C D C.
Definition AM_Col A B C := twice_signed_area A B C =F= 0.
Definition AM_Per A B C := Py A B C =F= 0.
Definition AM_Perp A B C D := Py4 A C B D =F= 0.
Definition AM_Par A B C D := twice_signed_area4 A C B D =F= 0.
Definition AM_on_foot Y P U V := AM_Perp Y P U V /\ AM_Col Y U V /\ U <> V.

Lemma Cong_AM_Cong: forall A B C D, AM_Cong A B C D <-> Cong A B C D.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
rewrite characterization_of_congruence_F.
unfold AM_Cong, Py, square_dist.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
split;intro;
nsatz;
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

Lemma Col_AM_Col : forall A B C, AM_Col A B C <-> Col A B C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: @Col Tn E O C *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
unfold AM_Col.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (ratio A P A B) r) (_ : @Col Tn A B P') (_ : EqF (ratio A P' A B) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
rewrite characterization_of_collinearity_F.
(* Goal: EqF (twice_signed_area A B B) OF *)
unfold twice_signed_area, cross_product.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intros HEQ;rewrite <- HEQ;ring.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intros HEQ;rewrite <- HEQ;ring.
Qed.

Lemma Per_AM_Per : forall A B C, AM_Per A B C <-> Per A B C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
split;
rewrite (characterization_of_right_triangle_F);
unfold AM_Per, Py, square_dist;
decompose_coordinates;
intro;
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

Lemma Perp_AM_Perp : forall A B C D,
 (AM_Perp A B C D /\ A <> B /\ C <> D) <-> Perp A B C D.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: iff (and (AM_Perp A B C D) (and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)))) (@Perp Tn A B C D) *)
rewrite (characterization_of_perpendicularity_F).
(* Goal: iff (and (AM_Perp A B C D) (and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
repeat (rewrite characterization_of_neq_F).
(* Goal: iff (and (AM_Perp A B C D) (and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF)))) *)
unfold AM_Perp, Py4, Py, square_dist.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
split;intro.
(* Goal: and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
use H.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
repeat split.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
assumption.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
assumption.
(* Goal: not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
use H;repeat split;try assumption.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
Qed.

Lemma AM_Par_ratio_AM_Par :
 forall P Q C D,
  AM_Par P Q C D -> ratio P Q C D =F= 1 -> C<>D -> AM_Par D Q P C.
Proof.
intros P Q C D H1 H2 H3.
setoid_rewrite characterization_of_neq_F in H3.
unfold AM_Par, twice_signed_area4, twice_signed_area, ratio in *.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
unfold cross_product, scalar_product in *;simpl in *.
assert (((Qx - Px) * (Dx - Cx) + (Qy - Py0) * (Dy - Cy)) =F= ((Dx - Cx) * (Dx - Cx) + (Dy - Cy) * (Dy - Cy))).
assert (((Qx - Px) * (Dx - Cx) + (Qy - Py0) * (Dy - Cy)) /
     ((Dx - Cx) * (Dx - Cx) + (Dy - Cy) * (Dy - Cy)) * ((Dx - Cx) * (Dx - Cx) + (Dy - Cy) * (Dy - Cy))
 =F= ((Dx - Cx) * (Dx - Cx) + (Dy - Cy) * (Dy - Cy))).
(* Goal: EqF (DivF a b) (DivF c d) *)
rewrite H2.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
rewrite <- H.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
rewrite <- H0 in H3.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
apply H3;ring.
(* Goal: EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy)))) *)
put_negs_in_goal.
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.

clear H2.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
Qed.

Lemma Par_AM_Par : forall A B C D,
  (A <> B /\ C <> D /\ AM_Par A B C D) <-> Par A B C D.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
unfold AM_Par, twice_signed_area4, twice_signed_area.
rewrite characterization_of_parallelism_F.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
use H.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split;auto.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
(* Goal: and (EqF (SubF (SubF (AddF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy)))) (SubF (AddF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy)))) (AddF (MulF (SubF Bx Dx) (SubF Bx Dx)) (MulF (SubF By Dy) (SubF By Dy))))) OF) (and (not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (not (EqF (AddF (MulF (SubF Cx Dx) (SubF Cx Dx)) (MulF (SubF Cy Dy) (SubF Cy Dy))) OF))) *)
use H.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split;auto.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
split;auto.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
Qed.

Lemma AM_lower_dim :
 exists A B C, ~ AM_Col A B C.
Proof.
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
exists O. exists E. exists E'.
rewrite Col_AM_Col;auto using ncolOEE'.
Qed.


Lemma signed_area_AAB : forall A B, signed_area A A B =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (signed_area A A B) OF *)
unfold signed_area, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

Lemma signed_area_ABA : forall A B, signed_area A B A =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (signed_area A A B) OF *)
unfold signed_area, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

Lemma signed_area_ABB : forall A B, signed_area A B B =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (signed_area A A B) OF *)
unfold signed_area, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

Lemma twice_signed_area_AAB : forall A B, twice_signed_area A A B =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (twice_signed_area A B B) OF *)
unfold twice_signed_area, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Lemma twice_signed_area_ABA : forall A B, twice_signed_area A B A =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (twice_signed_area A B B) OF *)
unfold twice_signed_area, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Lemma twice_signed_area_ABB : forall A B, twice_signed_area A B B =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (twice_signed_area A B B) OF *)
unfold twice_signed_area, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
Qed.

Lemma twice_signed_area_cyclic :
  forall A B C, twice_signed_area A B C =F= twice_signed_area B C A.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (twice_signed_area A B C) (twice_signed_area B C A) *)
unfold twice_signed_area.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: EqF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Cx Bx) (SubF Ay By)) (MulF (SubF Cy By) (SubF Ax Bx))) *)
field;prove_discr_for_powers_of_2.
Qed.

Lemma twice_signed_area_perm :
 forall A B C, twice_signed_area A B C =F= - twice_signed_area B A C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (twice_signed_area A B C) (twice_signed_area B C A) *)
unfold twice_signed_area.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: EqF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Cx Bx) (SubF Ay By)) (MulF (SubF Cy By) (SubF Ax Bx))) *)
field;prove_discr_for_powers_of_2.
Qed.

Lemma AM_Perp_AM_Perp_AM_Par : forall A B C D U V,
 C<>D ->
 AM_Perp A B C D -> AM_Perp U V C D -> AM_Par A B U V.
Proof.
(* Goal: forall (A B C D U V : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : AM_Perp A B C D) (_ : AM_Par A B U V), AM_Perp U V C D *)
intros A B C D U V.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
destruct (eq_dec_points A B).
(* Goal: AM_Perp U V C D *)
(* Goal: AM_Perp U V C D *)
subst.
unfold AM_Par, twice_signed_area4.
rewrite twice_signed_area_AAB.
rewrite twice_signed_area_ABA.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
(* Goal: AM_Perp U V C D *)
assert (Perp A B C D) by (apply Perp_AM_Perp;auto).
(* Goal: AM_Perp U V C D *)
destruct (eq_dec_points U V).
(* Goal: AM_Perp U V C D *)
(* Goal: AM_Perp U V C D *)
subst.
unfold AM_Par, twice_signed_area4.
rewrite twice_signed_area_perm.
rewrite twice_signed_area_cyclic.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
assert (Perp U V C D) by (apply Perp_AM_Perp;auto).
assert (Par A B U V).
apply par_perp2__par with C D C D;Par;Perp.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply Par_AM_Par;auto.
Qed.


Lemma Py_triv_ABB : forall A B, Py A B B  =F= 0.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
unfold Py, square_dist.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Lemma AM_Perp_triv1 : forall A B C, AM_Perp A B C C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
unfold AM_Perp, Py4.
repeat rewrite Py_triv_ABB.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Lemma AM_Perp_triv2 : forall A B C, AM_Perp A A B C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
unfold AM_Perp, Py4.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Lemma AM_perp_AM_Par_AM_perp : forall A B C D U V,
  A<>B ->
  AM_Perp A B C D -> AM_Par A B U V -> AM_Perp U V C D.
Proof.
(* Goal: forall (A B C D U V : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : AM_Perp A B C D) (_ : AM_Par A B U V), AM_Perp U V C D *)
intros A B C D U V.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: AM_Perp U V C D *)
destruct (eq_dec_points C D).
(* Goal: AM_Perp U V C D *)
(* Goal: AM_Perp U V C D *)
subst.
(* Goal: AM_Perp U V D D *)
(* Goal: AM_Perp U V C D *)
apply AM_Perp_triv1.
(* Goal: AM_Perp U V C D *)
destruct (eq_dec_points U V).
(* Goal: AM_Perp U V C D *)
(* Goal: AM_Perp U V C D *)
subst.
(* Goal: AM_Perp V V C D *)
(* Goal: AM_Perp U V C D *)
apply AM_Perp_triv2.
(* Goal: AM_Perp U V C D *)
assert (Perp A B C D) by (apply Perp_AM_Perp;auto).
(* Goal: AM_Perp U V C D *)
assert (Par A B U V) by (apply Par_AM_Par;auto).
(* Goal: AM_Perp U V C D *)
assert (Perp U V C D).
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
 apply par_perp__perp with A B;auto.
(* Goal: @PythRel Tn O E E' A B O *)
(* Goal: or (@Ps Tn O E O) (@eq (@Tpoint Tn) O O) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
apply Perp_AM_Perp;auto.
Qed.

Lemma perp_triangle_area : forall A B C, A<>C -> AM_Per A B C ->
  twice_signed_area A B C * twice_signed_area A B C =F= square_dist A B * square_dist B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A C)) (_ : AM_Per A B C), EqF (MulF (twice_signed_area A B C) (twice_signed_area A B C)) (MulF (square_dist A B) (square_dist B C)) *)
intros A B C.
(* Goal: forall (_ : not (@eq (@Tpoint Tn) A C)) (_ : AM_Per A B C), EqF (MulF (twice_signed_area A B C) (twice_signed_area A B C)) (MulF (square_dist A B) (square_dist B C)) *)
rewrite Per_AM_Per.
(* Goal: forall (_ : not (@eq (@Tpoint Tn) A C)) (_ : @Per Tn A B C), EqF (MulF (twice_signed_area A B C) (twice_signed_area A B C)) (MulF (square_dist A B) (square_dist B C)) *)
rewrite characterization_of_right_triangle_F.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F C in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF), EqF (MulF (twice_signed_area A B C) (twice_signed_area A B C)) (MulF (square_dist A B) (square_dist B C)) *)
unfold twice_signed_area, AM_Per, Py, square_dist, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy)))) *)
put_negs_in_goal.
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
Qed.

Lemma triangle_area : forall A B C H,
  AM_on_foot H A B C ->
  twice_signed_area A B C * twice_signed_area A B C =F= square_dist A H * square_dist B C.
Proof.
intros A B C H.
unfold AM_on_foot, AM_Col, AM_Perp, Py4, Py, square_dist, twice_signed_area, cross_product.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
use H0.
(* Goal: EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy)))) *)
put_negs_in_goal.
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

(* We do not need that Col A B C. *)

Lemma chasles_ratios : forall A B C P Q,
  P <> Q -> ratio A B P Q + ratio B C P Q =F= ratio A C P Q.
Proof.
intros A B C P Q.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
unfold ratio, scalar_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: False *)
apply H.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) OF *)
rewrite <- H0.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Lemma ratio_zero : forall A B C D, C<>D -> AM_Par A B C D ->  (ratio A B C D =F= 0 -> A = B).
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Par Tn A D B C), EqF (signed_area A B C) (signed_area D B C) *)
intros A B C D.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Col Tn A B P) (_ : EqF (ratio A P A B) r) (_ : @Col Tn A B P') (_ : EqF (ratio A P' A B) r), @eq (@Tpoint Tn) P P' *)
rewrite characterization_of_equality_F.
unfold AM_Par, ratio, twice_signed_area4, twice_signed_area, scalar_product, cross_product .
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
apply (field_prop_zero) in H1.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy)))) *)
put_negs_in_goal.
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy)))) *)
put_negs_in_goal.
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: False *)
apply H.
rewrite <- H2.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Lemma axiom_A2b : forall A B P P' r,
 A<>B -> Col A B P ->
 ratio A P A B =F= r ->
 Col A B P' ->
 ratio A P' A B =F= r ->
 P = P'.
Proof.
(* Goal: forall (A B P P' : @Tpoint Tn) (r : F) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Col Tn A B P) (_ : EqF (ratio A P A B) r) (_ : @Col Tn A B P') (_ : EqF (ratio A P' A B) r), @eq (@Tpoint Tn) P P' *)
intros A B P P' r.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Col Tn A B P) (_ : EqF (ratio A P A B) r) (_ : @Col Tn A B P') (_ : EqF (ratio A P' A B) r), @eq (@Tpoint Tn) P P' *)
rewrite characterization_of_equality_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (ratio A P A B) r) (_ : @Col Tn A B P') (_ : EqF (ratio A P' A B) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
rewrite characterization_of_collinearity_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (ratio A P A B) r) (_ : @Col Tn A B P') (_ : EqF (ratio A P' A B) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
rewrite characterization_of_collinearity_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (ratio A P A B) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (ratio A P' A B) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
unfold ratio, scalar_product in *.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
simpl in *.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
apply field_prop_1 in H1;
apply field_prop_1 in H3.
put_negs_in_goal;
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intro;apply H;rewrite <- H4;ring.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intro;apply H;rewrite <- H4;ring.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intro;apply H;rewrite <- H4;ring.
apply field_prop_1 in H1;
apply field_prop_1 in H3.
put_negs_in_goal;
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intro;apply H;rewrite <- H4;ring.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intro;apply H;rewrite <- H4;ring.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
intro;apply H;rewrite <- H4;ring.
Qed.

Ltac decompose_coordinates' :=
  repeat
  match goal with
    H: _ |- context[ (coordinates_of_point_F ?X) ] =>
      let fx := fresh X "x" in
      let fy := fresh X "y" in
      let HX := fresh "H" X in
      destruct (coordinates_of_point_F X) as [[fx fy] HX]
  end.

Lemma axiom_A2a : forall A B r, A<>B ->
  exists P, AM_Col A B P /\ ratio A P A B =F= r.
Proof.
(* Goal: forall (A B : @Tpoint Tn) (r : F) (_ : not (@eq (@Tpoint Tn) A B)), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
intros A B r.
(* Goal: forall _ : not (@eq (@Tpoint Tn) A B), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
rewrite characterization_of_neq_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (ratio A P A B) r)) *)
unfold ratio,scalar_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.

destruct (  let Ac:= proj1_sig (coordinates_of_point_F A) in
            let Ax := fst Ac in
            let Ay := snd Ac in
            let Bc:= proj1_sig (coordinates_of_point_F B) in
            let Bx := fst Bc in
            let By := snd Bc in
  point_of_coordinates O E SS U1 U2 (proj1_sig (Ax + r*(Bx-Ax)))
                                         (proj1_sig (Ay + r*(By-Ay))) orthonormal_grid
                                         (proj2_sig (Ax + r*(Bx-Ax)))
                                         (proj2_sig (Ay + r*(By-Ay)))) as [P HP].
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r)) *)
exists P.
(* Goal: and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
revert HP.
(* Goal: forall _ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))))))), and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
revert H.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A)))))))), and (AM_Col A B P) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold AM_Col, twice_signed_area, cross_product.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A))) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F A)))))))), and (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (@fst F F (@pair F F (SubF Bx Ax) (SubF By Ay))) (@snd F F (@pair F F (SubF Cx Ax) (SubF Cy Ay)))) (MulF (@snd F F (@pair F F (SubF Bx Ax) (SubF By Ay))) (@fst F F (@pair F F (SubF Cx Ax) (SubF Cy Ay))))) OF) (EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
elim (coordinates_of_point_F A).
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.
(* Goal: forall (x : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (_ : let (Ax, Ay) := x in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@fst F F x))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (coordinates_of_point_F B))) (@snd F F x)))))), and (EqF (let (Ax, Ay) := x in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
elim (coordinates_of_point_F B).
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
simpl in *.
(* Goal: and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
destruct x0.
(* Goal: and (EqF (let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx f) (SubF Cy f0)) (MulF (SubF By f0) (SubF Cx f))) OF) (EqF (let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx f) (SubF Dx f)) (MulF (SubF By f0) (SubF Dy f0))) (AddF (MulF (SubF Dx f) (SubF Dx f)) (MulF (SubF Dy f0) (SubF Dy f0)))) r) *)
destruct x.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
simpl in *.
(* Goal: and (EqF (let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF f1 f) (SubF Cy f0)) (MulF (SubF f2 f0) (SubF Cx f))) OF) (EqF (let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in DivF (AddF (MulF (SubF Bx f) (SubF f1 f)) (MulF (SubF By f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
decompose_coordinates'.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
simpl in *.
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
destruct (Cd_Cd_EqF P _ _ _ _ HP HP0) as [HA HB].
(* Goal: and (EqF (SubF (MulF (SubF f1 f) (SubF Py0 f0)) (MulF (SubF f2 f0) (SubF Px f))) OF) (EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r) *)
split.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
rewrite <- HA;rewrite <- HB;ring.
(* Goal: EqF (DivF (AddF (MulF (SubF Px f) (SubF f1 f)) (MulF (SubF Py0 f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
rewrite <- HA;rewrite <- HB.
(* Goal: EqF (DivF (AddF (MulF (SubF (AddF f (MulF r (SubF f1 f))) f) (SubF f1 f)) (MulF (SubF (AddF f0 (MulF r (SubF f2 f0))) f0) (SubF f2 f0))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0)))) r *)
field.
(* Goal: not (EqF (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) OF) *)
intro.
(* Goal: False *)
apply H.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) OF *)
rewrite <- H0.
(* Goal: EqF (AddF (MulF (SubF f f1) (SubF f f1)) (MulF (SubF f0 f2) (SubF f0 f2))) (AddF (MulF (SubF f1 f) (SubF f1 f)) (MulF (SubF f2 f0) (SubF f2 f0))) *)
ring.
Qed.

Definition AM_CongAL A B C D E F := Py A B C * twice_signed_area D E F =F= Py D E F * twice_signed_area A B C.

(** This shows that we have a notion of congruence of line angles, every angle is congruent to its supplement. *)

Lemma supplement_AM_CongA : forall A B M C, Midpoint M A B -> AM_CongAL  A M C B M C.
Proof.
intros A B M C.
unfold AM_CongAL, twice_signed_area, Py, square_dist.
rewrite characterization_of_midpoint_F.
(* Goal: forall (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) (_ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F P' in let (Cx, Cy) := Cc in EqF (SubF (MulF (SubF Ax Bx) (SubF By Cy)) (MulF (SubF Ay By) (SubF Bx Cx))) OF) (_ : EqF (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F A in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F B in let (Dx, Dy) := Dc in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r), let (Ac, _) := coordinates_of_point_F P in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F P' in let (Bx, By) := Bc in and (EqF Ax Bx) (EqF Ay By) *)
decompose_coordinates.
unfold cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
simpl.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros;spliter.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

Lemma exists_equilateral_triangle : forall A B,
  exists C, Cong A B A C /\ Cong A B B C.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
destruct (exists_cong_per A B A B) as [P HP].
destruct (exists_cong_per A P A B) as [Q HQ].
destruct (midpoint_existence A Q) as [R HR].
destruct (midpoint_existence A B) as [I HI].
destruct (exists_cong_per A I A R) as [C HC].
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @ex (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
(* Goal: @uniqueness (@Tpoint Tn) (fun x : @Tpoint Tn => and (@PythRel Tn O E E' A B x) (or (@Ps Tn O E x) (@eq (@Tpoint Tn) x O))) *)
exists C.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
revert dependent A .
intro A.
convert_to_algebra.
decompose_coordinates; intros; spliter;
split;
nsatz;
(* Goal: not (EqF TwoF OF) *)
prove_discr_for_powers_of_2.
Qed.

(*
(** This is Euclid Book I, Prop 35 *)
Lemma parallelograms_same_base :
 forall A B C D E F,
 Plg A B C D ->
 Plg E B C F ->
 Col A E F ->
 Col D E F ->
 signed_area4 A B C D =F= signed_area4 E B C F.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
unfold signed_area4.
convert_to_algebra.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
decompose_coordinates; intros; spliter.
*)


(*
(** This is Euclid Book I, Prop 36 *)
Lemma parallelograms_equal_bases :
 forall A B C D E F G H,
 A<>B ->
 B<>C ->
 E<>F ->
 F<>G ->
 Parallelogram A B C D ->
 Parallelogram E F G H ->
 Cong B C F G ->
 Col A E H ->
 Col D E H ->
 signed_area4 A B C D =F= signed_area4 E F G H.
Proof.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.

apply plg_par in H4;[idtac|auto|auto].
apply plg_par in H5;[idtac|auto|auto].
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
revert H4 H10 H5 H9 H6 H7 H9.
setoid_rewrite characterization_of_parallelism_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
setoid_rewrite characterization_of_collinearity_F.
(* Goal: forall _ : @Midpoint Tn B C D, iff (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF) *)
setoid_rewrite characterization_of_congruence_F.
unfold signed_area4, signed_area, cross_product.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros;spliter.
put_negs_in_goal;
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
right.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
right.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
right.
(* Goal: or (and (@Ps Tn O E x) (@Ps Tn O E y)) (@eq (@Tpoint Tn) x O) *)
right.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.

setoid_rewrite characterization_of_parallelism_F.
*)

(** This is Euclid Book I, Prop 37 *)

Lemma triangles_same_base :
 forall A B C D,
 Par A D B C ->
 signed_area A B C =F= signed_area D B C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Par Tn A D B C), EqF (signed_area A B C) (signed_area D B C) *)
intros A B C D.
(* Goal: forall _ : @Par Tn A D B C, EqF (signed_area A B C) (signed_area D B C) *)
unfold signed_area.
setoid_rewrite characterization_of_parallelism_F.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: forall _ : and (EqF (SubF (MulF (SubF Ax Dx) (SubF By Cy)) (MulF (SubF Ay Dy) (SubF Bx Cx))) OF) (and (not (EqF (AddF (MulF (SubF Ax Dx) (SubF Ax Dx)) (MulF (SubF Ay Dy) (SubF Ay Dy))) OF)) (not (EqF (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))) OF))), EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
spliter.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
nsatz.
Qed.

(*
(** This is Euclid Book I, Prop 38 *)

Lemma triangles_equal_bases :
 forall A B C D E F,
 Par A D B C ->
 Col B C E ->
 Col B C F ->
 Cong B C E F ->
 signed_area A B C =F= signed_area D E F.
Proof.
intros A B C D E F.

(* Goal: forall _ : @Par Tn A D B C, EqF (signed_area A B C) (signed_area D B C) *)
unfold signed_area.
setoid_rewrite characterization_of_parallelism_F.
(* Goal: forall _ : let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in let (Dc, _) := coordinates_of_point_F D in let (Dx, Dy) := Dc in and (EqF (AddF (MulF (SubF Ax Bx) (SubF Cx Dx)) (MulF (SubF Ay By) (SubF Cy Dy))) OF) (and (or (not (EqF Ax Bx)) (not (EqF Ay By))) (or (not (EqF Cx Dx)) (not (EqF Cy Dy)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (let (Ac, _) := coordinates_of_point_F C in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F D in let (Bx, By) := Bc in or (not (EqF Ax Bx)) (not (EqF Ay By))) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) *)
setoid_rewrite characterization_of_collinearity_F.
(* Goal: forall _ : @Midpoint Tn B C D, iff (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (let (Ac, _) := coordinates_of_point_F A in let (Ax, Ay) := Ac in let (Bc, _) := coordinates_of_point_F B in let (Bx, By) := Bc in let (Cc, _) := coordinates_of_point_F C in let (Cx, Cy) := Cc in EqF (AddF (MulF (SubF Ax Bx) (SubF Bx Cx)) (MulF (SubF Ay By) (SubF By Cy))) OF) *)
setoid_rewrite characterization_of_congruence_F.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
decompose_coordinates;simpl.
(* Goal: forall (x : prod F F) (p : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x))) (x0 : prod F F) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 A (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F x0)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F x0))) (_ : let (Ax, Ay) := x0 in let (Bx, By) := x in not (EqF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) OF)) (_ : @Cd Tn (@O Tn) (@E Tn) SS U1 U2 P (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@fst F F x0) (MulF r (SubF (@fst F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@fst F F x0))))) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (AddF (@snd F F x0) (MulF r (SubF (@snd F F (@proj1_sig (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) (@exist (prod F F) (fun C : prod F F => @Cd Tn (@O Tn) (@E Tn) SS U1 U2 B (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@fst F F C)) (@proj1_sig (@Tpoint Tn) (fun P : @Tpoint Tn => @Col Tn (@O Tn) (@E Tn) P) (@snd F F C))) x p))) (@snd F F x0)))))), and (EqF (let (Ax, Ay) := x0 in let (Bx, By) := x in let (Cc, _) := coordinates_of_point_F P in let (Cx, Cy) := Cc in SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) OF) (EqF (let (Ax, Ay) := x0 in let (Bc, _) := coordinates_of_point_F P in let (Bx, By) := Bc in let (Cx, Cy) := x0 in let (Dx, Dy) := x in DivF (AddF (MulF (SubF Bx Ax) (SubF Dx Cx)) (MulF (SubF By Ay) (SubF Dy Cy))) (AddF (MulF (SubF Dx Cx) (SubF Dx Cx)) (MulF (SubF Dy Cy) (SubF Dy Cy)))) r) *)
unfold cross_product;simpl.
(* Goal: EqF (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (DivF OneF TwoF) (SubF (MulF (SubF Bx Dx) (SubF Cy Dy)) (MulF (SubF By Dy) (SubF Cx Dx)))) *)
intros;spliter.
put_negs_in_goal;
(* Goal: or (EqF (AddF (MulF (SubF Ax Cx) (SubF Ax Cx)) (MulF (SubF Ay Cy) (SubF Ay Cy))) OF) (EqF (MulF (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax))) (SubF (MulF (SubF Bx Ax) (SubF Cy Ay)) (MulF (SubF By Ay) (SubF Cx Ax)))) (MulF (AddF (MulF (SubF Ax Bx) (SubF Ax Bx)) (MulF (SubF Ay By) (SubF Ay By))) (AddF (MulF (SubF Bx Cx) (SubF Bx Cx)) (MulF (SubF By Cy) (SubF By Cy))))) *)
express_disj_as_a_single_poly.
*)

(*
(** This is Euclid Book I, Prop 39 *)

Lemma triangle_equal_parallel:
 forall A B C D,
 signed_area A B C =F= signed_area D B C ->
 OS B C A D ->
 Par A D B C.
Proof.
*)

End T18.