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_ok2 : forall (n : nat) (ve : var_env''), eval_be' (ve''_to_be ve n) (var_env''_to_env' ve) = true.