Fixpoint ve''_to_be (ve : var_env'') (n : nat) {struct n} : bool_expr :=
  match n with
  | O => One
  | S m =>
      match in_dom _ (N_of_nat m) ve with
      | true => ANd (ve''_to_be ve m) (Var (N_of_nat m))
      | false => ANd (ve''_to_be ve m) (Neg (Var (N_of_nat m)))
      end
  end.

Lemma ve''_to_be_ok3 : forall (n : nat) (ve : var_env''), n <= N -> be_ok (var_lu 0 N) (ve''_to_be ve n).