Section WDFA_sgn.
Hypothesis wdfa_sgn: Dir->U->bool.
Definition wdfa_sgn_closed:=
forall d0 u0,
wdfa_sgn d0 u0 = true ->
forall u1 i0 d1,
wdfa u1 i0 = (u0,d1) ->
((d1*(Dir_to_Z d0)>=0)%Z /\
wdfa_sgn d0 u1 = true).
Definition wdfa_sgn_closed_dec :=
forallb_Dir (fun d0 =>
forallb_U (fun u0 =>
if wdfa_sgn d0 u0 then
forallb_U (fun u1 =>
forallb_Σ (fun i0 =>
let (u0',d1) := wdfa u1 i0 in
if U_eqb u0' u0 then
(d1*(Dir_to_Z d0) >=? 0)%Z &&&
wdfa_sgn d0 u1
else true))
else true)).

Lemma wdfa_sgn_closed_dec_spec :
wdfa_sgn_closed_dec = true ->
wdfa_sgn_closed.