(** In this file, we prove that all the following properties are equivalent. *)

(** If three points A, B and C are equidistant to three distinct points P, Q and R,
    then A, B and C are collinear. *)

Definition upper_dim_3_axiom := forall A B C P Q R,
  P <> Q -> Q <> R -> P <> R ->
  Cong A P A Q -> Cong B P B Q -> Cong C P C Q ->
  Cong A P A R -> Cong B P B R -> Cong C P C R ->
  (Bet A B C \/ Bet B C A \/ Bet C A B).(** If four points are equidistant to two distinct points, then they are coplanar. *)

Definition median_planes_axiom := forall A B C D P Q, P <> Q ->
  Cong A P A Q -> Cong B P B Q -> Cong C P C Q -> Cong D P D Q ->
  Coplanar A B C D.(** If two planes meet in some point, then they also meet in another point. *)

Definition plane_intersection_axiom := forall A B C D E F P,
  Coplanar A B C P -> Coplanar D E F P ->
  exists Q, Coplanar A B C Q /\ Coplanar D E F Q /\ P <> Q.(** If two points do not lie on a plane, then they are either
    on opposite sides or on the same side of the plane. *)

Definition space_separation_axiom := forall A B C P Q,
  ~ Coplanar A B C P -> ~ Coplanar A B C Q -> TSP A B C P Q \/ OSP A B C P Q.(** The line segments SU1, SU2, SU3 and SU4 can not form an orthonormal family *)

Definition orthonormal_family_axiom := forall S U1' U1 U2 U3 U4,
  ~ (S <> U1' /\ Bet U1 S U1' /\
     Cong S U1 S U1' /\ Cong S U2 S U1' /\ Cong S U3 S U1' /\ Cong S U4 S U1' /\
     Cong U1 U2 U1' U2 /\ Cong U1 U3 U1' U2 /\ Cong U1 U4 U1' U2 /\
     Cong U2 U3 U1' U2 /\ Cong U2 U4 U1' U2 /\ Cong U3 U4 U1' U2).

(* Specifications: *)
Lemma upper_dim_3_stab : ~ ~ upper_dim_3_axiom -> upper_dim_3_axiom.
Lemma median_planes_implies_upper_dim : median_planes_axiom -> upper_dim_3_axiom.
Lemma median_planes_aux : (forall A B C P Q M, P <> Q -> Cong A P A Q -> Cong B P B Q -> Cong C P C Q -> Midpoint M P Q -> Coplanar M A B C) -> median_planes_axiom.
Lemma orthonormal_family_aux : orthonormal_family_axiom <-> (forall A B X P Q, ~ Col P Q X -> Per A X P -> Per A X Q -> Per B X P -> Per B X Q -> Col A B X).
Lemma upper_dim_implies_orthonormal_family_axiom : upper_dim_3_axiom -> orthonormal_family_axiom.
Lemma orthonormal_family_axiom_implies_orth_at2__col : orthonormal_family_axiom -> (forall A B C P Q X, Orth_at X A B C X P -> Orth_at X A B C X Q -> Col P Q X).
Lemma orthonormal_family_axiom_implies_not_two_sides_one_side : orthonormal_family_axiom -> (forall A B C X Y, ~ Coplanar A B C X -> ~ Coplanar A B C Y -> ~ TSP A B C X Y -> OSP A B C X Y).
Lemma orthonormal_family_axiom_implies_space_separation : orthonormal_family_axiom -> space_separation_axiom.
Lemma space_separation_implies_plane_intersection : space_separation_axiom -> plane_intersection_axiom.
Lemma plane_intersection_implies_space_separation : plane_intersection_axiom -> space_separation_axiom.
Lemma space_separation_implies_median_planes : space_separation_axiom -> median_planes_axiom.
Theorem upper_dim_3_equivalent_axioms : all_equiv (upper_dim_3_axiom:: orthonormal_family_axiom:: space_separation_axiom:: plane_intersection_axiom:: median_planes_axiom:: nil).