(* Definition of "Planar formation" of fmap: *)

Fixpoint plf(m:fmap):Prop:=
  match m with 
     V => True
   | I m0 x => plf m0
   | L m0 di0 x y => plf m0 /\ 
      (let mc := (clos m0) in
        ~eqc mc x y \/ expf mc (A_1 mc di1 x) y)
   | L m0 di1 x y => plf m0 /\ 
      (let mc := (clos m0) in
        ~eqc mc x y \/ expf mc x (A mc di0 y))
  end.

(* Specifications: *)
Theorem plf_planar:forall (m:fmap), inv_qhmap m -> plf m -> planar m.
Theorem plf_Euler_Poincare: forall m:fmap, inv_qhmap m -> plf m -> ec m / 2 = nc m.
Lemma eq_genus_I : forall(m:fmap)(x:dart), inv_qhmap (I m x) -> genus (I m x) = genus m.
Lemma incr_genus_L0:forall(m:fmap)(x y:dart), inv_qhmap (L m di0 x y) -> genus m <= genus (L m di0 x y).
Lemma incr_genus_L1:forall(m:fmap)(x y:dart), inv_qhmap (L m di1 x y) -> genus m <= genus (L m di1 x y).
Lemma planar_I_rcp: forall(m:fmap)(x:dart), inv_qhmap (I m x) -> planar (I m x) -> planar m.
Lemma planar_L0_rcp: forall(m:fmap)(x y:dart), inv_qhmap (L m di0 x y) -> planar (L m di0 x y) -> planar m.
Lemma planar_L1_rcp: forall(m:fmap)(x y:dart), inv_qhmap (L m di1 x y) -> planar (L m di1 x y) -> planar m.
Lemma succf_expf_F: forall(m:fmap)(x:dart), inv_qhmap m -> succf m x -> expf m x (F m x).
Lemma expf_clos_symm: forall(m:fmap)(x y:dart), inv_qhmap m -> expf (clos m) x y -> expf (clos m) y x.
Lemma expf_planar_L0_rcp: forall (m:fmap)(x y:dart), inv_qhmap (L m di0 x y) -> planar (L m di0 x y) -> let mc:= clos m in (~eqc mc x y \/ expf mc (A_1 mc di1 x) y).
Lemma expf_planar_L1_rcp: forall (m:fmap)(x y:dart), inv_qhmap (L m di1 x y) -> planar (L m di1 x y) -> let mc:= clos m in (~eqc mc x y \/ expf mc x (A mc di0 y)).
Theorem plf_planar_rcp: forall m:fmap, inv_qhmap m -> genus m = 0 -> plf m.
Theorem plf_Euler_Poincare_rcp: forall m:fmap, inv_qhmap m -> ec m / 2 = nc m -> plf m.
Theorem Euler_Poincare_criterion: forall m:fmap, inv_qhmap m -> (plf m <-> ec m / 2 = nc m).