[STATEMENT]
lemma robdd_list_\<alpha>_correct_aux :
assumes invar: "robdd_invar_vars_greater n b" "robdd_invar_reduced b"
shows "robdd_list_\<alpha> b n l \<longleftrightarrow> (\<forall>a \<in> (list_to_assignment_set l). robdd_\<alpha> b (\<lambda>v. a (v - n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. robdd_list_\<alpha> b n l = (\<forall>a\<in>list_to_assignment_set l. robdd_\<alpha> b (\<lambda>v. a (v - n)))
[PROOF STEP]
using invar
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater n b
robdd_invar_reduced b

goal (1 subgoal):
 1. robdd_list_\<alpha> b n l = (\<forall>a\<in>list_to_assignment_set l. robdd_\<alpha> b (\<lambda>v. a (v - n)))
[PROOF STEP]
proof (induct b n l rule: robdd_list_\<alpha>.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f n l. \<lbrakk>robdd_invar_vars_greater n (robdd_leaf f); robdd_invar_reduced (robdd_leaf f)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_leaf f) n l = (\<forall>a\<in>list_to_assignment_set l. robdd_\<alpha> (robdd_leaf f) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 3. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
case (1 f n l)
[PROOF STATE]
proof (state)
this:
robdd_invar_vars_greater n (robdd_leaf f)
robdd_invar_reduced (robdd_leaf f)

goal (3 subgoals):
 1. \<And>f n l. \<lbrakk>robdd_invar_vars_greater n (robdd_leaf f); robdd_invar_reduced (robdd_leaf f)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_leaf f) n l = (\<forall>a\<in>list_to_assignment_set l. robdd_\<alpha> (robdd_leaf f) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 3. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
with list_to_assignment_set_not_empty[of l]
[PROOF STATE]
proof (chain)
picking this:
list_to_assignment_set l \<noteq> {}
robdd_invar_vars_greater n (robdd_leaf f)
robdd_invar_reduced (robdd_leaf f)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_to_assignment_set l \<noteq> {}
robdd_invar_vars_greater n (robdd_leaf f)
robdd_invar_reduced (robdd_leaf f)

goal (1 subgoal):
 1. robdd_list_\<alpha> (robdd_leaf f) n l = (\<forall>a\<in>list_to_assignment_set l. robdd_\<alpha> (robdd_leaf f) (\<lambda>v. a (v - n)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
robdd_list_\<alpha> (robdd_leaf f) n l = (\<forall>a\<in>list_to_assignment_set l. robdd_\<alpha> (robdd_leaf f) (\<lambda>v. a (v - n)))

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
case prems: (2 i ll v rr n)
[PROOF STATE]
proof (state)
this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
note invar = prems(1,2)
[PROOF STATE]
proof (state)
this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
from invar
[PROOF STATE]
proof (chain)
picking this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)
[PROOF STEP]
have "robdd_\<alpha> ll \<noteq> robdd_\<alpha> rr"
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)

goal (1 subgoal):
 1. robdd_\<alpha> ll \<noteq> robdd_\<alpha> rr
[PROOF STEP]
by (metis robdd_equiv_alt_def_full robdd_invar_reduced.simps(2)
              robdd_invar_vars_greater.simps(2) robdd_invar_vars_impl)
[PROOF STATE]
proof (state)
this:
robdd_\<alpha> ll \<noteq> robdd_\<alpha> rr

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
robdd_\<alpha> ll \<noteq> robdd_\<alpha> rr
[PROOF STEP]
obtain a where a_sem_neq: "robdd_\<alpha> ll a \<noteq> robdd_\<alpha> rr a"
[PROOF STATE]
proof (prove)
using this:
robdd_\<alpha> ll \<noteq> robdd_\<alpha> rr

goal (1 subgoal):
 1. (\<And>a. robdd_\<alpha> ll a \<noteq> robdd_\<alpha> rr a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
robdd_\<alpha> ll a \<noteq> robdd_\<alpha> rr a

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
define aa where "aa v = a (v + n)" for v
[PROOF STATE]
proof (state)
this:
aa ?v = a (?v + n)

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
from invar(1)
[PROOF STATE]
proof (chain)
picking this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
[PROOF STEP]
have ll_sem: "\<And>b. robdd_\<alpha> ll (\<lambda>v'. (aa(v - n := b)) (v' - n)) = robdd_\<alpha> ll a"
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater n (robdd_var i ll v rr)

goal (1 subgoal):
 1. \<And>b. robdd_\<alpha> ll (\<lambda>v'. (aa(v - n := b)) (v' - n)) = robdd_\<alpha> ll a
[PROOF STEP]
apply (rule_tac robdd_\<alpha>_invar_greater [of "Suc v"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b. robdd_invar_vars_greater n (robdd_var i ll v rr) \<Longrightarrow> robdd_invar_vars_greater (Suc v) ll
 2. \<And>b va. \<lbrakk>robdd_invar_vars_greater n (robdd_var i ll v rr); Suc v \<le> va\<rbrakk> \<Longrightarrow> (aa(v - n := b)) (va - n) = a va
[PROOF STEP]
apply (simp_all add: aa_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b va. \<lbrakk>n \<le> v \<and> robdd_invar_vars_greater (Suc v) ll \<and> robdd_invar_vars_greater (Suc v) rr; Suc v \<le> va\<rbrakk> \<Longrightarrow> va - n = v - n \<longrightarrow> b = a va
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_\<alpha> ll (\<lambda>v'. (aa(v - n := ?b)) (v' - n)) = robdd_\<alpha> ll a

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
from invar(1)
[PROOF STATE]
proof (chain)
picking this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
[PROOF STEP]
have rr_sem: "\<And>b. robdd_\<alpha> rr (\<lambda>v'. (aa(v - n := b)) (v' - n)) = robdd_\<alpha> rr a"
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater n (robdd_var i ll v rr)

goal (1 subgoal):
 1. \<And>b. robdd_\<alpha> rr (\<lambda>v'. (aa(v - n := b)) (v' - n)) = robdd_\<alpha> rr a
[PROOF STEP]
apply (rule_tac robdd_\<alpha>_invar_greater [of "Suc v"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b. robdd_invar_vars_greater n (robdd_var i ll v rr) \<Longrightarrow> robdd_invar_vars_greater (Suc v) rr
 2. \<And>b va. \<lbrakk>robdd_invar_vars_greater n (robdd_var i ll v rr); Suc v \<le> va\<rbrakk> \<Longrightarrow> (aa(v - n := b)) (va - n) = a va
[PROOF STEP]
apply (simp_all add: aa_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b va. \<lbrakk>n \<le> v \<and> robdd_invar_vars_greater (Suc v) ll \<and> robdd_invar_vars_greater (Suc v) rr; Suc v \<le> va\<rbrakk> \<Longrightarrow> va - n = v - n \<longrightarrow> b = a va
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_\<alpha> rr (\<lambda>v'. (aa(v - n := ?b)) (v' - n)) = robdd_\<alpha> rr a

goal (2 subgoals):
 1. \<And>i l v r n. \<lbrakk>robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
 2. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
proof (cases "robdd_\<alpha> ll a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. robdd_\<alpha> ll a \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
 2. \<not> robdd_\<alpha> ll a \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
robdd_\<alpha> ll a

goal (2 subgoals):
 1. robdd_\<alpha> ll a \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
 2. \<not> robdd_\<alpha> ll a \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
with a_sem_neq rr_sem
[PROOF STATE]
proof (chain)
picking this:
robdd_\<alpha> ll a \<noteq> robdd_\<alpha> rr a
robdd_\<alpha> rr (\<lambda>v'. (aa(v - n := ?b)) (v' - n)) = robdd_\<alpha> rr a
robdd_\<alpha> ll a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
robdd_\<alpha> ll a \<noteq> robdd_\<alpha> rr a
robdd_\<alpha> rr (\<lambda>v'. (aa(v - n := ?b)) (v' - n)) = robdd_\<alpha> rr a
robdd_\<alpha> ll a

goal (1 subgoal):
 1. robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> robdd_\<alpha> rr a; \<And>b. \<not> robdd_\<alpha> rr (\<lambda>v'. if v' - n = v - n then b else aa (v' - n)); robdd_\<alpha> ll a\<rbrakk> \<Longrightarrow> \<exists>a. (a (v - n) \<longrightarrow> \<not> robdd_\<alpha> ll (\<lambda>v. a (v - n))) \<and> (\<not> a (v - n) \<longrightarrow> \<not> robdd_\<alpha> rr (\<lambda>v. a (v - n)))
[PROOF STEP]
apply (rule_tac exI[where x = "aa(v-n := False)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> robdd_\<alpha> rr a; \<And>b. \<not> robdd_\<alpha> rr (\<lambda>v'. if v' - n = v - n then b else aa (v' - n)); robdd_\<alpha> ll a\<rbrakk> \<Longrightarrow> ((aa(v - n := False)) (v - n) \<longrightarrow> \<not> robdd_\<alpha> ll (\<lambda>va. (aa(v - n := False)) (va - n))) \<and> (\<not> (aa(v - n := False)) (v - n) \<longrightarrow> \<not> robdd_\<alpha> rr (\<lambda>va. (aa(v - n := False)) (va - n)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))

goal (1 subgoal):
 1. \<not> robdd_\<alpha> ll a \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> robdd_\<alpha> ll a \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> robdd_\<alpha> ll a

goal (1 subgoal):
 1. \<not> robdd_\<alpha> ll a \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
with a_sem_neq ll_sem
[PROOF STATE]
proof (chain)
picking this:
robdd_\<alpha> ll a \<noteq> robdd_\<alpha> rr a
robdd_\<alpha> ll (\<lambda>v'. (aa(v - n := ?b)) (v' - n)) = robdd_\<alpha> ll a
\<not> robdd_\<alpha> ll a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
robdd_\<alpha> ll a \<noteq> robdd_\<alpha> rr a
robdd_\<alpha> ll (\<lambda>v'. (aa(v - n := ?b)) (v' - n)) = robdd_\<alpha> ll a
\<not> robdd_\<alpha> ll a

goal (1 subgoal):
 1. robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>robdd_\<alpha> rr a; \<And>b. \<not> robdd_\<alpha> ll (\<lambda>v'. if v' - n = v - n then b else aa (v' - n)); \<not> robdd_\<alpha> ll a\<rbrakk> \<Longrightarrow> \<exists>a. (a (v - n) \<longrightarrow> \<not> robdd_\<alpha> ll (\<lambda>v. a (v - n))) \<and> (\<not> a (v - n) \<longrightarrow> \<not> robdd_\<alpha> rr (\<lambda>v. a (v - n)))
[PROOF STEP]
apply (rule_tac exI[where x = "aa(v-n := True)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>robdd_\<alpha> rr a; \<And>b. \<not> robdd_\<alpha> ll (\<lambda>v'. if v' - n = v - n then b else aa (v' - n)); \<not> robdd_\<alpha> ll a\<rbrakk> \<Longrightarrow> ((aa(v - n := True)) (v - n) \<longrightarrow> \<not> robdd_\<alpha> ll (\<lambda>va. (aa(v - n := True)) (va - n))) \<and> (\<not> (aa(v - n := True)) (v - n) \<longrightarrow> \<not> robdd_\<alpha> rr (\<lambda>va. (aa(v - n := True)) (va - n)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
robdd_list_\<alpha> (robdd_var i ll v rr) n [] = (\<forall>a\<in>list_to_assignment_set []. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
case prems: (3 i ll v rr n b bs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = v; b = None; robdd_invar_vars_greater (Suc n) ll; robdd_invar_reduced ll\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)))
\<lbrakk>n = v; b = None; robdd_invar_vars_greater (Suc n) rr; robdd_invar_reduced rr\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))
\<lbrakk>n = v; b = Some ?x2.0; ?x2.0 = True; robdd_invar_vars_greater (Suc n) ll; robdd_invar_reduced ll\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)))
\<lbrakk>n = v; b = Some ?x2.0; ?x2.0 = False; robdd_invar_vars_greater (Suc n) rr; robdd_invar_reduced rr\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))
\<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i ll v rr); robdd_invar_reduced (robdd_var i ll v rr)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - Suc n)))
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
note invar = prems(6,7)
[PROOF STATE]
proof (state)
this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
hence invar_rr: "robdd_invar_vars_greater (Suc n) rr" and red_ll: "robdd_invar_reduced ll"
    and invar_ll: "robdd_invar_vars_greater (Suc n) ll" and red_rr: "robdd_invar_reduced rr"
    and invar_n: "n \<noteq> v \<Longrightarrow> robdd_invar_vars_greater (Suc n) (robdd_var i ll v rr)"
    and n_le: "n \<le> v"
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)

goal (1 subgoal):
 1. (robdd_invar_vars_greater (Suc n) rr &&& robdd_invar_reduced ll &&& robdd_invar_vars_greater (Suc n) ll) &&& robdd_invar_reduced rr &&& (n \<noteq> v \<Longrightarrow> robdd_invar_vars_greater (Suc n) (robdd_var i ll v rr)) &&& n \<le> v
[PROOF STEP]
using robdd_invar_vars_greater___weaken [of "Suc v" _ "Suc n"]
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater n (robdd_var i ll v rr)
robdd_invar_reduced (robdd_var i ll v rr)
\<lbrakk>robdd_invar_vars_greater (Suc v) ?b; Suc n \<le> Suc v\<rbrakk> \<Longrightarrow> robdd_invar_vars_greater (Suc n) ?b

goal (1 subgoal):
 1. (robdd_invar_vars_greater (Suc n) rr &&& robdd_invar_reduced ll &&& robdd_invar_vars_greater (Suc n) ll) &&& robdd_invar_reduced rr &&& (n \<noteq> v \<Longrightarrow> robdd_invar_vars_greater (Suc n) (robdd_var i ll v rr)) &&& n \<le> v
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
robdd_invar_vars_greater (Suc n) rr
robdd_invar_reduced ll
robdd_invar_vars_greater (Suc n) ll
robdd_invar_reduced rr
n \<noteq> v \<Longrightarrow> robdd_invar_vars_greater (Suc n) (robdd_var i ll v rr)
n \<le> v

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
note indhyp_1 = prems(1)[OF _ _ invar_ll red_ll]
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = v; b = None\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
note indhyp_2 = prems(2)[OF _ _ invar_rr red_rr]
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = v; b = None\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
note indhyp_3 = prems(3)[of True, OF _ _ _ invar_ll red_ll, simplified]
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = v; b = Some True\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc v) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>va. a (va - Suc v)))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
note indhyp_4 = prems(4)[of False, OF _ _ _ invar_rr red_rr, simplified]
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = v; b = Some False\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc v) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>va. a (va - Suc v)))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
note indhyp_5 = prems(5)[OF _ invar_n invar(2), simplified]
[PROOF STATE]
proof (state)
this:
n \<noteq> v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. if a (v - Suc n) then robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)) else robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
from invar_ll
[PROOF STATE]
proof (chain)
picking this:
robdd_invar_vars_greater (Suc n) ll
[PROOF STEP]
have ll_sem: "\<And>a b. robdd_\<alpha> ll (\<lambda>v. case_nat b a (v - n)) = robdd_\<alpha> ll
                                     (\<lambda>v. a (v - Suc n))"
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater (Suc n) ll

goal (1 subgoal):
 1. \<And>a b. robdd_\<alpha> ll (\<lambda>v. case v - n of 0 \<Rightarrow> b | Suc x \<Rightarrow> a x) = robdd_\<alpha> ll (\<lambda>v. a (v - Suc n))
[PROOF STEP]
apply (rule_tac robdd_\<alpha>_invar_greater [of "Suc n"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. robdd_invar_vars_greater (Suc n) ll \<Longrightarrow> robdd_invar_vars_greater (Suc n) ll
 2. \<And>a b v. \<lbrakk>robdd_invar_vars_greater (Suc n) ll; Suc n \<le> v\<rbrakk> \<Longrightarrow> (case v - n of 0 \<Rightarrow> b | Suc x \<Rightarrow> a x) = a (v - Suc n)
[PROOF STEP]
apply (simp_all split: nat.splits)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v. \<lbrakk>robdd_invar_vars_greater (Suc n) ll; Suc n \<le> v\<rbrakk> \<Longrightarrow> \<forall>x2. v - n = Suc x2 \<longrightarrow> a x2 = a (v - Suc n)
[PROOF STEP]
apply (metis diff_Suc nat.case(2))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_\<alpha> ll (\<lambda>v. case v - n of 0 \<Rightarrow> ?b | Suc x \<Rightarrow> ?a x) = robdd_\<alpha> ll (\<lambda>v. ?a (v - Suc n))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
from invar_rr
[PROOF STATE]
proof (chain)
picking this:
robdd_invar_vars_greater (Suc n) rr
[PROOF STEP]
have rr_sem: "\<And>a b. robdd_\<alpha> rr (\<lambda>v. case_nat b a (v - n)) = robdd_\<alpha> rr
                                     (\<lambda>v. a (v - Suc n))"
[PROOF STATE]
proof (prove)
using this:
robdd_invar_vars_greater (Suc n) rr

goal (1 subgoal):
 1. \<And>a b. robdd_\<alpha> rr (\<lambda>v. case v - n of 0 \<Rightarrow> b | Suc x \<Rightarrow> a x) = robdd_\<alpha> rr (\<lambda>v. a (v - Suc n))
[PROOF STEP]
apply (rule_tac robdd_\<alpha>_invar_greater [of "Suc n"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. robdd_invar_vars_greater (Suc n) rr \<Longrightarrow> robdd_invar_vars_greater (Suc n) rr
 2. \<And>a b v. \<lbrakk>robdd_invar_vars_greater (Suc n) rr; Suc n \<le> v\<rbrakk> \<Longrightarrow> (case v - n of 0 \<Rightarrow> b | Suc x \<Rightarrow> a x) = a (v - Suc n)
[PROOF STEP]
apply (simp_all split: nat.splits)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v. \<lbrakk>robdd_invar_vars_greater (Suc n) rr; Suc n \<le> v\<rbrakk> \<Longrightarrow> \<forall>x2. v - n = Suc x2 \<longrightarrow> a x2 = a (v - Suc n)
[PROOF STEP]
apply (metis diff_Suc nat.case(2))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_\<alpha> rr (\<lambda>v. case v - n of 0 \<Rightarrow> ?b | Suc x \<Rightarrow> ?a x) = robdd_\<alpha> rr (\<lambda>v. ?a (v - Suc n))

goal (1 subgoal):
 1. \<And>i l v r n bo bs. \<lbrakk>\<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<lbrakk>n = v; bo = None; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = True; robdd_invar_vars_greater (Suc n) l; robdd_invar_reduced l\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> l (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> l (\<lambda>v. a (v - Suc n))); \<And>x2. \<lbrakk>n = v; bo = Some x2; x2 = False; robdd_invar_vars_greater (Suc n) r; robdd_invar_reduced r\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> r (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> r (\<lambda>v. a (v - Suc n))); \<lbrakk>n \<noteq> v; robdd_invar_vars_greater (Suc n) (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - Suc n))); robdd_invar_vars_greater n (robdd_var i l v r); robdd_invar_reduced (robdd_var i l v r)\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> (robdd_var i l v r) n (bo # bs) = (\<forall>a\<in>list_to_assignment_set (bo # bs). robdd_\<alpha> (robdd_var i l v r) (\<lambda>v. a (v - n)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
proof (cases "n = v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
 2. n \<noteq> v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> v

goal (2 subgoals):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
 2. n \<noteq> v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
with n_le
[PROOF STATE]
proof (chain)
picking this:
n \<le> v
n \<noteq> v
[PROOF STEP]
have n_less: "n < v"
[PROOF STATE]
proof (prove)
using this:
n \<le> v
n \<noteq> v

goal (1 subgoal):
 1. n < v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < v

goal (2 subgoals):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
 2. n \<noteq> v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
hence "v - n = Suc (v - (Suc n))"
[PROOF STATE]
proof (prove)
using this:
n < v

goal (1 subgoal):
 1. v - n = Suc (v - Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v - n = Suc (v - Suc n)

goal (2 subgoals):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
 2. n \<noteq> v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
with indhyp_5 n_less
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. if a (v - Suc n) then robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)) else robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))
n < v
v - n = Suc (v - Suc n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<noteq> v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. if a (v - Suc n) then robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)) else robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))
n < v
v - n = Suc (v - Suc n)

goal (1 subgoal):
 1. robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
apply (simp add: Ball_def all_conj_distrib del: Suc_diff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>robdd_list_\<alpha> (robdd_var i ll v rr) (Suc n) bs = (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> (if x (v - Suc n) then robdd_\<alpha> ll (\<lambda>v. x (v - Suc n)) else robdd_\<alpha> rr (\<lambda>v. x (v - Suc n)))); n < v; v - n = Suc (v - Suc n)\<rbrakk> \<Longrightarrow> ((\<forall>x. x (v - Suc n) \<longrightarrow> x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>v. x (v - Suc n))) \<and> (\<forall>x. \<not> x (v - Suc n) \<longrightarrow> x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>v. x (v - Suc n)))) = ((\<forall>x. x (Suc (v - Suc n)) \<longrightarrow> x \<in> list_to_assignment_set (b # bs) \<longrightarrow> robdd_\<alpha> ll (\<lambda>v. x (v - n))) \<and> (\<forall>x. \<not> x (Suc (v - Suc n)) \<longrightarrow> x \<in> list_to_assignment_set (b # bs) \<longrightarrow> robdd_\<alpha> rr (\<lambda>v. x (v - n))))
[PROOF STEP]
apply (cases b)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>robdd_list_\<alpha> (robdd_var i ll v rr) (Suc n) bs = (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> (if x (v - Suc n) then robdd_\<alpha> ll (\<lambda>v. x (v - Suc n)) else robdd_\<alpha> rr (\<lambda>v. x (v - Suc n)))); n < v; v - n = Suc (v - Suc n); b = None\<rbrakk> \<Longrightarrow> ((\<forall>x. x (v - Suc n) \<longrightarrow> x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>v. x (v - Suc n))) \<and> (\<forall>x. \<not> x (v - Suc n) \<longrightarrow> x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>v. x (v - Suc n)))) = ((\<forall>x. x (Suc (v - Suc n)) \<longrightarrow> x \<in> list_to_assignment_set (b # bs) \<longrightarrow> robdd_\<alpha> ll (\<lambda>v. x (v - n))) \<and> (\<forall>x. \<not> x (Suc (v - Suc n)) \<longrightarrow> x \<in> list_to_assignment_set (b # bs) \<longrightarrow> robdd_\<alpha> rr (\<lambda>v. x (v - n))))
 2. \<And>a. \<lbrakk>robdd_list_\<alpha> (robdd_var i ll v rr) (Suc n) bs = (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> (if x (v - Suc n) then robdd_\<alpha> ll (\<lambda>v. x (v - Suc n)) else robdd_\<alpha> rr (\<lambda>v. x (v - Suc n)))); n < v; v - n = Suc (v - Suc n); b = Some a\<rbrakk> \<Longrightarrow> ((\<forall>x. x (v - Suc n) \<longrightarrow> x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>v. x (v - Suc n))) \<and> (\<forall>x. \<not> x (v - Suc n) \<longrightarrow> x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>v. x (v - Suc n)))) = ((\<forall>x. x (Suc (v - Suc n)) \<longrightarrow> x \<in> list_to_assignment_set (b # bs) \<longrightarrow> robdd_\<alpha> ll (\<lambda>v. x (v - n))) \<and> (\<forall>x. \<not> x (Suc (v - Suc n)) \<longrightarrow> x \<in> list_to_assignment_set (b # bs) \<longrightarrow> robdd_\<alpha> rr (\<lambda>v. x (v - n))))
[PROOF STEP]
apply (simp_all add: image_iff Bex_def ex_disj_distrib all_conj_distrib imp_conjR
                       shift_assignment_def imp_ex all_simps(6)[symmetric]
                       ll_sem rr_sem split: nat.split
                  del: ex_simps all_simps Suc_diff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))

goal (1 subgoal):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = v

goal (1 subgoal):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
note n_eq[simp] = this
[PROOF STATE]
proof (state)
this:
n = v

goal (1 subgoal):
 1. n = v \<Longrightarrow> robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
from indhyp_1 indhyp_2 indhyp_3 indhyp_4
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = v; b = None\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)))
\<lbrakk>n = v; b = None\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))
\<lbrakk>n = v; b = Some True\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc v) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>va. a (va - Suc v)))
\<lbrakk>n = v; b = Some False\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc v) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>va. a (va - Suc v)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = v; b = None\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>v. a (v - Suc n)))
\<lbrakk>n = v; b = None\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc n) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>v. a (v - Suc n)))
\<lbrakk>n = v; b = Some True\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> ll (Suc v) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> ll (\<lambda>va. a (va - Suc v)))
\<lbrakk>n = v; b = Some False\<rbrakk> \<Longrightarrow> robdd_list_\<alpha> rr (Suc v) bs = (\<forall>a\<in>list_to_assignment_set bs. robdd_\<alpha> rr (\<lambda>va. a (va - Suc v)))

goal (1 subgoal):
 1. robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))
[PROOF STEP]
apply (simp add: Ball_def split: option.splits bool.splits)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b = None \<Longrightarrow> robdd_list_\<alpha> ll (Suc v) bs = (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - Suc v))); b = None \<Longrightarrow> robdd_list_\<alpha> rr (Suc v) bs = (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - Suc v))); b = Some True \<Longrightarrow> robdd_list_\<alpha> ll (Suc v) bs = (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - Suc v))); b = Some False \<Longrightarrow> robdd_list_\<alpha> rr (Suc v) bs = (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - Suc v)))\<rbrakk> \<Longrightarrow> (b = None \<longrightarrow> ((\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - Suc v))) \<and> (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - Suc v)))) = (\<forall>x. (x 0 \<longrightarrow> (x \<in> shift_assignment True ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - v))) \<and> (x \<in> shift_assignment False ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - v)))) \<and> (\<not> x 0 \<longrightarrow> (x \<in> shift_assignment True ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - v))) \<and> (x \<in> shift_assignment False ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - v)))))) \<and> (\<forall>x2. (x2 \<longrightarrow> b = Some True \<longrightarrow> (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - Suc v))) = (\<forall>x. (x 0 \<longrightarrow> x \<in> shift_assignment True ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - v))) \<and> (\<not> x 0 \<longrightarrow> x \<in> shift_assignment True ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - v))))) \<and> (\<not> x2 \<longrightarrow> b = Some False \<longrightarrow> (\<forall>x. x \<in> list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - Suc v))) = (\<forall>x. (x 0 \<longrightarrow> x \<in> shift_assignment False ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> ll (\<lambda>va. x (va - v))) \<and> (\<not> x 0 \<longrightarrow> x \<in> shift_assignment False ` list_to_assignment_set bs \<longrightarrow> robdd_\<alpha> rr (\<lambda>va. x (va - v))))))
[PROOF STEP]
apply (simp_all add: image_iff Bex_def ex_disj_distrib all_conj_distrib imp_conjR
                       shift_assignment_def imp_ex all_simps(6)[symmetric]
                       ll_sem[unfolded n_eq] rr_sem[unfolded n_eq]
                  del: ex_simps all_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
robdd_list_\<alpha> (robdd_var i ll v rr) n (b # bs) = (\<forall>a\<in>list_to_assignment_set (b # bs). robdd_\<alpha> (robdd_var i ll v rr) (\<lambda>v. a (v - n)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Legendre_3_M: "Legendre 3 M = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Legendre 3 (int M) = - 1
[PROOF STEP]
using prime M_cong_7_mod_12
[PROOF STATE]
proof (prove)
using this:
prime M
[M = 7] (mod 12)

goal (1 subgoal):
 1. Legendre 3 (int M) = - 1
[PROOF STEP]
by (subst Legendre_3_left) (auto simp: cong_def)


[STATEMENT]
lemma fds_mangoldt: "fds mangoldt = fds moebius_mu * fds (\<lambda>n. of_real (ln (real n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds mangoldt = fds moebius_mu * fds (\<lambda>n. of_real (ln (real n)))
[PROOF STEP]
by (subst fds_moebius_inversion) (rule fds_mangoldt_times_zeta [symmetric])


[STATEMENT]
lemma prob_space_measure_pmf: "prob_space (measure_pmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (measure_pmf p)
[PROOF STEP]
using pmf.measure_pmf[of p]
[PROOF STATE]
proof (prove)
using this:
measure_pmf p \<in> {M. prob_space M \<and> sets M = UNIV \<and> (AE x in M. Sigma_Algebra.measure M {x} \<noteq> 0)}

goal (1 subgoal):
 1. prob_space (measure_pmf p)
[PROOF STEP]
by auto


[STATEMENT]
lemma VUnion_VPow[simp]: "\<Union>\<^sub>\<circ>(VPow A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> (VPow A) = A
[PROOF STEP]
by auto


[STATEMENT]
lemma hcis_hypreal_of_hypnat_Suc_mult:
  "\<And>a n. hcis (hypreal_of_hypnat (n + 1) * a) = hcis a * hcis (hypreal_of_hypnat n * a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a n. hcis (hypreal_of_hypnat (n + 1) * a) = hcis a * hcis (hypreal_of_hypnat n * a)
[PROOF STEP]
by transfer (simp add: distrib_right cis_mult)


[STATEMENT]
theorem HInit_HInv6: "HInit s \<Longrightarrow> HInv6 s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HInit s \<Longrightarrow> HInv6 s
[PROOF STEP]
by(auto simp add: HInit_def Init_def InitDB_def HInv6_def)


[STATEMENT]
lemma Collect_not_less_iMin: "k < iMin {x. P x} \<Longrightarrow> \<not> P k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < iMin {x. P x} \<Longrightarrow> \<not> P k
[PROOF STEP]
by (drule not_less_iMin, blast)


[STATEMENT]
lemma minus_minus [simp]: "x \<in> V \<Longrightarrow> - (- x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> - (- x) = x
[PROOF STEP]
by (simp add: negate_eq1 mult_assoc2)


[STATEMENT]
lemma pairwise_disjoint_components: "pairwise (\<lambda>X Y. X \<inter> Y = {}) (components u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (\<lambda>X Y. X \<inter> Y = {}) (components u)
[PROOF STEP]
apply (simp add: pairwise_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>components u. \<forall>y\<in>components u. x \<noteq> y \<longrightarrow> x \<inter> y = {}
[PROOF STEP]
apply (auto simp: components_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa xb xc xd. \<lbrakk>xc \<in> u; connected_component u xc xa; connected_component u xc xb; xd \<in> u; connected_component u xd xb\<rbrakk> \<Longrightarrow> connected_component u xd xa
 2. \<And>xa xb xc xd. \<lbrakk>xc \<in> u; connected_component u xc xb; xd \<in> u; connected_component u xd xa; connected_component u xd xb\<rbrakk> \<Longrightarrow> connected_component u xc xa
[PROOF STEP]
apply (metis connected_component_eq_eq connected_component_in)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ac_p_int_pow_factor_right:
  assumes "a \<in> carrier Q\<^sub>p"
  shows "ac m (a \<otimes> (\<pp> [^] (n::int))) = ac m a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac m (a \<otimes> \<pp> [^] n) = ac m a
[PROOF STEP]
using assms angular_component_p_int_pow_factor_right
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
?a \<in> carrier Q\<^sub>p \<Longrightarrow> angular_component (?a \<otimes> \<pp> [^] ?n) = angular_component ?a

goal (1 subgoal):
 1. ac m (a \<otimes> \<pp> [^] n) = ac m a
[PROOF STEP]
unfolding ac_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
?a \<in> carrier Q\<^sub>p \<Longrightarrow> angular_component (?a \<otimes> \<pp> [^] ?n) = angular_component ?a

goal (1 subgoal):
 1. (if a \<otimes> \<pp> [^] n = \<zero> then 0 else angular_component (a \<otimes> \<pp> [^] n) m) = (if a = \<zero> then 0 else angular_component a m)
[PROOF STEP]
using Qp.integral_iff Qp.nonzero_memE(2) p_intpow_closed(1) p_intpow_closed(2)
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
?a \<in> carrier Q\<^sub>p \<Longrightarrow> angular_component (?a \<otimes> \<pp> [^] ?n) = angular_component ?a
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?b \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> (?a \<otimes> ?b = \<zero>) = (?a = \<zero> \<or> ?b = \<zero>)
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<noteq> \<zero>
\<pp> [^] ?n \<in> carrier Q\<^sub>p
\<pp> [^] ?n \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. (if a \<otimes> \<pp> [^] n = \<zero> then 0 else angular_component (a \<otimes> \<pp> [^] n) m) = (if a = \<zero> then 0 else angular_component a m)
[PROOF STEP]
by presburger


[STATEMENT]
theorem hoare_mono:
  "mono S \<Longrightarrow> Q \<le> R \<Longrightarrow> \<Turnstile> P {| S |} Q \<Longrightarrow> \<Turnstile> P {| S |} R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono S; Q \<sqsubseteq> R; \<Turnstile> P{| S |}Q\<rbrakk> \<Longrightarrow> \<Turnstile> P{| S |}R
[PROOF STEP]
apply (simp add: mono_def Hoare_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x y. x \<sqsubseteq> y \<longrightarrow> S x \<sqsubseteq> S y; Q \<sqsubseteq> R; P \<sqsubseteq> S Q\<rbrakk> \<Longrightarrow> P \<sqsubseteq> S R
[PROOF STEP]
apply (rule_tac y = "S Q" in order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>x y. x \<sqsubseteq> y \<longrightarrow> S x \<sqsubseteq> S y; Q \<sqsubseteq> R; P \<sqsubseteq> S Q\<rbrakk> \<Longrightarrow> P \<sqsubseteq> S Q
 2. \<lbrakk>\<forall>x y. x \<sqsubseteq> y \<longrightarrow> S x \<sqsubseteq> S y; Q \<sqsubseteq> R; P \<sqsubseteq> S Q\<rbrakk> \<Longrightarrow> S Q \<sqsubseteq> S R
[PROOF STEP]
by auto


[STATEMENT]
lemma sort_by_quicksort_rec:
  "sort cmp xs = sort cmp [x\<leftarrow>xs. compare cmp x (xs ! (length xs div 2)) = Less]
    @ stable_segment cmp (xs ! (length xs div 2)) xs
    @ sort cmp [x\<leftarrow>xs. compare cmp x (xs ! (length xs div 2)) = Greater]" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorting_Algorithms.sort cmp xs = Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs)
[PROOF STEP]
proof (rule sort_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mset xs = mset (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
 2. Sorting_Algorithms.sorted cmp (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
 3. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
show "mset xs = mset ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset xs = mset (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
by (rule multiset_eqI) (auto simp add: compare.sym intro: comp.exhaust)
[PROOF STATE]
proof (state)
this:
mset xs = mset (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))

goal (2 subgoals):
 1. Sorting_Algorithms.sorted cmp (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
 2. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sorting_Algorithms.sorted cmp (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
 2. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
show "sorted cmp ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorting_Algorithms.sorted cmp (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
by (auto simp add: sorted_append_iff sorted_stable_segment compare.equiv_subst_right dest: compare.trans_greater)
[PROOF STATE]
proof (state)
this:
Sorting_Algorithms.sorted cmp (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))

goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
let ?pivot = "xs ! (length xs div 2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
fix l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
have "compare cmp x ?pivot = comp \<and> compare cmp l x = Equiv
    \<longleftrightarrow> compare cmp l ?pivot = comp \<and> compare cmp l x = Equiv" for x comp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (compare cmp x (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (compare cmp x (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv)
[PROOF STEP]
have "compare cmp x ?pivot = comp \<longleftrightarrow> compare cmp l ?pivot = comp"
      if "compare cmp l x = Equiv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (compare cmp x (xs ! (length xs div 2)) = comp) = (compare cmp l (xs ! (length xs div 2)) = comp)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
compare cmp l x = Equiv

goal (1 subgoal):
 1. (compare cmp x (xs ! (length xs div 2)) = comp) = (compare cmp l (xs ! (length xs div 2)) = comp)
[PROOF STEP]
by (simp add: compare.equiv_subst_left compare.sym)
[PROOF STATE]
proof (state)
this:
compare cmp l x = Equiv \<Longrightarrow> (compare cmp x (xs ! (length xs div 2)) = comp) = (compare cmp l (xs ! (length xs div 2)) = comp)

goal (1 subgoal):
 1. (compare cmp x (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compare cmp l x = Equiv \<Longrightarrow> (compare cmp x (xs ! (length xs div 2)) = comp) = (compare cmp l (xs ! (length xs div 2)) = comp)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
compare cmp l x = Equiv \<Longrightarrow> (compare cmp x (xs ! (length xs div 2)) = comp) = (compare cmp l (xs ! (length xs div 2)) = comp)

goal (1 subgoal):
 1. (compare cmp x (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(compare cmp x (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = comp \<and> compare cmp l x = Equiv)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(compare cmp ?x (xs ! (length xs div 2)) = ?comp \<and> compare cmp l ?x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = ?comp \<and> compare cmp l ?x = Equiv)

goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(compare cmp ?x (xs ! (length xs div 2)) = ?comp \<and> compare cmp l ?x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = ?comp \<and> compare cmp l ?x = Equiv)
[PROOF STEP]
show "stable_segment cmp l xs = stable_segment cmp l ?rhs"
[PROOF STATE]
proof (prove)
using this:
(compare cmp ?x (xs ! (length xs div 2)) = ?comp \<and> compare cmp l ?x = Equiv) = (compare cmp l (xs ! (length xs div 2)) = ?comp \<and> compare cmp l ?x = Equiv)

goal (1 subgoal):
 1. filter (\<lambda>y. compare cmp l y = Equiv) xs = filter (\<lambda>y. compare cmp l y = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))
[PROOF STEP]
by (simp add: stable_sort compare.sym [of _ ?pivot])
      (cases "compare cmp l ?pivot", simp_all)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>y. compare cmp l y = Equiv) xs = filter (\<lambda>y. compare cmp l y = Equiv) (Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Less) xs) @ filter (\<lambda>y. compare cmp (xs ! (length xs div 2)) y = Equiv) xs @ Sorting_Algorithms.sort cmp (filter (\<lambda>x. compare cmp x (xs ! (length xs div 2)) = Greater) xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disj_Un_runiq:
  assumes "runiq P" "runiq Q" "(Domain P) \<inter> (Domain Q) = {}"
  shows "runiq (P \<union> Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. runiq (P \<union> Q)
[PROOF STEP]
using assms rightUniqueInjectiveOnFirst fst_eq_Domain injection_union
[PROOF STATE]
proof (prove)
using this:
runiq P
runiq Q
Domain P \<inter> Domain Q = {}
runiq ?P = inj_on fst ?P
fst ` ?R = Domain ?R
\<lbrakk>inj_on ?f ?A; inj_on ?f ?B; ?f ` ?A \<inter> ?f ` ?B = {}\<rbrakk> \<Longrightarrow> inj_on ?f (?A \<union> ?B)

goal (1 subgoal):
 1. runiq (P \<union> Q)
[PROOF STEP]
by metis


[STATEMENT]
lemma odd_plus_one_even[simp]: "x mod 2 = Suc 0 \<Longrightarrow> Suc x mod 2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod 2 = Suc 0 \<Longrightarrow> is_even (Suc x)
[PROOF STEP]
by arith


[STATEMENT]
lemma finite_Inf_prod:
  "Inf(A :: ('a::finite_lattice_complete \<times> 'b::finite_lattice_complete) set) =
    Finite_Set.fold inf top A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf A = Finite_Set.fold inf top A
[PROOF STEP]
by (metis Inf_fold_inf finite)


[STATEMENT]
lemma "\<not> successive (\<lambda> x. x > (0 :: nat)) [Suc 0, Suc 0, 0, Suc 0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> successive ((<) 0) [Suc 0, Suc 0, 0, Suc 0]
[PROOF STEP]
by simp


[STATEMENT]
lemma trans_asym_factor[simp]: "trans r \<Longrightarrow> trans (asym_factor r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans r \<Longrightarrow> trans (asym_factor r)
[PROOF STEP]
unfolding asym_factor_def trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. (x, y) \<in> r \<longrightarrow> (y, z) \<in> r \<longrightarrow> (x, z) \<in> r \<Longrightarrow> \<forall>x y z. (x, y) \<in> {(x, y). (x, y) \<in> r \<and> (y, x) \<notin> r} \<longrightarrow> (y, z) \<in> {(x, y). (x, y) \<in> r \<and> (y, x) \<notin> r} \<longrightarrow> (x, z) \<in> {(x, y). (x, y) \<in> r \<and> (y, x) \<notin> r}
[PROOF STEP]
by fast