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_complete :
forall d : preDTA, predta_ref_ok_check d = true -> preDTA_ref_ok d.