(*========================================================
             PATHS IN FACES OF QHMAPS
========================================================*)

(* Existence of a REFLEXIVE path from a dart to another 
in a direct hmap face: *)

Fixpoint expf(m:fmap)(x y:dart){struct m}:Prop:=
 match m with
     V => False
  |  I m0 x0 => expf m0 x y \/ x=x0 /\ y=x0
  |  L m0 di0 x0 y0 =>
       expf m0 x y
     \/ let x_1 := A_1 m0 di1 x0 in
        x_1<>nil /\ expf m0 x y0 /\ expf m0 x_1 y
  |  L m0 di1 x0 y0 =>
       expf m0 x y
     \/ let y1 := A m0 di0 y0 in
        y1<>nil /\ expf m0 x y1 /\ expf m0 x0 y
 end.

(* Specifications: *)
Lemma expf_dec : forall (m:fmap)(x y:dart), {expf m x y} + {~expf m x y}.
Lemma refl_expf : forall(m:fmap)(x:dart), exd m x -> expf m x x.
Lemma expf_exd_exd : forall (m:fmap)(x y:dart), expf m x y -> (exd m x /\ exd m y).
Lemma trans_expf : forall(m:fmap)(x y z:dart), expf m x y -> expf m y z -> expf m x z.
Lemma not_pred0_not_expf : forall(m:fmap)(x y:dart), inv_qhmap m -> ~pred m di0 x -> x<>y -> ~expf m x y.
Lemma not_pred1_not_expf_aux : forall(m:fmap)(x y:dart), inv_qhmap m -> let x0 := A_1 m di0 x in ~pred m di1 x0 -> x <> y -> ~expf m x y.
Lemma not_pred1_not_expf : forall(m:fmap)(x x0 y:dart), inv_qhmap m -> x0 = A_1 m di0 x -> ~pred m di1 x0 -> x <> y -> ~expf m x y.
Lemma not_succ1_not_expf : forall(m:fmap)(x y:dart), inv_qhmap m -> ~succ m di1 y -> x<>y -> ~expf m x y.
Lemma not_succ0_not_expf : forall(m:fmap)(x y:dart), inv_qhmap m -> let y1 := A m di1 y in ~succ m di0 y1 -> x <> y -> ~expf m x y.
Lemma diff1_expf : forall(m:fmap)(x y z:dart), inv_qhmap m -> expf m x y -> expf m x z -> (expf m y z \/ expf m z y).
Lemma diff2_expf : forall(m:fmap)(x y z:dart), inv_qhmap m -> expf m x y -> expf m z y -> (expf m x z \/ expf m z x).