Module MA1:= Mf McA1.
(*======================================================== FACE OPERATIONS IN HMAPS: F, F_1, cF, cF_1 ========================================================*)
(* Following operations are designed for hmaps, but are defined on fmap for convenience *)
(* Successor F in a face - direct version, designed for hmaps: *)
Definition F(m:fmap)(z:dart):=
A_1 m one (A_1 m zero z).
(* To have a successor in a (direct) face for x: *)
Definition succf(m:fmap)(z:dart):Prop:=
pred m zero z /\ pred m one (A_1 m zero z).
(* Decidability of succf:*)
(* OK: *)
(* Predecessor in a face - direct version: *)
Definition F_1 (m:fmap)(z:dart):=
A m zero (A m one z).
(* To have a predecessor in a (direct) face for z: *)
Definition predf(m:fmap)(z:dart):Prop:=
succ m one z /\ succ m zero (A m one z).
(* Decidability of succf: *)
(* OK: *)
(* IDEM: *)
(* OK: *)
(* IDEM: *)
(* IDEM: *)
(* OK: *)
(* F and F_1 are inverses: *)
(* IDEM: *)
(* CAUTION !! PROPAGATION OF exd m (F_1 m z) IN PLACE OF exd m (F m z) *)
(* OK: *)
(* IDEM:*)
(*========================================================= CLOSURES cF, cF_1 OF F, F_1 : ==========================================================*)
(* SUCCESSOR IN A COMPLETED FACE: *)
Definition cF (m:fmap)(z:dart):=
cA_1 m one (cA_1 m zero z).
Definition cF_1 (m:fmap)(z:dart):=
cA m zero (cA m one z).

Lemma exd_cF_not_nil : forall (m:fmap)(z:dart),
inv_hmap m -> (exd m z <-> cF m z <> nil).