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_ok : forall (n : nat) (ve ve' : var_env''), bool_fun_of_bool_expr (ve''_to_be ve n) (var_env''_to_env ve') = true -> forall m : nat, m < n -> MapGet _ ve (N_of_nat m) = MapGet _ ve' (N_of_nat m).