(** This following result is very important, it shows the existence of a midpoint. The proof is involved because we are not using continuity axioms. *)
(** This corresponds to l8_22 in Tarski's book. *)

(* Specifications: *)
Lemma midpoint_existence : forall A B, exists X, Midpoint X A B.
Lemma perp_in_id : forall A B C X, Perp_at X A B C A -> X = A.
Lemma l8_22 : forall A B P R X ,
A <> B -> A <> P ->
Per B A P -> Per A B R ->
Cong A P B R -> Col A B X -> Bet P X R ->
Cong A R P B /\ Midpoint X A B /\ Midpoint X P R.
Lemma l8_22_bis : forall A B P R X,
A <> B -> A <> P ->
Perp A B P A -> Perp A B R B ->
Cong A P B R -> Col A B X -> Bet P X R ->
Cong A R P B /\ Midpoint X A B /\ Midpoint X P R.
Lemma perp_in_perp : forall A B C D X, Perp_at X A B C D -> Perp A B C D.
End T8_4.