(** This lemma used to be an axiom in previous versions of Tarski's axiom system. It is a been shown to a theorem by Gupta in his Phd 1965. *)
(** This corresponds to l9_6 in Tarski's book. *)

(* Specifications: *)
Lemma outer_pasch : forall A B C P Q,
Bet A C P -> Bet B Q C -> exists X, Bet A X B /\ Bet P Q X.
Lemma os_distincts : forall A B X Y, OS A B X Y ->
A <> B /\ A <> X /\ A <> Y /\ B <> X /\ B <> Y.
Lemma invert_one_side : forall A B P Q,
OS A B P Q -> OS B A P Q.
Lemma l9_8_1 : forall P Q A B C, TS P Q A C -> TS P Q B C -> OS P Q A B.
Lemma not_two_sides_id : forall A P Q, ~ TS P Q A A.
Lemma l9_8_2 : forall P Q A B C,
TS P Q A C ->
OS P Q A B ->
TS P Q B C.
Lemma l9_9 : forall P Q A B, TS P Q A B -> ~ OS P Q A B.
Lemma l9_9_bis : forall P Q A B, OS P Q A B -> ~ TS P Q A B.
Lemma one_side_chara : forall P Q A B,
OS P Q A B -> (forall X, Col X P Q -> ~ Bet A X B).
Lemma l9_10 : forall P Q A,
~ Col A P Q -> exists C, TS P Q A C.
Lemma one_side_reflexivity : forall P Q A,
~ Col A P Q -> OS P Q A A.
Lemma one_side_symmetry : forall P Q A B,
OS P Q A B -> OS P Q B A.
Lemma one_side_transitivity : forall P Q A B C,
OS P Q A B -> OS P Q B C -> OS P Q A C.
Lemma col_eq : forall A B X Y,
A <> X -> Col A X Y -> Col B X Y ->
~ Col A X B ->
X = Y.
Lemma l9_17 : forall A B C P Q, OS P Q A C -> Bet A B C -> OS P Q A B.
Lemma l9_18 : forall X Y A B P,
Col X Y P -> Col A B P -> (TS X Y A B <-> (Bet A P B /\ ~Col X Y A /\ ~Col X Y B)).
Lemma l9_19 : forall X Y A B P ,
Col X Y P -> Col A B P -> (OS X Y A B <-> (Out P A B /\ ~Col X Y A)).
Lemma one_side_not_col123 :
forall A B X Y,
OS A B X Y ->
~ Col A B X.
Lemma one_side_not_col124 :
forall A B X Y,
OS A B X Y ->
~ Col A B Y.
Lemma col_two_sides : forall A B C P Q,
Col A B C -> A <> C -> TS A B P Q ->
TS A C P Q.
Lemma col_one_side : forall A B C P Q,
Col A B C -> A <> C -> OS A B P Q -> OS A C P Q.
Lemma out_out_one_side :
forall A B X Y Z,
OS A B X Y ->
Out A Y Z ->
OS A B X Z.
Lemma out_one_side : forall A B X Y, (~ Col A B X \/ ~ Col A B Y) -> Out A X Y -> OS A B X Y.
Lemma bet_ts__ts : forall A B X Y Z, TS A B X Y -> Bet X Y Z -> TS A B X Z.
Lemma bet_ts__os : forall A B X Y Z, TS A B X Y -> Bet X Y Z -> OS A B Y Z.
Lemma l9_31 :
forall A X Y Z,
OS A X Y Z ->
OS A Z Y X ->
TS A Y X Z.
Lemma col123__nos : forall A B P Q, Col P Q A -> ~ OS P Q A B.
Lemma col124__nos : forall A B P Q, Col P Q B -> ~ OS P Q A B.
Lemma col2_os__os : forall A B C D X Y, C <> D -> Col A B C ->
Col A B D -> OS A B X Y -> OS C D X Y.
Lemma os_out_os : forall A B C D C' P , Col A B P -> OS A B C D -> Out P C C' -> OS A B C' D.
Lemma ts_ts_os : forall A B C D, TS A B C D -> TS C D A B -> OS A C B D.
Lemma two_sides_not_col :
forall A B X Y,
TS A B X Y ->
~ Col A B X.
Lemma col_one_side_out : forall A B X Y,
Col A X Y ->
OS A B X Y ->
Out A X Y.
Lemma col_two_sides_bet :
forall A B X Y,
Col A X Y ->
TS A B X Y ->
Bet X A Y.
Lemma os_ts1324__os : forall A X Y Z,
OS A X Y Z ->
TS A Y X Z ->
OS A Z X Y.
Lemma ts2__ex_bet2 : forall A B C D, TS A C B D -> TS B D A C ->
exists X, Bet A X C /\ Bet B X D.
Lemma ts2__inangle : forall A B C P, TS A C B P -> TS B P A C ->
InAngle P A B C.
Lemma out_one_side_1 :
forall A B C D X,
~ Col A B C -> Col A B X -> Out X C D ->
OS A B C D.
Lemma out_two_sides_two_sides :
forall A B X Y P PX,
A <> PX ->
Col A B PX ->
Out PX X P ->
TS A B P Y ->
TS A B X Y.
Lemma l8_21_bis : forall A B C X Y, X <> Y -> ~ Col C A B -> exists P : Tpoint,
Cong A P X Y /\ Perp A B P A /\ TS A B C P.
Lemma ts__ncol : forall A B X Y, TS A B X Y -> ~Col A X Y \/ ~Col B X Y.
Lemma one_or_two_sides_aux : forall A B C D X,
~ Col C A B -> ~ Col D A B -> Col A C X -> Col B D X ->
TS A B C D \/ OS A B C D.
Lemma cop__one_or_two_sides :
forall A B C D, Coplanar A B C D ->
~ Col C A B ->
~ Col D A B ->
TS A B C D \/ OS A B C D.
Lemma os__coplanar : forall A B C D, OS A B C D -> Coplanar A B C D.
Lemma coplanar_trans_1 : forall P Q R A B,
~ Col P Q R -> Coplanar P Q R A -> Coplanar P Q R B -> Coplanar Q R A B.
Lemma coplanar_pseudo_trans : forall A B C D P Q R,
~ Col P Q R ->
Coplanar P Q R A ->
Coplanar P Q R B ->
Coplanar P Q R C ->
Coplanar P Q R D ->
Coplanar A B C D.
Lemma col_cop__cop : forall A B C D E, Coplanar A B C D -> C <> D -> Col C D E -> Coplanar A B C E.
Lemma bet_cop__cop : forall A B C D E, Coplanar A B C E -> Bet C D E -> Coplanar A B C D.
Lemma col2_cop__cop : forall A B C D E F, Coplanar A B C D -> C <> D -> Col C D E -> Col C D F ->
Coplanar A B E F.
Lemma l9_30 : forall A B C D E F P X Y Z,
~ Coplanar A B C P -> ~ Col D E F -> Coplanar D E F P ->
Coplanar A B C X -> Coplanar A B C Y -> Coplanar A B C Z ->
Coplanar D E F X -> Coplanar D E F Y -> Coplanar D E F Z ->
Col X Y Z.
Lemma cop_per2__col : forall A X Y Z,
Coplanar A X Y Z ->  A <> Z -> Per X Z A -> Per Y Z A -> Col X Y Z.
Lemma cop_perp2__col : forall X Y Z A B,
Coplanar A B Y Z -> Perp X Y A B -> Perp X Z A B -> Col X Y Z.
Lemma two_sides_dec : forall A B C D, TS A B C D \/ ~ TS A B C D.
Lemma cop__not_two_sides_one_side :
forall A B C D,
Coplanar A B C D ->
~ Col C A B ->
~ Col D A B ->
~ TS A B C D ->
OS A B C D.
Lemma cop__not_one_side_two_sides :
forall A B C D,
Coplanar A B C D ->
~ Col C A B ->
~ Col D A B ->
~ OS A B C D ->
TS A B C D.
Lemma one_side_dec : forall A B C D,
OS A B C D \/ ~ OS A B C D.
Lemma cop_dec : forall A B C D,
Coplanar A B C D \/ ~ Coplanar A B C D.
Lemma ex_diff_cop : forall A B C D, exists E,
Coplanar A B C E /\ D <> E.
Lemma ex_ncol_cop : forall A B C D E, D <> E ->
exists F, Coplanar A B C F /\ ~ Col D E F.
Lemma ex_ncol_cop2 : forall A B C D, exists E F,
Coplanar A B C E /\ Coplanar A B C F /\ ~ Col D E F.
Lemma cop4__col : forall A1 A2 A3 B1 B2 B3 P Q R, ~ Coplanar A1 A2 A3 B1 -> ~ Col B1 B2 B3 ->
Coplanar A1 A2 A3 P -> Coplanar B1 B2 B3 P ->
Coplanar A1 A2 A3 Q -> Coplanar B1 B2 B3 Q ->
Coplanar A1 A2 A3 R -> Coplanar B1 B2 B3 R ->
Col P Q R.
Lemma col_cop2__cop : forall A B C U V P, U <> V ->
Coplanar A B C U -> Coplanar A B C V -> Col U V P ->
Coplanar A B C P.
Lemma bet_cop2__cop : forall A B C U V W,
Coplanar A B C U -> Coplanar A B C W -> Bet U V W -> Coplanar A B C V.
Lemma col2_cop2__eq : forall A B C U V P Q, ~ Coplanar A B C U -> U <> V ->
Coplanar A B C P -> Coplanar A B C Q -> Col U V P -> Col U V Q ->
P = Q.
Lemma cong3_cop2__col : forall A B C P Q,
Coplanar A B C P -> Coplanar A B C Q ->
P <> Q -> Cong A P A Q -> Cong B P B Q -> Cong C P C Q ->
Col A B C.
Lemma l9_38 : forall A B C P Q, TSP A B C P Q -> TSP A B C Q P.
Lemma l9_39 : forall A B C D P Q R, TSP A B C P R -> Coplanar A B C D -> Out D P Q ->
TSP A B C Q R.
Lemma l9_41_1 : forall A B C P Q R, TSP A B C P R -> TSP A B C Q R -> OSP A B C P Q.
Lemma l9_41_2 : forall A B C P Q R, TSP A B C P R -> OSP A B C P Q -> TSP A B C Q R.
Lemma tsp_exists : forall A B C P, ~ Coplanar A B C P -> exists Q, TSP A B C P Q.
Lemma osp_reflexivity : forall A B C P, ~ Coplanar A B C P -> OSP A B C P P.
Lemma osp_symmetry : forall A B C P Q, OSP A B C P Q -> OSP A B C Q P.
Lemma osp_transitivity : forall A B C P Q R, OSP A B C P Q -> OSP A B C Q R -> OSP A B C P R.
Lemma cop3_tsp__tsp : forall A B C D E F P Q, ~ Col D E F ->
Coplanar A B C D -> Coplanar A B C E -> Coplanar A B C F ->
TSP A B C P Q -> TSP D E F P Q.
Lemma cop3_osp__osp : forall A B C D E F P Q, ~ Col D E F ->
Coplanar A B C D -> Coplanar A B C E -> Coplanar A B C F ->
OSP A B C P Q -> OSP D E F P Q.
Lemma ncop_distincts : forall A B C D, ~ Coplanar A B C D ->
A <> B /\ A <> C /\ A <> D /\ B <> C /\ B <> D /\ C <> D.
Lemma tsp_distincts : forall A B C P Q, TSP A B C P Q ->
A <> B /\ A <> C /\ B <> C /\ A <> P /\ B <> P /\ C <> P /\ A <> Q /\ B <> Q /\ C <> Q /\ P <> Q.
Lemma osp_distincts : forall A B C P Q, OSP A B C P Q ->
A <> B /\ A <> C /\ B <> C /\ A <> P /\ B <> P /\ C <> P /\ A <> Q /\ B <> Q /\ C <> Q.
Lemma tsp__ncop1 : forall A B C P Q, TSP A B C P Q -> ~ Coplanar A B C P.
Lemma tsp__ncop2 : forall A B C P Q, TSP A B C P Q -> ~ Coplanar A B C Q.
Lemma osp__ncop1 : forall A B C P Q, OSP A B C P Q -> ~ Coplanar A B C P.
Lemma osp__ncop2 : forall A B C P Q, OSP A B C P Q -> ~ Coplanar A B C Q.
Lemma tsp__nosp : forall A B C P Q, TSP A B C P Q -> ~ OSP A B C P Q.
Lemma osp__ntsp : forall A B C P Q, OSP A B C P Q -> ~ TSP A B C P Q.
Lemma osp_bet__osp : forall A B C P Q R, OSP A B C P R -> Bet P Q R -> OSP A B C P Q.
Lemma l9_18_3 : forall A B C X Y P, Coplanar A B C P -> Col X Y P ->
TSP A B C X Y <-> Bet X P Y /\ ~ Coplanar A B C X /\ ~ Coplanar A B C Y.
Lemma bet_cop__tsp : forall A B C X Y P,
~ Coplanar A B C X -> P <> Y -> Coplanar A B C P -> Bet X P Y ->
TSP A B C X Y.
Lemma cop_out__osp : forall A B C X Y P,
~ Coplanar A B C X -> Coplanar A B C P -> Out P X Y -> OSP A B C X Y.
Lemma l9_19_3 : forall A B C X Y P, Coplanar A B C P -> Col X Y P ->
OSP A B C X Y <-> Out P X Y /\ ~ Coplanar A B C X.
Lemma cop2_ts__tsp : forall A B C D E X Y, ~ Coplanar A B C X ->
Coplanar A B C D -> Coplanar A B C E -> TS D E X Y ->
TSP A B C X Y.
Lemma cop2_os__osp : forall A B C D E X Y, ~ Coplanar A B C X ->
Coplanar A B C D -> Coplanar A B C E -> OS D E X Y ->
OSP A B C X Y.
Lemma cop3_tsp__ts : forall A B C D E X Y, D <> E ->
Coplanar A B C D -> Coplanar A B C E -> Coplanar D E X Y ->
TSP A B C X Y -> TS D E X Y.
Lemma cop3_osp__os : forall A B C D E X Y, D <> E ->
Coplanar A B C D -> Coplanar A B C E -> Coplanar D E X Y ->
OSP A B C X Y -> OS D E X Y.
Lemma cop_tsp__ex_cop2 : forall A B C D E P,
Coplanar A B C P -> TSP A B C D E ->
exists Q, Coplanar A B C Q /\ Coplanar D E P Q /\ P <> Q.
Lemma cop_osp__ex_cop2 : forall A B C D E P,
Coplanar A B C P -> OSP A B C D E ->
exists Q, Coplanar A B C Q /\ Coplanar D E P Q /\ P <> Q.