(* définition de la fonction dont on va calculer le point fixe *)

Fixpoint pl_non_empty (m : Map bool) (p : prec_list) {struct p} : bool :=
  match p with
  | prec_empty => true
  | prec_cons a la ls =>
      match ls with
      | prec_empty =>
          match MapGet bool m a with
          | Some b => b && pl_non_empty m la
          | None => false
          end
      | prec_cons _ _ _ =>
          match MapGet bool m a with
          | Some b => pl_non_empty m ls || b && pl_non_empty m la
          | None => pl_non_empty m ls
          end
      end
  end.Fixpoint st_non_empty (m : Map bool) (s : state) {struct s} : bool :=
  match s with
  | M0 => false
  | M1 _ p => pl_non_empty m p
  | M2 a b => st_non_empty m a || st_non_empty m b
  end.Fixpoint dta_app_ne_aux (d : preDTA) (m r : Map bool) {struct r} :
 Map bool :=
  match d, r with
  | M0, _ => M0 bool
  | M1 a s, M0 => M0 bool
  | M1 a s, M1 a' b =>
      if Neqb a a' then M1 bool a (b || st_non_empty m s) else M0 bool
  | M1 a s, M2 _ _ => M0 bool
  | M2 d0 d1, M0 => M0 bool
  | M2 d0 d1, M1 _ _ => M0 bool
  | M2 d0 d1, M2 r0 r1 =>
      M2 bool (dta_app_ne_aux d0 m r0) (dta_app_ne_aux d1 m r1)
  end.Definition dta_app_ne (d : preDTA) (m : Map bool) : 
  Map bool := dta_app_ne_aux d m m.Definition dta_non_empty_states (d : preDTA) : Map bool :=
  power (Map bool) (dta_app_ne d) (map_mini state d) (S (MapCard state d)).Definition dta_states_non_empty (d : DTA) : Map bool :=
  match d with
  | dta p a => dta_non_empty_states p
  end.Definition dta_non_empty_states_lazy (d : preDTA) : 
  Map bool :=
  lazy_power bool eqm_bool (dta_app_ne d) (map_mini state d)
    (S (MapCard state d)).Definition dta_states_non_empty_lazy (d : DTA) : Map bool :=
  match d with
  | dta p a => dta_non_empty_states_lazy p
  end.

(* Specifications: *)
Lemma dta_states_non_empty_lazy_eg_dta_states_non_empty : forall d : DTA, dta_states_non_empty_lazy d = dta_states_non_empty d.
Lemma dta_app_ne_aux_def_ok : forall (d : preDTA) (m : Map bool), def_ok_app bool (ensemble_base state d) (dta_app_ne_aux d m).
Lemma dta_app_ne_def_ok : forall d : preDTA, def_ok_app bool (ensemble_base state d) (dta_app_ne d).
Lemma dta_app_ne_inc_0 : forall (p : prec_list) (m0 m1 : Map bool), lem m0 m1 -> leb (pl_non_empty m0 p) (pl_non_empty m1 p).
Lemma dta_app_ne_inc_1 : forall (s : state) (m0 m1 : Map bool), lem m0 m1 -> leb (st_non_empty m0 s) (st_non_empty m1 s).
Lemma dta_app_ne_inc_2 : forall (d : preDTA) (m0 m1 m : Map bool), lem m0 m1 -> lem (dta_app_ne_aux d m0 m) (dta_app_ne_aux d m1 m).
Lemma dta_app_ne_inc_3 : forall (m0 m1 m : Map bool) (d : preDTA), lem m0 m1 -> lem (dta_app_ne_aux d m m0) (dta_app_ne_aux d m m1).
Lemma dta_app_ne_inc : forall d : preDTA, increasing_app bool lem (dta_app_ne d).