theory Corres_UL

lemma corres_alternate1:
  "corres_underlying sr nf nf' r P P' a c \<Longrightarrow> corres_underlying sr nf nf' r P P' (a \<sqinter> b) c" apply (simp add: corres_underlying_def alternative_def) apply clarsimp apply (drule (1) bspec, clarsimp)+ apply (rule rev_bexI) apply (rule UnI1) apply assumption apply simp done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. corres_underlying sr nf nf' r P P' a c \<Longrightarrow> corres_underlying sr nf nf' r P P' (a \<sqinter> b) c proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>sr. case x of (s, s') \<Rightarrow> P s \<and> P' s' \<longrightarrow> (nf \<longrightarrow> \<not> snd (a s)) \<longrightarrow> (\<forall>x\<in>fst (c s'). case x of (r', t') \<Rightarrow> \<exists>x\<in>fst (a s). case x of (ra, t) \<Rightarrow> (t, t') \<in> sr \<and> r ra r') \<and> (nf' \<longrightarrow> \<not> snd (c s')) \<Longrightarrow> \<forall>x\<in>sr. case x of (s, s') \<Rightarrow> P s \<and> P' s' \<longrightarrow> (nf \<longrightarrow> \<not> snd (a s) \<and> \<not> snd (b s)) \<longrightarrow> (\<forall>x\<in>fst (c s'). case x of (r', t') \<Rightarrow> \<exists>x\<in>fst (a s) \<union> fst (b s). case x of (ra, t) \<Rightarrow> (t, t') \<in> sr \<and> r ra r') \<and> (nf' \<longrightarrow> \<not> snd (c s')) proof (prove)
goal (1 subgoal):
 1. \<And>aa ba. \<lbrakk>\<forall>x\<in>sr. case x of (s, s') \<Rightarrow> P s \<and> P' s' \<longrightarrow> (nf \<longrightarrow> \<not> snd (a s)) \<longrightarrow> (\<forall>x\<in>fst (c s'). case x of (r', t') \<Rightarrow> \<exists>x\<in>fst (a s). case x of (ra, t) \<Rightarrow> (t, t') \<in> sr \<and> r ra r') \<and> (nf' \<longrightarrow> \<not> snd (c s')); (aa, ba) \<in> sr; P aa; P' ba; nf \<longrightarrow> \<not> snd (a aa) \<and> \<not> snd (b aa)\<rbrakk> \<Longrightarrow> (\<forall>x\<in>fst (c ba). case x of (r', t') \<Rightarrow> \<exists>x\<in>fst (a aa) \<union> fst (b aa). case x of (ra, t) \<Rightarrow> (t, t') \<in> sr \<and> r ra r') \<and> (nf' \<longrightarrow> \<not> snd (c ba)) proof (prove)
goal (1 subgoal):
 1. \<And>aa ba aaa baa ab bb. \<lbrakk>(aa, ba) \<in> sr; P aa; P' ba; nf \<longrightarrow> \<not> snd (a aa) \<and> \<not> snd (b aa); (aaa, baa) \<in> fst (c ba); nf' \<longrightarrow> \<not> snd (c ba); (ab, bb) \<in> fst (a aa); (bb, baa) \<in> sr; r ab aaa\<rbrakk> \<Longrightarrow> \<exists>x\<in>fst (a aa) \<union> fst (b aa). case x of (ra, t) \<Rightarrow> (t, baa) \<in> sr \<and> r ra aaa proof (prove)
goal (2 subgoals):
 1. \<And>aa ba aaa baa ab bb. \<lbrakk>(aa, ba) \<in> sr; P aa; P' ba; nf \<longrightarrow> \<not> snd (a aa) \<and> \<not> snd (b aa); (aaa, baa) \<in> fst (c ba); nf' \<longrightarrow> \<not> snd (c ba); (ab, bb) \<in> fst (a aa); (bb, baa) \<in> sr; r ab aaa\<rbrakk> \<Longrightarrow> ?x38 aa ba aaa baa ab bb \<in> fst (a aa) \<union> fst (b aa)
 2. \<And>aa ba aaa baa ab bb. \<lbrakk>(aa, ba) \<in> sr; P aa; P' ba; nf \<longrightarrow> \<not> snd (a aa) \<and> \<not> snd (b aa); (aaa, baa) \<in> fst (c ba); nf' \<longrightarrow> \<not> snd (c ba); (ab, bb) \<in> fst (a aa); (bb, baa) \<in> sr; r ab aaa\<rbrakk> \<Longrightarrow> case ?x38 aa ba aaa baa ab bb of (ra, t) \<Rightarrow> (t, baa) \<in> sr \<and> r ra aaa proof (prove)
goal (2 subgoals):
 1. \<And>aa ba aaa baa ab bb. \<lbrakk>(aa, ba) \<in> sr; P aa; P' ba; nf \<longrightarrow> \<not> snd (a aa) \<and> \<not> snd (b aa); (aaa, baa) \<in> fst (c ba); nf' \<longrightarrow> \<not> snd (c ba); (ab, bb) \<in> fst (a aa); (bb, baa) \<in> sr; r ab aaa\<rbrakk> \<Longrightarrow> ?x38 aa ba aaa baa ab bb \<in> fst (a aa)
 2. \<And>aa ba aaa baa ab bb. \<lbrakk>(aa, ba) \<in> sr; P aa; P' ba; nf \<longrightarrow> \<not> snd (a aa) \<and> \<not> snd (b aa); (aaa, baa) \<in> fst (c ba); nf' \<longrightarrow> \<not> snd (c ba); (ab, bb) \<in> fst (a aa); (bb, baa) \<in> sr; r ab aaa\<rbrakk> \<Longrightarrow> case ?x38 aa ba aaa baa ab bb of (ra, t) \<Rightarrow> (t, baa) \<in> sr \<and> r ra aaa proof (prove)
goal (1 subgoal):
 1. \<And>aa ba aaa baa ab bb. \<lbrakk>(aa, ba) \<in> sr; P aa; P' ba; nf \<longrightarrow> \<not> snd (a aa) \<and> \<not> snd (b aa); (aaa, baa) \<in> fst (c ba); nf' \<longrightarrow> \<not> snd (c ba); (ab, bb) \<in> fst (a aa); (bb, baa) \<in> sr; r ab aaa\<rbrakk> \<Longrightarrow> case (ab, bb) of (ra, t) \<Rightarrow> (t, baa) \<in> sr \<and> r ra aaa proof (prove)
goal:
No subgoals!