(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)


Require Import Bool.
Require Import Sumbool.
Require Import Arith.
Require Import ZArith NArith Nnat Ndec Ndigits.
From IntMap Require Import Map.
From IntMap Require Import Allmaps.
Require Import Wf_nat.
Require Import EqNat.
Require Import Peano_dec.
Require Import List.
Require Import Ensembles.
Require Import Finite_sets.
Require Import Finite_sets_facts.
Require Import Image.
Require Import Compare.
 
Require Import misc.
Require Import bool_fun.
Require Import myMap.
Require Import config.
Require Import alloc.
Require Import make.
Require Import neg.
Require Import or.
Require Import univ.
Require Import op.
Require Import tauto.
Require Import quant.
Require Import gc.
Require Import mu.
Require Import munew.

Lemma relfreeeven :
 forall (f : mu_form) (P : ad) (b : bool),
 mu_rel_free P f = false -> f_P_even P f b.
Proof.
(* Goal: forall (f : mu_form) (re : rel_env) (sre : set_renv) (_ : f_ok f) (_ : mu_form_ap_ok (var_lu O N) f) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste f sre) (bool_expr_to_var_env'' O N (mu_eval N te f re)) *)
  simple induction f.  intros.  elim b; [ apply mu_0_even | apply mu_0_odd ].  intros.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim b; [ apply mu_1_even | apply mu_1_odd ].  intros.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim b; [ apply mu_ap_even | apply mu_ap_odd ].  intros.
(* Goal: f_P_even P (mu_rel_var a) b *)
(* Goal: forall (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_neg m)) false), f_P_even P (mu_neg m) b *)
(* Goal: forall (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (m0 : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m0) false), f_P_even P m0 b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_and m m0)) false), f_P_even P (mu_and m m0) b *)
(* Goal: forall (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (m0 : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m0) false), f_P_even P m0 b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_or m m0)) false), f_P_even P (mu_or m m0) b *)
(* Goal: forall (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (m0 : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m0) false), f_P_even P m0 b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_impl m m0)) false), f_P_even P (mu_impl m m0) b *)
(* Goal: forall (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (m0 : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m0) false), f_P_even P m0 b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_iff m m0)) false), f_P_even P (mu_iff m m0) b *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_all a m)) false), f_P_even P (mu_all a m) b *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_ex a m)) false), f_P_even P (mu_ex a m) b *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P m) false), f_P_even P m b) (P : ad) (b : bool) (_ : @eq bool (mu_rel_free P (mu_mu a m)) false), f_P_even P (mu_mu a m) b *)
  simpl in H.  elim b.  apply mu_rel_var_even.  apply mu_rel_var_odd.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  intros.  simpl in H0.  elim b.  apply mu_neg_even.  apply H.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  apply mu_neg_odd.  apply H.  assumption.  intros.  simpl in H1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (orb_false_elim _ _ H1); intros.  elim b.  apply mu_and_even.  apply H.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  apply H0.  assumption.  apply mu_and_odd.  apply H.  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply H0.  assumption.  intros.  simpl in H1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (orb_false_elim _ _ H1); intros.  elim b.  apply mu_or_even.  apply H.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  apply H0.  assumption.  apply mu_or_odd.  apply H.  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply H0.  assumption.  intros.  simpl in H1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (orb_false_elim _ _ H1); intros.  elim b.  apply mu_impl_even.  apply H.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  apply H0.  assumption.  apply mu_impl_odd.  apply H.  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply H0.  assumption.  intros.  simpl in H1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (orb_false_elim _ _ H1); intros.  elim b.  apply mu_iff_even.  apply H.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  apply H0.  assumption.  apply H.  assumption.  apply H0.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  apply mu_iff_odd.  apply H.  assumption.  apply H0.  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply H.  assumption.  apply H0.  assumption.  intros.  simpl in H0.  elim b.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply mu_all_even.  apply H.  assumption.  apply mu_all_odd.  apply H.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  intros.  simpl in H0.  elim b.  apply mu_ex_even.  apply H.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  apply mu_ex_odd.  apply H.  assumption.  intros.  simpl in H0.
(* Goal: f_P_even P (mu_mu a m) b *)
  elim (sumbool_of_bool (Neqb P a)).  intro y.
(* Goal: f_P_even P (mu_mu a m) b *)
  rewrite <- (Neqb_complete _ _ y).  elim b.  apply mu_mu_P_even.
(* Goal: f_P_even P (mu_mu a m) b *)
  apply mu_mu_P_odd.  intro y.  rewrite y in H0.  simpl in H0.  elim b.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply mu_mu_Q_even.  assumption.  apply H.  assumption.  apply mu_mu_Q_odd.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  apply H.  assumption.
Qed.

Section mu2set.

Variable N : nat.

Definition set_1 := Evar_env'' 0 N.
Definition rel_1 (s t : var_env'') := In _ set_1 s /\ In _ set_1 t.

Definition t_to_rel1 (t : bool_expr) (ve1 ve2 : var_env') :=
  eval_be' t (var_env'_or ve1 (var_env'_dash N ve2)).
Definition t_to_rel (t : bool_expr) (ve1 ve2 : var_env'') :=
  t_to_rel1 t (var_env''_to_env' ve1) (var_env''_to_env' ve2).
Definition new_t_to_rel (t : bool_expr) (ve1 ve2 : var_env'') :=
  t_to_rel t ve1 ve2 = true /\ rel_1 ve1 ve2.

Definition state_set (S : Ensemble var_env'') := Included _ S set_1.
Definition state_rel (R : Relation var_env'') :=
  forall s t : var_env'', R s t -> rel_1 s t.  (* (In ? set_1 s) /\ (In ? set_1 t).*)

Definition set_0 := Empty_set var_env''.
Definition set_ap (x : ad) (s : var_env'') :=
  In _ set_1 s /\ in_dom _ x s = true.
Definition set_or := Union var_env''.
Definition set_and := Intersection var_env''.
Definition set_neg := Setminus _ set_1.
Definition set_impl (S1 S2 : Ensemble var_env'') := set_or (set_neg S1) S2.
Definition set_iff (S1 S2 : Ensemble var_env'') :=
  set_and (set_impl S1 S2) (set_impl S2 S1).
Inductive set_ex (R : Relation var_env'') (S : Ensemble var_env'') :
Ensemble var_env'' :=
    setex_intro :
      forall s t : var_env'',
      In _ set_1 s -> R s t -> In _ S t -> In _ (set_ex R S) s.
Definition set_all (R : Relation var_env'') (S : Ensemble var_env'')
  (s : var_env'') :=
  In _ set_1 s /\ (forall t : var_env'', R s t -> In _ S t).
Definition set_mu (f : Ensemble var_env'' -> Ensemble var_env'')
  (s : var_env'') :=
  forall X : Ensemble var_env'',
  state_set X -> Included _ (f X) X -> In _ X s.

Definition set_renv := ad -> Ensemble var_env''.
Definition set_tenv := ad -> Relation var_env''.
Definition sre_put (sre : set_renv) (P : ad) (S : Ensemble var_env'')
  (Q : ad) := if Neqb P Q then S else sre Q.
Definition te_ste_ok (te : trans_env) (ste : set_tenv) :=
  forall (a : ad) (ve1 ve2 : var_env''),
  new_t_to_rel (te a) ve1 ve2 <-> ste a ve1 ve2.
Definition re_sre_ok (re : rel_env) (sre : set_renv) :=
  forall P : ad, bool_expr_to_var_env'' 0 N (re P) = sre P.

Fixpoint mu_form2set (ste : set_tenv) (f : mu_form) {struct f} :
 set_renv -> Ensemble var_env'' :=
  fun sre =>
  match f with
  | mu_0 => set_0
  | mu_1 => set_1
  | mu_ap p => set_ap p
  | mu_rel_var P => sre P
  | mu_neg g => set_neg (mu_form2set ste g sre)
  | mu_and g1 g2 => set_and (mu_form2set ste g1 sre) (mu_form2set ste g2 sre)
  | mu_or g1 g2 => set_or (mu_form2set ste g1 sre) (mu_form2set ste g2 sre)
  | mu_impl g1 g2 =>
      set_impl (mu_form2set ste g1 sre) (mu_form2set ste g2 sre)
  | mu_iff g1 g2 => set_iff (mu_form2set ste g1 sre) (mu_form2set ste g2 sre)
  | mu_all t g => set_all (ste t) (mu_form2set ste g sre)
  | mu_ex t g => set_ex (ste t) (mu_form2set ste g sre)
  | mu_mu P g => set_mu (fun S => mu_form2set ste g (sre_put sre P S))
  end.

Lemma set_ap_state_set : forall x : ad, state_set (set_ap x).
Proof.
(* Goal: forall x : ad, state_set (set_ap x) *)
  unfold state_set, set_ap in |- *.  unfold Included in |- *.  unfold In in |- *.  tauto.
Qed.

Lemma var_env'_to_env''_to_env' :
 forall (L U : nat) (ve : var_env') (x : ad),
 var_lu L U x = true ->
 var_env''_to_env' (var_env'_to_env'' L U ve) (nat_of_N x) =
 ve (nat_of_N x).
Proof.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  unfold var_env''_to_env', var_env'_to_env'' in |- *.
(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x)) (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub U L) L U ve (@eq_refl nat (Init.Nat.sub U L)) in ve'')) (ve (N.to_nat x)) *)
  elim (var_env'_to_var_env''_lemma2 (U - L) L U ve (refl_equal (U - L))).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  intros x0 y.  rewrite (N_of_nat_of_N x).  apply (proj2 y).  assumption.
Qed.

Lemma le_minus_le1 : forall m n p : nat, m <= n -> m - p <= n - p.
Proof.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simple induction 1.  auto with arith.  intros.  apply le_trans with (m := m0 - p).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  generalize p.  generalize m0.  simple induction m1.  simpl in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  auto with arith.  intros.  elim p0.  auto with arith.  intros.
(* Goal: le (Init.Nat.sub (S n0) (S n1)) (Init.Nat.sub (S (S n0)) (S n1)) *)
  replace (S n0 - S n1) with (n0 - n1).
(* Goal: le (Init.Nat.sub n0 n1) (Init.Nat.sub (S (S n0)) (S n1)) *)
(* Goal: @eq nat (Init.Nat.sub n0 n1) (Init.Nat.sub (S n0) (S n1)) *)
  replace (S (S n0) - S n1) with (S n0 - n1).  apply H2.  
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  reflexivity.  reflexivity.
Qed.

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).
Proof.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simple induction n.  intros.  elim (lt_n_O _ H0).  intros.  simpl in H0.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  elim (option_sum _ (MapGet unit ve (N_of_nat n0))).  intro y.  elim y.  intro x.
(* Goal: forall _ : @eq (option unit) (MapGet unit ve (N.of_nat n0)) (@Some unit x), @eq bool (eval_be' (if match MapGet unit ve (N.of_nat n0) with | Some a => true | None => false end then ANd (ve''_to_be ve n0) (Var (N.of_nat n0)) else ANd (ve''_to_be ve n0) (Neg (Var (N.of_nat n0)))) (var_env''_to_env' ve)) true *)
(* Goal: forall _ : @eq (option unit) (MapGet unit ve (N.of_nat n0)) (@None unit), @eq bool (eval_be' (if match MapGet unit ve (N.of_nat n0) with | Some a => true | None => false end then ANd (ve''_to_be ve n0) (Var (N.of_nat n0)) else ANd (ve''_to_be ve n0) (Neg (Var (N.of_nat n0)))) (var_env''_to_env' ve)) true *)
  elim x.  intros y0.  unfold in_dom in H0.  clear y.  rewrite y0 in H0.
(* Goal: @eq (option unit) (MapGet unit ve (N.of_nat m)) (MapGet unit ve' (N.of_nat m)) *)
  simpl in H0.  unfold bool_fun_and in H0.  elim (andb_prop _ _ H0).  clear H0.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  unfold bool_fun_var in H2.  unfold var_env''_to_env in H2.
(* Goal: @eq (option unit) (MapGet unit ve (N.of_nat m)) (MapGet unit ve' (N.of_nat m)) *)
  unfold lt in H1.  elim (le_lt_eq_dec m n0).  intros y.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  rewrite (H ve ve' H0 m y).  reflexivity.  intro y.  rewrite y.  rewrite y0.
(* Goal: @eq (option unit) (@Some unit tt) (MapGet unit ve' (N.of_nat n0)) *)
(* Goal: le m n0 *)
(* Goal: forall _ : @eq (option unit) (MapGet unit ve (N.of_nat n0)) (@None unit), @eq (option unit) (MapGet unit ve (N.of_nat m)) (MapGet unit ve' (N.of_nat m)) *)
  unfold in_dom in H2.  elim (option_sum _ (MapGet unit ve' (N_of_nat n0))).
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  intro y1.  inversion y1.  rewrite H3.  elim x0.  reflexivity.  intro y1.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite y1 in H2.  discriminate.  apply le_S_n.  assumption.  intro y.
(* Goal: @eq (option unit) (MapGet unit ve (N.of_nat m)) (MapGet unit ve' (N.of_nat m)) *)
  unfold in_dom in H0.  rewrite y in H0.  simpl in H0.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold bool_fun_and in H0.  elim (andb_prop _ _ H0).  intros.
(* Goal: @eq (option unit) (MapGet unit ve (N.of_nat m)) (MapGet unit ve' (N.of_nat m)) *)
  unfold bool_fun_neg, bool_fun_var, var_env''_to_env in H3.  unfold in_dom in H3.
(* Goal: @eq (option unit) (MapGet unit ve (N.of_nat m)) (MapGet unit ve' (N.of_nat m)) *)
  unfold lt in H1.  elim (le_lt_eq_dec m n0).  intro y0.  apply (H ve ve').
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  intro y0.  rewrite y0.  rewrite y.
(* Goal: @eq (option unit) (@None unit) (MapGet unit ve' (N.of_nat n0)) *)
(* Goal: le m n0 *)
  elim (option_sum _ (MapGet unit ve' (N_of_nat n0))).  intro y1.  inversion y1.
(* Goal: forall _ : @eq (option unit) (MapGet unit ve' (N.of_nat n0)) (@None unit), @eq (option unit) (@None unit) (MapGet unit ve' (N.of_nat n0)) *)
(* Goal: le m n0 *)
  rewrite H4 in H3.  simpl in H3.  discriminate.  intro y1.  rewrite y1.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  reflexivity.  apply le_S_n.  assumption.
Qed.

Lemma ve''_to_be_ok1 :
 forall (n : nat) (ve ve' : var_env''),
 Evar_env'' 0 n ve ->
 bool_expr_to_var_env'' 0 n (ve''_to_be ve n) ve' -> ve = ve'.
Proof.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  unfold Evar_env'' in H.  unfold bool_expr_to_var_env'' in H0.
  elim H; clear H; intros H2 H3.  elim H0; clear H0; intros H4 H5.

(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply (mapcanon_unique unit).  assumption.  unfold Evar_env'' in H5.
  unfold In in H5.  exact (proj1 H5).  unfold Evar_env'' in H5.
  unfold In in H5.
  elim H5; intros H0 H1.
  unfold var_lu in H1, H3.  unfold eqmap in |- *.
  unfold eqm in |- *.  intro.  elim (le_lt_dec n (nat_of_N a)).
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold in_dom in H3, H1.  intro.  lapply (H3 a).  lapply (H1 a).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (MapGet unit ve' a).  Focus 2. elim (MapGet unit ve a);  try reflexivity.  intros.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  discriminate.  intros.  discriminate.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  replace (leb (S (nat_of_N a)) n) with false.  simpl in |- *.  reflexivity.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  symmetry  in |- *.  apply not_true_is_false.  unfold not in |- *; intro.  elim (le_Sn_n n).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply le_trans with (m := S (nat_of_N a)).  apply le_n_S.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply leb_complete.  assumption.  
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  replace (leb (S (nat_of_N a)) n) with false.  simpl in |- *.  reflexivity.  
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  symmetry  in |- *.  apply not_true_is_false.  unfold not in |- *; intro.  elim (le_Sn_n n).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply le_trans with (m := S (nat_of_N a)).  apply le_n_S.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply leb_complete.  assumption.  intro.  rewrite <- (N_of_nat_of_N a).
  apply (ve''_to_be_ok n ve ve').  unfold eval_be' in H4.  rewrite <- H4.
  apply (bool_fun_of_be_ext (ve''_to_be ve n)).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold var_env''_to_env, var_env'_to_env, var_env''_to_env' in |- *.  intros.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite (N_of_nat_of_N x).  reflexivity.  assumption.  
Qed.

Lemma ve''_to_be_ok2 :
 forall (n : nat) (ve : var_env''),
 eval_be' (ve''_to_be ve n) (var_env''_to_env' ve) = true.
Proof.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  simple induction n.  simpl in |- *.  unfold eval_be' in |- *.  simpl in |- *.  unfold bool_fun_one in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  reflexivity.  simpl in |- *.  intros.  unfold in_dom in |- *.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  elim (option_sum _ (MapGet unit ve (N_of_nat n0))).  intro y.  elim y; clear y.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  intro x.  elim x.  clear x.  intros y.  rewrite y.  unfold eval_be' in |- *.  simpl in |- *.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold eval_be' in H.  unfold bool_fun_and in |- *.  apply andb_true_intro.  split.
(* Goal: be_ok (var_lu O N) (ve''_to_be ve n0) *)
(* Goal: be_ok (var_lu O N) (Neg (Var (N.of_nat n0))) *)
  apply H.  unfold bool_fun_var, var_env'_to_env, var_env''_to_env' in |- *.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (nat_of_N_of_nat n0).  unfold in_dom in |- *.  rewrite y.  reflexivity.  
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  intro y.  rewrite y.  unfold eval_be' in |- *.  simpl in |- *.  unfold eval_be' in H.
(* Goal: be_ok (var_lu O N) (ve''_to_be ve n0) *)
(* Goal: be_ok (var_lu O N) (Neg (Var (N.of_nat n0))) *)
  unfold bool_fun_and in |- *.  apply andb_true_intro.  split.  apply H.  
  unfold bool_fun_var, var_env'_to_env, var_env''_to_env', bool_fun_neg
   in |- *.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (nat_of_N_of_nat n0).  unfold in_dom in |- *.  rewrite y.  reflexivity.
Qed.

Lemma ve''_to_be_ok3 :
 forall (n : nat) (ve : var_env''),
 n <= N -> be_ok (var_lu 0 N) (ve''_to_be ve n).
Proof.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simple induction n.  intros.  simpl in |- *.  apply one_ok.  simpl in |- *.  intros.
(* Goal: be_ok (var_lu O N) (ve''_to_be ve n0) *)
(* Goal: be_ok (var_lu O N) (Neg (Var (N.of_nat n0))) *)
  elim (in_dom unit (N_of_nat n0) ve).  apply and_ok.  apply H.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply lt_le_weak.  assumption.  apply var_ok.  unfold var_lu in |- *.
(* Goal: @eq nat N (Init.Nat.add N O) *)
(* Goal: le N (N.to_nat x1) *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x1) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  apply andb_true_intro.  split.  auto with arith.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite (nat_of_N_of_nat n0).  apply leb_correct.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply and_ok.  apply H.  apply lt_le_weak.  assumption.  apply neg_ok.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply var_ok.  unfold var_lu in |- *.  apply andb_true_intro.  split.
(* Goal: @eq nat N (Init.Nat.add N O) *)
(* Goal: le N (N.to_nat x1) *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x1) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  auto with arith.  rewrite (nat_of_N_of_nat n0).  apply leb_correct.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption. 
Qed.

Lemma env_to_be_lemma :
 forall S : Ensemble var_env'',
 Finite _ S ->
 Included _ S (Evar_env'' 0 N) ->
 exists be : bool_expr,
   bool_expr_to_var_env'' 0 N be = S /\ be_ok (var_lu 0 N) be.
Proof.
(* Goal: forall (_ : Finite var_env'' S) (_ : Included var_env'' S (Evar_env'' O N)), @ex bool_expr (fun be : bool_expr => and (@eq (Ensemble var_env'') (bool_expr_to_var_env'' O N be) S) (be_ok (var_lu O N) be)) *)
  intro.  simple induction 1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Included, bool_expr_to_var_env'', Evar_env'' in |- *.  unfold In in |- *.  intros.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split with Zero. split.
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  apply Extensionality_Ensembles.  split.  unfold Included in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  unfold In in H1.  unfold eval_be' in H1.  simpl in H1.
(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold bool_fun_zero in H1.  decompose [and] H1.  discriminate.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Included in |- *.  unfold In in |- *.  intros.  elim H1.  apply zero_ok.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  elim H1.  clear H1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  split with (Or x0 (ve''_to_be x N)).  unfold bool_expr_to_var_env'' in |- *.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split.  elim H1.  clear H1.  intros y H00.
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  apply Extensionality_Ensembles.  split.  unfold Included in |- *.  unfold In in |- *.
(* Goal: forall (x1 : var_env'') (_ : and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' x1)) true) (Evar_env'' O N x1)), Add var_env'' A x x1 *)
(* Goal: Included var_env'' (Add var_env'' A x) (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  unfold Evar_env'', eval_be' in |- *.  unfold bool_expr_to_var_env'' in y.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold eval_be', In, Evar_env'' in y.  intros.  simpl in H1.
(* Goal: Add var_env'' A x x1 *)
(* Goal: Included var_env'' (Add var_env'' A x) (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  elim H1; clear H1; intros H5 H4; elim H4; clear H4; intros H4 H7.
(* Goal: Add var_env'' A x x1 *)
(* Goal: Included var_env'' (Add var_env'' A x) (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  unfold bool_fun_or in H5.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  elim (orb_prop _ _ H5).  clear H5.  intro.  unfold Add in |- *.
(* Goal: Union var_env'' A (Singleton var_env'' x) x1 *)
(* Goal: forall _ : @eq bool (bool_fun_of_bool_expr (ve''_to_be x N) (var_env'_to_env (var_env''_to_env' x1))) true, Add var_env'' A x x1 *)
(* Goal: Included var_env'' (Add var_env'' A x) (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  apply (Union_introl _ A (Singleton var_env'' x) x1).  rewrite <- y.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold In in |- *.  split.  assumption.  split.  assumption.  assumption.  intro.
(* Goal: Add var_env'' A x x1 *)
(* Goal: Included var_env'' (Add var_env'' A x) (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  clear H5.  unfold Add in |- *.  apply (Union_intror _ A (Singleton var_env'' x) x1).
(* Goal: In var_env'' (Singleton var_env'' x) x1 *)
(* Goal: Included var_env'' (Add var_env'' A x) (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  replace x with x1.  apply In_singleton.  symmetry  in |- *.
(* Goal: @eq var_env'' x x1 *)
(* Goal: Included var_env'' (Add var_env'' A x) (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  apply (ve''_to_be_ok1 N x x1).  unfold Included in H3.  unfold In at 2 in H3.
(* Goal: In var_env'' (Add var_env'' A x) x0 *)
  apply H3.  unfold Add in |- *.  apply Union_intror.  apply In_singleton.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold bool_expr_to_var_env'' in |- *.  unfold eval_be' in |- *.  split.  assumption.  split.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  assumption.  unfold Included in |- *.  intros.  unfold Add in H1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim H1.  intros.  split.  unfold eval_be' in |- *.  simpl in |- *.  unfold bool_fun_or in |- *.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply orb_true_intro.  left.  unfold bool_expr_to_var_env'' in y.
(* Goal: @eq bool (bool_fun_of_bool_expr x0 (var_env'_to_env (var_env''_to_env' x2))) true *)
(* Goal: In var_env'' (Evar_env'' O N) x2 *)
(* Goal: forall (x1 : var_env'') (_ : In var_env'' (Singleton var_env'' x) x1), In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x1 *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  rewrite <- y in H4.  unfold In in H4.  unfold eval_be' in H4.
(* Goal: In var_env'' (Evar_env'' O N) x2 *)
(* Goal: forall (x1 : var_env'') (_ : In var_env'' (Singleton var_env'' x) x1), In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (Or x0 (ve''_to_be x N)) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x1 *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  exact (proj1 H4).  rewrite <- y in H4.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  unfold bool_expr_to_var_env'' in H4.  unfold In in H4.  unfold In in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  exact (proj2 H4).  intros.  elim H4.  unfold In in |- *.  split.  unfold eval_be' in |- *.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  simpl in |- *.  unfold bool_fun_or in |- *.  apply orb_true_intro.  right.
(* Goal: Evar_env'' O N x *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  apply (ve''_to_be_ok2 N x).  unfold Included in H3.  unfold In in H3.
(* Goal: In var_env'' (Add var_env'' A x) x0 *)
  apply H3.  unfold Add in |- *.  apply (Union_intror _ A (Singleton var_env'' x) x).
(* Goal: In var_env'' (Singleton var_env'' x) x *)
(* Goal: be_ok (var_lu O N) (Or x0 (ve''_to_be x N)) *)
(* Goal: Included var_env'' A (Evar_env'' O N) *)
  apply In_singleton.  apply or_ok.  exact (proj2 H1).  apply ve''_to_be_ok3.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply le_n.  unfold Included in |- *.  intros.  apply H3.  unfold Add in |- *.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply Union_introl.  assumption.
Qed.

Lemma env_to_be_lemma1 :
 forall S : Ensemble var_env'',
 Included _ S (Evar_env'' 0 N) ->
 exists be : bool_expr,
   bool_expr_to_var_env'' 0 N be = S /\ be_ok (var_lu 0 N) be.
Proof.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  apply env_to_be_lemma. 
(* Goal: Finite var_env'' S *)
(* Goal: Included var_env'' S (Evar_env'' O N) *)
  apply Finite_downward_closed with (A := Evar_env'' 0 N).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply Eenv''_var''finite.  assumption.  assumption.
Qed.

Lemma muevaleqset :
 forall (te : trans_env) (ste : set_tenv),
 ad_to_be_ok (var_lu 0 (2 * N)) te ->
 te_ste_ok te ste ->
 forall (f : mu_form) (re : rel_env) (sre : set_renv),
 f_ok f ->
 mu_form_ap_ok (var_lu 0 N) f ->
 ad_to_be_ok (var_lu 0 N) re ->
 re_sre_ok re sre ->
 mu_form2set ste f sre = bool_expr_to_var_env'' 0 N (mu_eval N te f re).
Proof.
(* Goal: forall (f : mu_form) (re : rel_env) (sre : set_renv) (_ : f_ok f) (_ : mu_form_ap_ok (var_lu O N) f) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste f sre) (bool_expr_to_var_env'' O N (mu_eval N te f re)) *)
  intro.  intro.  intro te_ok.  intro.  simple induction f.  simpl in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold set_0, bool_expr_to_var_env'' in |- *.  intros.  apply Extensionality_Ensembles.
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  split.  auto with sets.  unfold Included in |- *.  unfold eval_be' in |- *.  simpl in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold In, bool_fun_zero in |- *.  intros.  decompose [and] H4.  discriminate.  simpl in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  apply Extensionality_Ensembles.  unfold set_1 in |- *.  simpl in |- *.  split.
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  unfold Included in |- *.  unfold Evar_env'', bool_expr_to_var_env'' in |- *.  unfold In in |- *.
(* Goal: and (@eq bool true true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)) *)
(* Goal: forall _ : @eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) false, @eq bool (negb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true *)
(* Goal: and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false) *)
(* Goal: forall (x : var_env'') (_ : and (@eq bool (bool_fun_neg (bool_fun_of_bool_expr (mu_eval N te m re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false))), and (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)) (not (and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_and m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_and m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_and m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_and m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold eval_be' in |- *.  simpl in |- *.  unfold Evar_env'' in |- *.  tauto.  
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  unfold bool_expr_to_var_env'', Evar_env'' in |- *.  unfold Included in |- *.  unfold eval_be' in |- *.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  simpl in |- *.  unfold In in |- *.  tauto.  simpl in |- *.  unfold set_ap in |- *.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold bool_expr_to_var_env'' in |- *.  unfold eval_be' in |- *.  simpl in |- *.  unfold bool_fun_var in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold In in |- *.  unfold Evar_env'' in |- *.  unfold set_1 in |- *.  unfold Evar_env'' in |- *.  intros.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply Extensionality_Ensembles.  split.  unfold Included in |- *.  unfold In in |- *.  intros.
(* Goal: and (@eq bool (var_env'_to_env (var_env''_to_env' x) a) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (var_env'_to_env (var_env''_to_env' ve) a) true) (and (mapcanon unit ve) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x ve) false))) (fun s : var_env'' => and (and (mapcanon unit s) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x s) false)) (@eq bool (in_dom unit a s) true)) *)
(* Goal: forall (a : ad) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_rel_var a)) (_ : mu_form_ap_ok (var_lu O N) (mu_rel_var a)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_rel_var a) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_rel_var a) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_neg m)) (_ : mu_form_ap_ok (var_lu O N) (mu_neg m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_neg m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_neg m) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_and m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_and m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_and m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_and m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H4; intros H5 H7; elim H5; clear H5; intros H5 H8.

(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split.  unfold var_env'_to_env, var_env''_to_env' in |- *.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite (N_of_nat_of_N a).  assumption.  split.  assumption.  assumption.
(* Goal: @eq (Ensemble var_env'') (set_and (set_impl (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve))) (set_impl (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold var_env'_to_env, var_env''_to_env' in |- *.  rewrite (N_of_nat_of_N a).
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  unfold Included in |- *.  unfold In in |- *.  tauto.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simpl in |- *.  unfold re_sre_ok in |- *.  intros.  symmetry  in |- *.  apply H3.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  simpl in |- *.  inversion H2.  rewrite (H0 re sre).
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' t1)) true *)
(* Goal: In var_env'' (Evar_env'' O N) s *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_neg, bool_expr_to_var_env'' in |- *.  unfold Setminus in |- *.  unfold eval_be' in |- *.
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  simpl in |- *.  apply Extensionality_Ensembles.  unfold Same_set in |- *.  unfold Included in |- *.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  unfold In in |- *.  unfold var_env'_to_env, var_env''_to_env' in |- *.  unfold set_1 in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Evar_env'' in |- *.  split.  intros.
(* Goal: and (@eq bool (bool_fun_neg (bool_fun_of_bool_expr (mu_eval N te m re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)) *)
(* Goal: forall (x : var_env'') (_ : and (@eq bool (bool_fun_neg (bool_fun_of_bool_expr (mu_eval N te m re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false))), and (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)) (not (and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_and m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_and m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_and m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_and m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H7; intros H8 H10; elim H8; clear H8; intros H8 H11.

(* Goal: forall (x : var_env'') (_ : and (@eq bool (bool_fun_neg (bool_fun_of_bool_expr (mu_eval N te m re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false))), and (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)) (not (and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_and m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_and m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_and m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_and m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold bool_fun_neg in |- *.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split.  elim
   (sumbool_of_bool
      (bool_fun_of_bool_expr (mu_eval N te m re)
         (fun x0 : BDDvar => in_dom unit (N_of_nat (nat_of_N x0)) x))).
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  intro y.  rewrite y in H10.  elim H10.  tauto.  intro y.  rewrite y.  reflexivity.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  split.  assumption.  assumption.  unfold bool_fun_neg in |- *.  intros.
(* Goal: and (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)) (not (and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false)))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_and m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_and m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_and m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_and m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H7; intros H9 H8; elim H8; clear H8; intros H8 H11.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  split.  split.  assumption.  assumption.  
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold not in |- *; intro.
(* Goal: False *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_and m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_and m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_and m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_and m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H10; intros H13 H12; elim H12; clear H12; intros H12 H15.

(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite H13 in H9.  discriminate.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  inversion H1.  assumption.  assumption.  assumption.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simpl in |- *.  intros.  inversion H3.  rewrite (H0 re sre).  rewrite (H1 re sre).
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' t1)) true *)
(* Goal: In var_env'' (Evar_env'' O N) s *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_and, bool_expr_to_var_env'' in |- *.  unfold eval_be' in |- *.
(* Goal: @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
  unfold var_env'_to_env, var_env''_to_env' in |- *.  apply Extensionality_Ensembles.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Same_set in |- *.  unfold Included in |- *.  split.  intros.  inversion H10.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  simpl in |- *.  unfold bool_fun_and in |- *.  unfold In in H11, H12.  unfold In in |- *.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (proj1 H11).  rewrite (proj1 H12).  split.  reflexivity.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  exact (proj2 H12).  intros.  simpl in H10.  unfold bool_fun_and in H10.
(* Goal: In var_env'' (Intersection var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold In in H10.
(* Goal: In var_env'' (Intersection var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H10; clear H10; intros H12 H13.

(* Goal: In var_env'' (Intersection var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_or m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_or m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_or m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_or m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (andb_prop _ _ H12).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  apply Intersection_intro.  unfold In in |- *.  rewrite H10.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  split; [ reflexivity | assumption ].  unfold In in |- *.  rewrite H11.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  split; [ reflexivity | assumption ].  inversion H2.  assumption.  assumption.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  inversion H2.  assumption.  assumption.  assumption.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simpl in |- *.  intros.  rewrite (H0 re sre).  rewrite (H1 re sre).
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' t1)) true *)
(* Goal: In var_env'' (Evar_env'' O N) s *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_or, bool_expr_to_var_env'' in |- *.  unfold eval_be' in |- *.
(* Goal: @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
  unfold var_env'_to_env, var_env''_to_env' in |- *.  apply Extensionality_Ensembles.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Same_set in |- *.  unfold Included in |- *.  split.  intros.  inversion H6.  unfold In in |- *.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  simpl in |- *.  unfold bool_fun_or in |- *.  unfold In in H7.
(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H7; intros H10 H11.

(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  rewrite H10.  auto with bool.  unfold In in |- *.  unfold In in H7.  simpl in |- *.
(* Goal: and (@eq bool (bool_fun_or (bool_fun_of_bool_expr (mu_eval N te m re)) (bool_fun_of_bool_expr (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Or (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (Union var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold bool_fun_or in |- *.
(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H7; intros H10 H11.
(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite H10.  auto with bool.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  simpl in H6.  unfold In in H6.  unfold bool_fun_or in H6.
(* Goal: In var_env'' (Union var_env'' (fun x : var_env'' => and (In var_env'' (Evar_env'' O N) x) (not (In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; clear H6; intros H8 H9.

(* Goal: forall _ : @eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true, In var_env'' (Union var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: forall _ : @eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true, In var_env'' (Union var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_impl m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_impl m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_impl m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_impl m m0) re)) *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (orb_true_elim _ _ H8).  intros y.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  apply Union_introl.  unfold In in |- *.  rewrite y.  auto with bool.  intro y.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  apply Union_intror.  unfold In in |- *.  rewrite y.  auto with bool.  inversion H2.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  inversion H3.  assumption.  assumption.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  inversion H2.  assumption.  inversion H3.  assumption.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simpl in |- *.  intros.  rewrite (H0 re sre).  rewrite (H1 re sre).
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' t1)) true *)
(* Goal: In var_env'' (Evar_env'' O N) s *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_impl, bool_expr_to_var_env'' in |- *.  unfold eval_be' in |- *.
(* Goal: @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) *)
  unfold var_env'_to_env, var_env''_to_env' in |- *.  apply Extensionality_Ensembles.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Same_set in |- *.  unfold Included in |- *.  split.  intros.  unfold In in |- *.  simpl in |- *.
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold bool_fun_impl in |- *.  inversion H6.  unfold set_neg in H7.
(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold Setminus in H7.  unfold In in H7.
(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H7; intros H10 H11.
(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) true) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold implb in |- *.
(* Goal: and (@eq bool (if bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x) then true else true) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold ifb in |- *.  elim
   (sumbool_of_bool
      (bool_fun_of_bool_expr (mu_eval N te m re)
         (fun x1 : BDDvar => in_dom unit (N_of_nat (nat_of_N x1)) x))).
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  intro y.  rewrite y in H11.  unfold set_1 in H10.  elim H11.  auto with bool.  
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  intro y.  rewrite y.  auto with bool.  unfold In in H7.
(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H7; intros H10 H11.

(* Goal: and (@eq bool (implb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Impl (mu_eval N te m re) (mu_eval N te m0 re)) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite H10.  unfold implb in |- *.  unfold ifb in |- *.
  elim
   (bool_fun_of_bool_expr (mu_eval N te m re)
      (fun x1 : BDDvar => in_dom unit (N_of_nat (nat_of_N x1)) x));
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
   auto with bool.  unfold set_or, set_neg in |- *.  unfold Setminus in |- *.  simpl in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold bool_fun_impl in |- *.  unfold set_1 in |- *.  intros.  unfold In in H6.
(* Goal: In var_env'' (Union var_env'' (fun x : var_env'' => and (In var_env'' (Evar_env'' O N) x) (not (In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; clear H6; intros H8 H9.

(* Goal: In var_env'' (Union var_env'' (fun x : var_env'' => and (In var_env'' (Evar_env'' O N) x) (not (In var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) x))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold implb in H8.  unfold ifb in H8.
  elim
   (sumbool_of_bool
      (bool_fun_of_bool_expr (mu_eval N te m re)
         (fun x0 : BDDvar => in_dom unit (N_of_nat (nat_of_N x0)) x))).
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  intro y.  rewrite y in H8.  apply Union_intror.  unfold In in |- *.  rewrite H8.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  auto with bool.  intro y.  apply Union_introl.  unfold In in |- *.  split.  assumption.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold not in |- *; intro.
(* Goal: False *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (m0 : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m0) (_ : mu_form_ap_ok (var_lu O N) m0) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m0 sre) (bool_expr_to_var_env'' O N (mu_eval N te m0 re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_iff m m0)) (_ : mu_form_ap_ok (var_lu O N) (mu_iff m m0)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_iff m m0) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_iff m m0) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; intros H10 H11.

(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite y in H10.  discriminate.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  inversion H2.  assumption.  inversion H3.  assumption.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  inversion H2.  assumption.  inversion H3.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  simpl in |- *.  intros.  rewrite (H0 re sre).  rewrite (H1 re sre).
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' t1)) true *)
(* Goal: In var_env'' (Evar_env'' O N) s *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_iff, bool_expr_to_var_env'' in |- *.  unfold eval_be' in |- *.
(* Goal: @eq (Ensemble var_env'') (set_and (set_impl (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve))) (set_impl (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (var_env'_to_env (var_env''_to_env' ve))) true) (In var_env'' (Evar_env'' O N) ve)) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold var_env'_to_env, var_env''_to_env' in |- *.  unfold set_and, set_impl in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply Extensionality_Ensembles.  split.  unfold Included in |- *.  intros.  unfold In in |- *.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  simpl in |- *.  unfold bool_fun_iff in |- *.  inversion H6.  clear H6.
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_or, set_neg in H7.  unfold Setminus in H7.
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_or, set_neg in H8.  unfold Setminus in H8.  unfold set_1 in H7.
(* Goal: In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_1 in H8.  inversion H7.  unfold In in H6.  clear H7.
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; clear H6; intros H11 H12.

(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split.  inversion H8.  clear H8.
(* Goal: In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold In in H6.
(* Goal: @eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true *)
(* Goal: @eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true *)
(* Goal: Evar_env'' O N x *)
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; clear H6; intros H13 H14.

  replace
   (bool_fun_of_bool_expr (mu_eval N te m re)
      (fun x0 : BDDvar => in_dom unit (N_of_nat (nat_of_N x0)) x)) with
   false.
  replace
   (bool_fun_of_bool_expr (mu_eval N te m0 re)
      (fun x0 : BDDvar => in_dom unit (N_of_nat (nat_of_N x0)) x)) with
   false.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  reflexivity.  symmetry  in |- *.  apply not_true_is_false.
(* Goal: @eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) false *)
(* Goal: @eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true *)
(* Goal: Evar_env'' O N x *)
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  exact (fun x => H14 (conj x H13)).  symmetry  in |- *.  apply not_true_is_false.
(* Goal: In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  exact (fun x => H12 (conj x H13)).  unfold In in H6.
(* Goal: @eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true *)
(* Goal: Evar_env'' O N x *)
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; intros H14 H15.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite H14 in H12.  elim H12; auto with bool.  assumption.  unfold In in H6.
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; clear H6; intros H12 H13.
(* Goal: In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  inversion H8.  clear H8.  unfold In in H6.
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; clear H6; intros H14 H15.
(* Goal: and (@eq bool true true) (Evar_env'' O N x) *)
(* Goal: forall _ : @eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) false, In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite H12 in H15.  elim H15; auto with bool.
(* Goal: In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold In in H6.
(* Goal: and (@eq bool (eqb (bool_fun_of_bool_expr (mu_eval N te m re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x)) (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x0 : BDDvar => in_dom unit (N.of_nat (N.to_nat x0)) x))) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (Iff (mu_eval N te m re) (mu_eval N te m0 re)) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)) (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; intros H15 H16.

(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite H12.  rewrite H15.  split.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  reflexivity.  assumption.  unfold Included in |- *.  intros.  unfold In in H6.
(* Goal: In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  simpl in H6.  unfold bool_fun_iff in H6.
(* Goal: In var_env'' (Intersection var_env'' (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (set_or (set_neg (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m0 re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve))) (fun ve : var_env'' => and (@eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (fun x : BDDvar => in_dom unit (N.of_nat (N.to_nat x)) ve)) true) (In var_env'' (Evar_env'' O N) ve)))) x *)
(* Goal: f_ok m0 *)
(* Goal: mu_form_ap_ok (var_lu O N) m0 *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_all a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_all a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_all a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_all a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H6; intros H8 H9.
  elim
   (sumbool_of_bool
      (bool_fun_of_bool_expr (mu_eval N te m re)
         (fun x0 : BDDvar => in_dom unit (N_of_nat (nat_of_N x0)) x))).
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  intro y.  apply Intersection_intro.  unfold set_or, set_neg in |- *.  unfold Setminus in |- *.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  apply Union_intror.  unfold In in |- *.  rewrite (eqb_prop _ _ H8) in y.  rewrite y.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  auto with bool.  unfold set_or, set_neg in |- *.  apply Union_intror.  unfold In in |- *.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  rewrite y.  auto with bool.  intro y.  apply Intersection_intro.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  unfold set_or, set_neg in |- *.  apply Union_introl.  unfold Setminus, In in |- *.  rewrite y.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold set_1 in |- *.  split.  assumption.  unfold not in |- *; intros.  decompose [and] H7.
(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  discriminate.  unfold set_or, set_neg in |- *.  apply Union_introl.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold Setminus, In in |- *.  unfold set_1 in |- *.  split.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  rewrite <- (eqb_prop _ _ H8).  rewrite y.  unfold not in |- *; intro.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  decompose [and] H7.  discriminate.  inversion H2.  assumption.  inversion H3.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  assumption.  inversion H2.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  inversion H3.  assumption.  assumption.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  simpl in |- *.  unfold set_all in |- *.  inversion H1.  inversion H2.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (H0 re sre).  apply Extensionality_Ensembles.  split.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Included in |- *.  intros.  unfold In in |- *.  unfold bool_expr_to_var_env'' in |- *.
(* Goal: ste a x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold te_ste_ok in H.  unfold In in H11.
(* Goal: set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H11; clear H11; intros H13 H14.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold set_1 in H13.  split.  apply mu_all_eval_semantics2.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m H6).  intros.  apply H11.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  unfold Evar_env'' in H13.  unfold var_env''_to_env' in |- *.  intros.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply not_false_is_true.  unfold not in |- *; intro.
(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (proj2 H13 _ H12) in H11.  discriminate.  
(* Goal: @eq bool (eval_be' (te t) (var_env'_or (var_env''_to_env' x) (var_env'_dash N (var_env''_to_env' t1)))) true *)
(* Goal: In var_env'' (Evar_env'' O N) t1 *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold new_t_to_rel in H.  unfold t_to_rel in H.  unfold t_to_rel1 in H.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  unfold bool_expr_to_var_env'' in H14.
  replace (eval_be' (mu_eval N te m re) ve') with
   (eval_be' (mu_eval N te m re)
      (var_env''_to_env' (var_env'_to_env'' 0 N ve'))).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (H14 (var_env'_to_env'' 0 N ve')).  intros.  apply H15.  clear H14.
(* Goal: ste a x (var_env'_to_env'' O N ve') *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  apply (proj1 (H a x (var_env'_to_env'' 0 N ve'))).  rewrite <- H12.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  split.  apply bool_fun_of_be_ext1.  intros.  unfold ad_to_be_ok in te_ok.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  cut (var_lu 0 (2 * N) x0 = true).  intro.  unfold var_lu in H15.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (andb_prop _ _ H15).  intros.  unfold var_env'_or in |- *.
(* Goal: Evar_env'' O N (var_env'_to_env'' O N ve) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold var_env'_to_env'' in |- *.  unfold var_env''_to_env' at 2 in |- *.
(* Goal: and (mapcanon unit (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N ve' (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N ve' (@eq_refl nat (Init.Nat.sub N O)) in ve'')) false) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N ve' (refl_equal (N - 0))).
(* Goal: forall (x : var_env'') (_ : and (In var_env'' (Evar_env'' O N) x) (forall (x1 : ad) (_ : @eq bool (var_lu O N x1) true), @eq bool (in_dom unit x1 x) (x0 (N.to_nat x1)))), and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  intros x1 y.
(* Goal: @eq bool (orb (var_env''_to_env' x (N.to_nat x0)) (var_env'_dash N (fun n : nat => in_dom unit (N.of_nat n) x1) (N.to_nat x0))) (orb (var_env''_to_env' x (N.to_nat x0)) (var_env'_dash N ve' (N.to_nat x0))) *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x0) true *)
(* Goal: rel_1 x (var_env'_to_env'' O N ve') *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim y; intros H19 H20.

(* Goal: @eq bool (orb (var_env''_to_env' x (N.to_nat x0)) (var_env'_dash N (fun n : nat => in_dom unit (N.of_nat n) x1) (N.to_nat x0))) (orb (var_env''_to_env' x (N.to_nat x0)) (var_env'_dash N ve' (N.to_nat x0))) *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x0) true *)
(* Goal: rel_1 x (var_env'_to_env'' O N ve') *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (var_env''_to_env' x (nat_of_N x0)).
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  reflexivity.  simpl in |- *.  unfold var_env'_dash in |- *.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  elim (sumbool_of_bool (leb N (nat_of_N x0))).  intro y0.  rewrite y0.
(* Goal: @eq bool (in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x0) N)) x1) (ve' (Init.Nat.sub (N.to_nat x0) N)) *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x0)) false, @eq bool (if Nat.leb N (N.to_nat x0) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x0) N)) x1 else false) (if Nat.leb N (N.to_nat x0) then ve' (Init.Nat.sub (N.to_nat x0) N) else false) *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x0) true *)
(* Goal: rel_1 x (var_env'_to_env'' O N ve') *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (H20 (N_of_nat (nat_of_N x0 - N))).
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (nat_of_N_of_nat (nat_of_N x0 - N)).  reflexivity.  
(* Goal: @eq nat N (Init.Nat.add N O) *)
(* Goal: le N (N.to_nat x1) *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x1) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold var_lu in |- *.  apply andb_true_intro.  split.  auto with arith.  
(* Goal: @eq bool (Nat.leb (S (Init.Nat.sub (N.to_nat x1) N)) N) true *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x1) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (nat_of_N_of_nat (nat_of_N x0 - N)).  apply leb_correct.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (minus_Sn_m (nat_of_N x0) N).  cut (N = 2 * N - N).  intro.
  replace (S (nat_of_N x0) - N <= N) with
   (S (nat_of_N x0) - N <= 2 * N - N).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply le_minus_le1.  apply leb_complete.  assumption.  unfold mult at 1 in |- *.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  replace (N + (N + 0) - N) with N.  reflexivity.  simpl in |- *.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  replace (N + 0) with N.  apply plus_minus.  reflexivity.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  auto with arith.  apply leb_complete; assumption.  intro y0.  rewrite y0.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  reflexivity.  apply be_ok_be_x_free with (be := te t).  apply te_ok.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite H5.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold rel_1 in |- *.  unfold set_1 in |- *.  split.  assumption.  unfold In in |- *.
(* Goal: forall (x : var_env'') (_ : and (In var_env'' (Evar_env'' O N) x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) true), @eq bool (in_dom unit x0 x) (ve' (N.to_nat x0)))), and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold Evar_env'' in |- *.  unfold var_env'_to_env'' in |- *.
(* Goal: and (mapcanon unit (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N ve' (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N ve' (@eq_refl nat (Init.Nat.sub N O)) in ve'')) false) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N ve' (refl_equal (N - 0))).
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  unfold Evar_env'' in |- *.  unfold In in |- *.  intros x0 y.
(* Goal: and (mapcanon unit x0) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x x0) false) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N ve'))) (eval_be' (mu_eval N te m re) ve') *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_all_eval N (te a) (mu_eval N te m re))) (fun s : var_env'' => and (In var_env'' set_1 s) (forall (t : var_env'') (_ : ste a s t), In var_env'' (bool_expr_to_var_env'' O N (mu_eval N te m re)) t)) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim y; intros H14 H16; elim H14; clear H14; intros H14 H17.

(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  assumption.  apply bool_fun_of_be_ext1.  intros.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m H6 H9).  intros.  clear H17.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (var_env'_to_env''_to_env' 0 N ve' x0).  reflexivity.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply be_ok_be_x_free with (be := mu_eval N te m re).  apply H16.  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  assumption.  unfold Included in |- *.  unfold In in |- *.  intros.
(* Goal: and (set_1 x) (forall (t : var_env'') (_ : ste a x t), bool_expr_to_var_env'' O N (mu_eval N te m re) t) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold bool_expr_to_var_env'' in H11.
(* Goal: set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H11; clear H11; intros H13 H14. 

(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  split.  unfold set_1 in |- *.  assumption.  intros.  unfold te_ste_ok in H.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold bool_expr_to_var_env'' in |- *.  split.
  apply
   mu_all_eval_semantics1
    with (N := N) (t := te t) (ve := var_env''_to_env' x).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m H6).  intros.  apply H12.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  intros.  unfold Evar_env'', In in H14.
(* Goal: @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_all_eval N (te t) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' t1 n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (te t) (var_env'_or (var_env''_to_env' x) (var_env'_dash N (var_env''_to_env' t1)))) true *)
(* Goal: In var_env'' (Evar_env'' O N) t1 *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold var_env''_to_env' in H12.
(* Goal: @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_all_eval N (te t) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' t1 n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (te t) (var_env'_or (var_env''_to_env' x) (var_env'_dash N (var_env''_to_env' t1)))) true *)
(* Goal: In var_env'' (Evar_env'' O N) t1 *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H14; intros H16 H17.  
(* Goal: @eq bool (var_lu O N (N.of_nat (Init.Nat.sub (N.to_nat x1) N))) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold var_lu in |- *.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (nat_of_N_of_nat n).  apply andb_true_intro.  split.
(* Goal: @eq nat N (Init.Nat.add N O) *)
(* Goal: le N (N.to_nat x1) *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x1) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  auto with arith.  unfold var_lu in H17.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  cut (leb 0 n && leb (S n) N = true).  intros.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (andb_prop _ _ H15).  intros.  assumption.  apply not_false_is_true.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold not in |- *.  replace n with (nat_of_N (N_of_nat n)).  intro.
(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (H17 _ H15) in H12.  discriminate.  apply nat_of_N_of_nat.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite H5.  assumption.  unfold new_t_to_rel in H.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (proj2 (H a x t1) H11).  intros.  unfold rel_1 in H15.
(* Goal: @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (te t) (var_env'_or (var_env''_to_env' x) (var_env'_dash N (var_env''_to_env' t1)))) true *)
(* Goal: In var_env'' (Evar_env'' O N) t1 *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold set_1 in H15.  unfold Evar_env'' in H15.  unfold In in H15.
(* Goal: @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (te t) (var_env'_or (var_env''_to_env' x) (var_env'_dash N (var_env''_to_env' t1)))) true *)
(* Goal: In var_env'' (Evar_env'' O N) t1 *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_ex a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_ex a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_ex a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_ex a m) re)) *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold var_env''_to_env' in H16.
  elim H15; intros H17 H18; elim H17; clear H17; intros H17 H20; elim H18;
   clear H18; intros H18 H21.

(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply not_false_is_true.  unfold not in |- *; intro.  rewrite (H21 _ H19) in H16.
(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  discriminate.  unfold new_t_to_rel in H.  unfold t_to_rel in H.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold t_to_rel1 in H.  elim (H t x t1).  intros.  rewrite <- H5 in H11.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (H15 H11).  intros.  assumption.  elim (H t x t1).  intros.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  rewrite <- H5 in H11.  elim (H15 H11).  intros.  unfold rel_1, set_1 in H17.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  exact (proj2 H17).  assumption.  assumption.  assumption.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  simpl in |- *.  (* Unfold set_ex. *)  inversion H1.  inversion H2.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (H0 re sre).  apply Extensionality_Ensembles.  split.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Included in |- *.  intros.  unfold In in |- *.  unfold bool_expr_to_var_env'' in |- *.
(* Goal: and (@eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true) (In var_env'' (Evar_env'' O N) x) *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold te_ste_ok in H.  unfold In in H11.  (* Unfold set_ex in H11. *)  elim H11.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  elim (proj2 (H a s t1) H13).  intros.  unfold rel_1, set_1 in H16.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split.  apply mu_ex_eval_semantics2.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m H6 H9).  intros.  apply H17.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold set_1, In in H12.  unfold Evar_env'' in H12.  intros.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold var_env''_to_env' in H17.  apply not_false_is_true.  unfold not in |- *; intro.
(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (proj2 H12 _ H18) in H17.  discriminate.  
(* Goal: @ex var_env' (fun ve' : var_env' => and (forall (n : nat) (_ : @eq bool (ve' n) true), @eq bool (var_lu O N (N.of_nat n)) true) (and (@eq bool (eval_be' (te a) (var_env'_or (var_env''_to_env' s) (var_env'_dash N ve'))) true) (@eq bool (eval_be' (mu_eval N te m re) ve') true))) *)
(* Goal: In var_env'' (Evar_env'' O N) s *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  split with (var_env''_to_env' t1).  unfold In, Evar_env'' in H16.
  elim H16; intros H17 H18; elim H17; clear H17; intros H17 H20; elim H18;
   clear H18; intros H18 H21.

(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  split.  intros.  apply not_false_is_true.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold not in |- *; intro.  unfold var_env''_to_env' in H19.
(* Goal: False *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (H21 _ H22) in H19.  discriminate.  split.  unfold t_to_rel in H15.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold t_to_rel1 in H15.  assumption.  unfold eval_be' in |- *.  unfold In in H14.
(* Goal: @eq bool (bool_fun_of_bool_expr (mu_eval N te m re) (var_env'_to_env (var_env''_to_env' t1))) true *)
(* Goal: In var_env'' (Evar_env'' O N) s *)
(* Goal: Included var_env'' (bool_expr_to_var_env'' O N (mu_ex_eval N (te a) (mu_eval N te m re))) (set_ex (ste a) (bool_expr_to_var_env'' O N (mu_eval N te m re))) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold bool_expr_to_var_env'' in H14.  unfold eval_be' in H14.
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  exact (proj1 H14).  exact (proj1 H16).  unfold Included in |- *.  unfold In in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold bool_expr_to_var_env'' in |- *.  intros.
(* Goal: set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H11; clear H11; intros H13 H14.

  elim
   mu_ex_eval_semantics1
    with
      (N := N)
      (t := te a)
      (be := mu_eval N te m re)
      (ve := var_env''_to_env' x).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.
(* Goal: set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H11; clear H11; intros H15 H12; elim H12; clear H12; intros H12 H17.

  cut
   (forall s t0 : var_env'',
    In var_env'' set_1 s ->
    ste a s t0 ->
    In var_env''
      (fun ve : var_env'' =>
       eval_be' (mu_eval N te m re) (var_env''_to_env' ve) = true /\
       In var_env'' (Evar_env'' 0 N) ve) t0 ->
    In var_env''
      (set_ex (ste a)
         (fun ve : var_env'' =>
          eval_be' (mu_eval N te m re) (var_env''_to_env' ve) = true /\
          In var_env'' (Evar_env'' 0 N) ve)) s).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold In in |- *.  intros.  apply H11 with (s := x) (t0 := var_env'_to_env'' 0 N x0).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold set_1 in |- *.  assumption.  unfold te_ste_ok in H.
(* Goal: ste a x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  apply (proj1 (H a x (var_env'_to_env'' 0 N x0))).  unfold new_t_to_rel in |- *.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold t_to_rel in |- *.  unfold t_to_rel1 in |- *.  split.  rewrite <- H12.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply bool_fun_of_be_ext1.  intros.
(* Goal: @eq bool (var_env'_or (var_env''_to_env' x) (var_env'_dash N (var_env''_to_env' (var_env'_to_env'' O N x0))) (N.to_nat x1)) (var_env'_or (var_env''_to_env' x) (var_env'_dash N x0) (N.to_nat x1)) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold var_env'_or, var_env''_to_env', var_env'_dash in |- *.
(* Goal: @eq bool (orb (in_dom unit (N.of_nat (N.to_nat x1)) x) (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false)) (orb (in_dom unit (N.of_nat (N.to_nat x1)) x) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false)) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (N_of_nat_of_N x1).  elim (sumbool_of_bool (in_dom unit x1 x)).
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  intro y.  rewrite y.  simpl in |- *.  reflexivity.  intro y.  rewrite y.  simpl in |- *.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  elim (sumbool_of_bool (leb N (nat_of_N x1))).  intro y0.  rewrite y0.
(* Goal: Evar_env'' O N (var_env'_to_env'' O N ve) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold var_env'_to_env'' in |- *.
(* Goal: and (mapcanon unit (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N x0 (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N x0 (@eq_refl nat (Init.Nat.sub N O)) in ve'')) false) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N x0 (refl_equal (N - 0))).
(* Goal: forall (x : var_env'') (_ : and (In var_env'' (Evar_env'' O N) x) (forall (x1 : ad) (_ : @eq bool (var_lu O N x1) true), @eq bool (in_dom unit x1 x) (x0 (N.to_nat x1)))), @eq bool (in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) x) (x0 (Init.Nat.sub (N.to_nat x1) N)) *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  intros x2 y1.
(* Goal: @eq bool (in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) x2) (x0 (Init.Nat.sub (N.to_nat x1) N)) *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim y1; intros H19 H20.

(* Goal: @eq bool (in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) x2) (x0 (Init.Nat.sub (N.to_nat x1) N)) *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (H20 (N_of_nat (nat_of_N x1 - N))).
(* Goal: @eq bool (Nat.leb (S (N.to_nat (N.of_nat (Init.Nat.sub (N.to_nat x1) N)))) N) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (nat_of_N_of_nat (nat_of_N x1 - N)).
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  reflexivity.  unfold var_lu in |- *.  apply andb_true_intro.  split.
(* Goal: @eq bool (Nat.leb (S (Init.Nat.sub (N.to_nat x1) N)) N) true *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x1) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  apply leb_correct.  apply le_O_n.  
(* Goal: @eq bool (Nat.leb (S (N.to_nat (N.of_nat (Init.Nat.sub (N.to_nat x1) N)))) N) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (nat_of_N_of_nat (nat_of_N x1 - N)).
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  cut (var_lu 0 (2 * N) x1 = true).  intro.  unfold var_lu in H18.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (andb_prop _ _ H18).  intros.  clear H21.  apply leb_correct.
(* Goal: le (S (Init.Nat.sub (N.to_nat x1) N)) N *)
(* Goal: @eq bool (var_lu O (Init.Nat.mul (S (S O)) N) x1) true *)
(* Goal: forall _ : @eq bool (Nat.leb N (N.to_nat x1)) false, @eq bool (if Nat.leb N (N.to_nat x1) then in_dom unit (N.of_nat (Init.Nat.sub (N.to_nat x1) N)) (var_env'_to_env'' O N x0) else false) (if Nat.leb N (N.to_nat x1) then x0 (Init.Nat.sub (N.to_nat x1) N) else false) *)
(* Goal: rel_1 x (var_env'_to_env'' O N x0) *)
(* Goal: and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' (var_env'_to_env'' O N x0))) true) (Evar_env'' O N (var_env'_to_env'' O N x0)) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  rewrite (minus_Sn_m (nat_of_N x1) N).
  replace (S (nat_of_N x1) - N <= N) with
   (S (nat_of_N x1) - N <= 2 * N - N).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply le_minus_le1.  apply leb_complete.  assumption.  unfold mult at 1 in |- *.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  replace (N + (N + 0) - N) with N.  reflexivity.  simpl in |- *.
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  replace (N + 0) with N.  apply plus_minus.  reflexivity.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  auto with arith.  apply leb_complete; assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply be_ok_be_x_free with (be := te a).  apply te_ok.  assumption.  intro y0.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite y0.  reflexivity.  unfold rel_1 in |- *.  unfold set_1 in |- *.  split.  assumption.
(* Goal: Evar_env'' O N (var_env'_to_env'' O N ve) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold var_env'_to_env'' in |- *.
(* Goal: and (mapcanon unit (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N x0 (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N x0 (@eq_refl nat (Init.Nat.sub N O)) in ve'')) false) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N x0 (refl_equal (N - 0))).
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  intros x1 y.  exact (proj1 y).  split.  rewrite <- H17.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply bool_fun_of_be_ext1.  intros.  apply var_env'_to_env''_to_env'.
(* Goal: @eq bool (var_lu O N x1) true *)
(* Goal: Evar_env'' O N (var_env'_to_env'' O N x0) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  apply be_ok_be_x_free with (be := mu_eval N te m re).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m H6 H9).  intros.  apply H18.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  unfold Evar_env'', var_env'_to_env'' in |- *.
(* Goal: and (mapcanon unit (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N x0 (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N x0 (@eq_refl nat (Init.Nat.sub N O)) in ve'')) false) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N x0 (refl_equal (N - 0))).
(* Goal: forall (x : var_env'') (_ : and (In var_env'' (Evar_env'' O N) x) (forall (x1 : ad) (_ : @eq bool (var_lu O N x1) true), @eq bool (in_dom unit x1 x) (x0 (N.to_nat x1)))), and (mapcanon unit x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) false), @eq bool (in_dom unit x0 x) false) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  intros x1 y.  unfold Evar_env'' in y.  unfold In in y.
(* Goal: and (mapcanon unit x1) (forall (x : ad) (_ : @eq bool (var_lu O N x) false), @eq bool (in_dom unit x x1) false) *)
(* Goal: forall (s t0 : var_env'') (_ : In var_env'' set_1 s) (_ : ste a s t0) (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) t0), In var_env'' (set_ex (ste a) (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te m re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve))) s *)
(* Goal: be_ok (var_lu O N) (mu_eval N te m re) *)
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim y; intros H16 H19; elim H16; clear H16; intros H16 H20.

(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  split.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  
  exact
   (setex_intro (ste a)
      (fun ve : var_env'' =>
       eval_be' (mu_eval N te m re) (var_env''_to_env' ve) = true /\
       In var_env'' (Evar_env'' 0 N) ve)).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m H6 H9).  intros.  apply H11.  assumption.  
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  unfold In, Evar_env'' in H14.
(* Goal: forall (n : nat) (_ : @eq bool (var_env''_to_env' x n) true), @eq bool (var_lu O N (N.of_nat n)) true *)
(* Goal: @eq bool (eval_be' (mu_ex_eval N (te a) (mu_eval N te m re)) (var_env''_to_env' x)) true *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) re *)
(* Goal: re_sre_ok re sre *)
(* Goal: forall (a : ad) (m : mu_form) (_ : forall (re : rel_env) (sre : set_renv) (_ : f_ok m) (_ : mu_form_ap_ok (var_lu O N) m) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste m sre) (bool_expr_to_var_env'' O N (mu_eval N te m re))) (re : rel_env) (sre : set_renv) (_ : f_ok (mu_mu a m)) (_ : mu_form_ap_ok (var_lu O N) (mu_mu a m)) (_ : ad_to_be_ok (var_lu O N) re) (_ : re_sre_ok re sre), @eq (Ensemble var_env'') (mu_form2set ste (mu_mu a m) sre) (bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re)) *)
  elim H14; intros H12 H15.

(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply not_false_is_true.  unfold not in |- *; intro.  unfold var_env''_to_env' in H11.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  rewrite (H15 _ H16) in H11.  discriminate.  assumption.  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  unfold bool_expr_to_var_env'' in |- *.  inversion H1.  inversion H2.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply Extensionality_Ensembles.  split.  unfold Included in |- *.  intros.
(* Goal: forall (x : var_env'') (_ : In var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) x), In var_env'' (mu_form2set ste (mu_mu a m) sre) x *)
  simpl in H12.  unfold In in H12.  unfold set_mu in H12.  unfold In in |- *.
(* Goal: and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' x)) true) (Evar_env'' O N x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  cut (bool_expr_to_var_env'' 0 N (mu_eval N te (mu_mu a m) re) x).
(* Goal: In var_env'' (bool_expr_to_var_env'' O N Be) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold bool_expr_to_var_env'' in |- *.  trivial.  unfold In in H12.  apply H12.
(* Goal: state_set (fun x : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) x) *)
(* Goal: Included var_env'' (mu_form2set ste m (sre_put sre a (fun x : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) x))) (fun x : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) x) *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  unfold state_set in |- *.  unfold set_1, Included in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold bool_expr_to_var_env'', Evar_env'', In in |- *.  intros.  exact (proj2 H13).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Included in |- *.  intros.  unfold In in |- *.  unfold In in H13.  
  cut
   (mu_form2set ste m
      (sre_put sre a
         (fun v : var_env'' =>
          bool_expr_to_var_env'' 0 N (mu_eval N te (mu_mu a m) re) v)) x0).
  rewrite
   (H0 (re_put re a (mu_eval N te (mu_mu a m) re))
      (sre_put sre a
         (fun v : var_env'' =>
          bool_expr_to_var_env'' 0 N (mu_eval N te (mu_mu a m) re) v)))
   .
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold bool_expr_to_var_env'' in |- *.  intros.
(* Goal: and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' x0)) true) (In var_env'' (Evar_env'' O N) x0) *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a (mu_eval N te (mu_mu a m) re)) *)
(* Goal: re_sre_ok (re_put re a (mu_eval N te (mu_mu a m) re)) (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  elim H14; clear H14; intros H16 H17.

(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_mu_is_lfp N te te_ok a m re).  intros.  unfold fp in H14.
(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold be_eq in H14.  rewrite (H14 (var_env''_to_env' x0)).  split.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  assumption.  assumption.  assumption.  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  unfold ad_to_be_ok in |- *.  intros.  unfold re_put in |- *.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  elim (sumbool_of_bool (Neqb a x1)).  intro y.  rewrite y.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok (mu_mu a m)).  intros.  apply H14.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  assumption.  assumption.  intro y.  rewrite y.  apply H3.  
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold re_sre_ok in |- *.  unfold re_put, sre_put in |- *.  intro.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  elim (sumbool_of_bool (Neqb a P1)).  intro y.  rewrite y.
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then mu_eval N te (mu_mu a m) re else re P1)) (if N.eqb a P1 then fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v else sre P1) *)
(* Goal: mu_form2set ste m (sre_put sre a (fun v : var_env'' => bool_expr_to_var_env'' O N (mu_eval N te (mu_mu a m) re) v)) x0 *)
(* Goal: Included var_env'' (fun ve : var_env'' => and (@eq bool (eval_be' (mu_eval N te (mu_mu a m) re) (var_env''_to_env' ve)) true) (In var_env'' (Evar_env'' O N) ve)) (mu_form2set ste (mu_mu a m) sre) *)
  unfold bool_expr_to_var_env'' in |- *.  reflexivity.  intro y.  rewrite y.  apply H4. 
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold Included in |- *.  unfold In in |- *.  intros.  simpl in |- *.  unfold set_mu in |- *.  intros.
(* Goal: In var_env'' X x *)
  elim H12; clear H12; intros H16 H17.

(* Goal: In var_env'' X x *)
  elim (env_to_be_lemma1 X H13).  intro Be.
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  intro.  elim H12.  clear H12.  intros y H00.
(* Goal: In var_env'' X x *)
  rewrite (H0 (re_put re a Be) (sre_put sre a X)) in H14.  simpl in H16.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m).  intros.
(* Goal: In var_env'' X x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  elim H15; intros H19 H18; elim H18; clear H18; intros H18 H21.

(* Goal: and (@eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true) (Evar_env'' O N (var_env'_to_env'' O N ve)) *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  clear H15 H18.  rewrite <- y.  unfold bool_expr_to_var_env'' in |- *.  split.
  cut
   (be_le
      (fst
         (iter2n bool_expr be_eq_dec
            (fun be : bool_expr => mu_eval N te m (re_put re a be)) Zero N))
      Be).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  intro.  unfold be_le in H15.  apply H15.  assumption.  
  apply
   be_le_trans
    with
      (be2 := fst
                (iter2n bool_expr be_eq_dec
                   (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be
                   N)).
  apply
   be_le_trans
    with
      (be2 := be_iter1
                (fun be : bool_expr => mu_eval N te m (re_put re a be)) Zero
                (two_power N)).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply be_eq_le.  apply be_iter2n_2n.  intros.  apply H21.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold ad_to_be_eq, re_put in |- *.  intros.  elim (Neqb a x0).  assumption.  
(* Goal: be_eq (re x0) (re x0) *)
(* Goal: be_le (be_iter1 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (two_power N)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply be_eq_refl.  
  apply
   be_le_trans
    with
      (be2 := be_iter1
                (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be
                (two_power N)).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply be_iter1_le_preserved.  apply be_le_zero.  intros.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold re_to_be_inc in H19.  apply H19.  assumption.  assumption.  
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply be_eq_le.  apply be_eq_sym.  apply be_iter2n_2n.  intros.  apply H21.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold ad_to_be_eq, re_put in |- *.  intro.  elim (Neqb a x0).  assumption.  
(* Goal: be_eq (re x0) (re x0) *)
(* Goal: be_le (be_iter1 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (two_power N)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply be_eq_refl.  
  apply
   be_le_trans
    with
      (be2 := be_iter1
                (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be
                (two_power N)).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  apply be_eq_le.  apply be_iter2n_2n.  intros.  apply H21.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold ad_to_be_eq, re_put in |- *.  intro.  elim (Neqb a x0).  assumption.  
(* Goal: be_eq (re x0) (re x0) *)
(* Goal: be_le (be_iter1 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (two_power N)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply be_eq_refl.  
  rewrite
   (be_iter1eq2 (fun be : bool_expr => mu_eval N te m (re_put re a be))
      (two_power N) Be).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  generalize (two_power N).  simple induction n.  simpl in |- *.  apply be_le_refl.  intros.
(* Goal: be_le (be_iter2 (fun be : bool_expr => mu_eval N te m (re_put re a be)) Be (S n0)) Be *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  simpl in |- *.  apply be_le_trans with (be2 := mu_eval N te m (re_put re a Be)).
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  unfold re_to_be_inc in H19.  apply H19.  assumption.  assumption.  
(* Goal: forall (ve : var_env') (_ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) ve) true), @eq bool (eval_be' Be ve) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold be_le in |- *.  intro.
  replace (eval_be' (mu_eval N te m (re_put re a Be)) ve) with
   (eval_be' (mu_eval N te m (re_put re a Be))
      (var_env''_to_env' (var_env'_to_env'' 0 N ve))).
  replace (eval_be' Be ve) with
   (eval_be' Be (var_env''_to_env' (var_env'_to_env'' 0 N ve))).
(* Goal: forall _ : @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) true, @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) true *)
(* Goal: @eq bool (eval_be' Be (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' Be ve) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite <- y in H14.  unfold Included, bool_expr_to_var_env'' in H14.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold In in H14.  intros.  elim (H14 (var_env'_to_env'' 0 N ve)).  intros.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  split.  assumption.  unfold var_env'_to_env'' in |- *.
(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N ve (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N ve (refl_equal (N - 0))).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros x0 y0.  exact (proj1 y0).  apply bool_fun_of_be_ext1.  intros.
(* Goal: @eq bool (var_env''_to_env' (var_env'_to_env'' O N ve) (N.to_nat x0)) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  unfold var_env''_to_env', var_env'_to_env'' in |- *.
(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N ve (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N ve (refl_equal (N - 0))).
(* Goal: forall (x : var_env'') (_ : and (In var_env'' (Evar_env'' O N) x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) true), @eq bool (in_dom unit x0 x) (ve (N.to_nat x0)))), @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) x) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  intros x1 y0.
(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) x1) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  elim y0; intros H22 H23.

(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) x1) (ve (N.to_nat x0)) *)
(* Goal: @eq bool (eval_be' (mu_eval N te m (re_put re a Be)) (var_env''_to_env' (var_env'_to_env'' O N ve))) (eval_be' (mu_eval N te m (re_put re a Be)) ve) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite <- (H23 _ (be_ok_be_x_free _ _ H00 _ H18)).
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (N_of_nat_of_N x0).  reflexivity.  apply bool_fun_of_be_ext1.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  unfold var_env''_to_env', var_env'_to_env'' in |- *.
(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) (let (ve'', _) := var_env'_to_var_env''_lemma2 (Init.Nat.sub N O) O N ve (@eq_refl nat (Init.Nat.sub N O)) in ve'')) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  elim (var_env'_to_var_env''_lemma2 (N - 0) 0 N ve (refl_equal (N - 0))).
(* Goal: forall (x : var_env'') (_ : and (In var_env'' (Evar_env'' O N) x) (forall (x0 : ad) (_ : @eq bool (var_lu O N x0) true), @eq bool (in_dom unit x0 x) (ve (N.to_nat x0)))), @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) x) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  intros x1 y0.
(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) x1) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  elim y0; intros H22 H23.

(* Goal: @eq bool (in_dom unit (N.of_nat (N.to_nat x0)) x1) (ve (N.to_nat x0)) *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite (N_of_nat_of_N x0).
(* Goal: @eq bool (in_dom unit x0 x1) (in_dom unit x0 x1) *)
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  rewrite <- (H23 x0).  reflexivity.  
(* Goal: @eq bool (var_lu O N x0) true *)
(* Goal: In var_env'' (Evar_env'' O N) x *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: f_ok m *)
(* Goal: mu_form_ap_ok (var_lu O N) m *)
(* Goal: ad_to_be_ok (var_lu O N) (re_put re a Be) *)
(* Goal: re_sre_ok (re_put re a Be) (sre_put sre a X) *)
  apply be_ok_be_x_free with (be := mu_eval N te m (re_put re a Be)).
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  elim (mu_eval_lemma1 N te te_ok m).  intros.  apply H20.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  unfold ad_to_be_ok, re_put in |- *.  intros.  elim (Neqb a x2).  assumption.  
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  apply H3.  assumption.  assumption.  assumption.  assumption.  assumption.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  assumption.  assumption.  assumption.  unfold ad_to_be_ok, re_put in |- *.  intros.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  elim (Neqb a x0).  assumption.  apply H3.  unfold re_sre_ok, re_put, sre_put in |- *.
(* Goal: forall P : ad, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P then Be else re P)) (if N.eqb a P then X else sre P) *)
  intros.  elim (sumbool_of_bool (Neqb a P1)).  intro y0.  rewrite y0.
(* Goal: @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N Be) X *)
(* Goal: forall _ : @eq bool (N.eqb a P1) false, @eq (Ensemble var_env'') (bool_expr_to_var_env'' O N (if N.eqb a P1 then Be else re P1)) (if N.eqb a P1 then X else sre P1) *)
  assumption.  intro y0.  rewrite y0.  apply H4.  
Qed.

End mu2set.