(* fonction de suppression des états non coaccessibles *)

Fixpoint non_coacc_kill (d : preDTA) (m : Map bool) {struct m} : preDTA :=
  match d, m with
  | M0, M0 => M0 state
  | M1 a s, M1 a' b => if Neqb a a' && b then M1 state a s else M0 state
  | M2 x y, M2 z t => M2 state (non_coacc_kill x z) (non_coacc_kill y t)
  | _, _ => M0 state
  end.Definition predta_kill_non_coacc (d : preDTA) (a : ad) : preDTA :=
  non_coacc_kill d (predta_coacc_states d a).Definition dta_kill_non_coacc (d : DTA) : DTA :=
  match d with
  | dta p a => dta (predta_kill_non_coacc p a) a
  end.Definition predta_kill_non_coacc_lazy (d : preDTA) 
  (a : ad) : preDTA := non_coacc_kill d (predta_coacc_states_0 d a).Definition dta_kill_non_coacc_lazy (d : DTA) : DTA :=
  match d with
  | dta p a => dta (predta_kill_non_coacc_lazy p a) a
  end.

Lemma predta_kill_non_coacc_0 : forall (d : preDTA) (a a0 : ad) (s : state), preDTA_ref_ok d -> (MapGet state d a0 = Some s /\ coacc d a a0 <-> MapGet state (predta_kill_non_coacc d a) a0 = Some s).