(*========================================================== ============================================================ TOPOLOGICAL FMAPS, HMAPS - WITH TAGS AND EMBEDDINGS PROOF OF THE JORDAN THEOREM  PART 10: FORMALIZATION AND PROOF OF JCT WITH A 2008 NEW RING FORMALIZATION  expf, genus, planar / B, RINGS, JCT   OK: COMPLETE!! ============================================================ ==========================================================*)
(* cd Desktop/JORDAN_2008 coqtop -opt *)
(* ABOUT ... min: Load Jordan1. Load Jordan2. Load Jordan3. Load Jordan4. Load Jordan5. Load Jordan6. Load Jordan7. Load Jordan8. Load Jordan9. *)
Require Export Jordan9.
Open Scope Z_scope.
(*============================================================ genus, planar / L_B0, B0, planarity criterion / B0 =============================================================*)
(* OK: *)
(* OK: *)
(* OK!: *)
(* PLANARITY CRITERION / B0: OK! *)
(* DISCONNECTION CRITERION: VERY USEFUL *)
(*==========================================================  2008 JORDAN NEW FORMALIZATION:  ==========================================================*)
(* ======================================================= EQUIVALENCE AND top/bottom =========================================================*)
(* OK: *)
(* SPECIALIZATIONS: *)
(* OK: *)
(* OK: *)
(*========================================================== PROPERTIES ON B ===========================================================*)
(*=========================================================== expe AND bottom ============================================================*)
(* expo and between in an edge: *)
Definition expe(m:fmap)(z t:dart):=
MA0.expo m z t.
Definition betweene(m:fmap)(z v t:dart):=
MA0.between m z v t.
(* TO HAVE expe_bottom: *)
(* THEN, SIMILARLY (OK): *)
(* FINALLY: *)
(*=========================================================== expe, betweene_dec, between_bottom_B0 AND MA0.between_dec ============================================================*)
(* Decidability of betweene, in Prop: *)
(* IT SEEMS TO HAVE A PROBLEM WITH :  MA0.expo1_dec : forall (m : fmap) (z t : dart), inv_hmap m -> exd m z -> {MA0.expo1 m z t} + {~ MA0.expo1 m z t} *)
(* WE ALSO HAVE (EASILY): *)
(* OK! BY INDUCTION ON j: *)
(* THEN, BY INDUCTION ON j: *)
(* THEN, WE HAVE (OK!): *)
(* THEN (OK): *)

Lemma not_between_B0:forall(m:fmap)(x z:dart),
inv_hmap m -> exd m x -> exd m z -> x <> z ->
let z0:= bottom m zero z in
~betweene m z0 x z ->
(~MA0.expo m z0 x
\/  forall(i j:nat),
x = Iter (MA0.f m) i z0 ->
z = Iter (MA0.f m) j z0 ->
(i < MA0.Iter_upb m z0)%nat ->
(j < MA0.Iter_upb m z0)%nat ->
(j <= i)%nat).