theory BCorres2_AI

lemma dxo_eq[simp]:
  "do_extended_op f = f" apply (simp add: do_extended_op_def all_but_exst_def
                   get_def select_f_def modify_def put_def
                   wrap_ext_op_det_ext_ext_def ef_mk_ef[OF b]) apply (rule ext) apply (simp add: bind_def) apply rule apply simp apply safe apply (simp | force | frule v)+ done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. do_extended_op f = f proof (prove)
goal (1 subgoal):
 1. do ex <- \<lambda>s. ({(s, s)}, False);
(uu_, es') <- \<lambda>s. (fst (f ex) \<times> {s}, snd (f ex));
s <- \<lambda>s. ({(s, s)}, False);
\<lambda>_. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)
od = f proof (prove)
goal (1 subgoal):
 1. \<And>x. (do ex <- \<lambda>s. ({(s, s)}, False);
(uu_, es') <- \<lambda>s. (fst (f ex) \<times> {s}, snd (f ex));
s <- \<lambda>s. ({(s, s)}, False);
\<lambda>_. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)
od) x = f x proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (x, xa) \<Rightarrow> (case x of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) xa), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x)) = f x proof (prove)
goal (3 subgoals):
 1. \<And>x r t. (r, t) \<in> fst (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x)) \<Longrightarrow> (r, t) \<in> fst (f x)
 2. \<And>x r t. (r, t) \<in> fst (f x) \<Longrightarrow> (r, t) \<in> fst (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x))
 3. \<And>x. snd (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x)) = snd (f x) proof (prove)
goal (3 subgoals):
 1. \<And>x t. \<exists>xa\<in>fst (f x). ((), t) \<in> fst ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x) \<Longrightarrow> ((), t) \<in> fst (f x)
 2. \<And>x r t. (r, t) \<in> fst (f x) \<Longrightarrow> (r, t) \<in> fst (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x))
 3. \<And>x. snd (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x)) = snd (f x) proof (prove)
goal (4 subgoals):
 1. \<And>x t b. \<lbrakk>((), b) \<in> fst (f x); ((), t) \<in> fst ({((), x\<lparr>exst := exst b\<rparr>)}, False)\<rbrakk> \<Longrightarrow> ((), t) \<in> fst (f x)
 2. \<And>x r t. (r, t) \<in> fst (f x) \<Longrightarrow> (r, t) \<in> fst (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x))
 3. \<And>x. snd (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x)) \<Longrightarrow> snd (f x)
 4. \<And>x. snd (f x) \<Longrightarrow> snd (\<Union>a\<in>fst (f x) \<times> {x}. fst (case a of (a, b) \<Rightarrow> (case a of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) b), (\<exists>xa\<in>fst (f x). snd ((case xa of (uu_, es') \<Rightarrow> \<lambda>s. ({((), s\<lparr>exst := exst es'\<rparr>)}, False)) x)) \<or> snd (f x)) proof (prove)
goal:
No subgoals!