Fixpoint predta_ref_ok_check_0 (d : preDTA) : preDTA -> bool :=
  fun d' : preDTA =>
  match d with
  | M0 => true
  | M1 a s => state_ref_ok_check s d'
  | M2 x y => predta_ref_ok_check_0 x d' && predta_ref_ok_check_0 y d'
  end.Definition predta_ref_ok_check (d : preDTA) : bool :=
  predta_ref_ok_check_0 d d.

Lemma predta_ref_ok_check_correct : forall d : preDTA, preDTA_ref_ok d -> predta_ref_ok_check d = true.