[STATEMENT]
theorem pred_corr: "invar_vebt t n \<Longrightarrow> vebt_pred t x = Some px == is_pred_in_set (set_vebt' t) x px"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n \<Longrightarrow> vebt_pred t x = Some px \<equiv> is_pred_in_set (set_vebt' t) x px
[PROOF STEP]
proof(induction t n arbitrary: x px rule: invar_vebt.induct)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>a b x px. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 3. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 4. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 5. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case (1 a b)
[PROOF STATE]
proof (state)
this:

goal (5 subgoals):
 1. \<And>a b x px. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 3. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 4. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 5. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
proof(cases x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<And>nat. x = Suc nat \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
x = 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<And>nat. x = Suc nat \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = 0

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
by (simp add: is_pred_in_set_def)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal (1 subgoal):
 1. \<And>nat. x = Suc nat \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. x = Suc nat \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case (Suc sucX)
[PROOF STATE]
proof (state)
this:
x = Suc sucX

goal (1 subgoal):
 1. \<And>nat. x = Suc nat \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
hence "x \<ge> 0 \<and> x = Suc sucX"
[PROOF STATE]
proof (prove)
using this:
x = Suc sucX

goal (1 subgoal):
 1. 0 \<le> x \<and> x = Suc sucX
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> x \<and> x = Suc sucX

goal (1 subgoal):
 1. \<And>nat. x = Suc nat \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x \<and> x = Suc sucX
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> x \<and> x = Suc sucX

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
proof(cases sucX)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = 0\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<And>nat. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = Suc nat\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
sucX = 0

goal (2 subgoals):
 1. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = 0\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<And>nat. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = Suc nat\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sucX = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sucX = 0

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
by (simp add: Suc pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal (1 subgoal):
 1. \<And>nat. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = Suc nat\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = Suc nat\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case (Suc nat)
[PROOF STATE]
proof (state)
this:
sucX = Suc nat

goal (1 subgoal):
 1. \<And>nat. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = Suc nat\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
hence "x\<ge> 2"
[PROOF STATE]
proof (prove)
using this:
sucX = Suc nat

goal (1 subgoal):
 1. 2 \<le> x
[PROOF STEP]
by (simp add: \<open>0 \<le> x \<and> x = Suc sucX\<close>)
[PROOF STATE]
proof (state)
this:
2 \<le> x

goal (1 subgoal):
 1. \<And>nat. \<lbrakk>0 \<le> x \<and> x = Suc sucX; sucX = Suc nat\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 \<le> x

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
proof(cases b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>2 \<le> x; b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b

goal (2 subgoals):
 1. \<lbrakk>2 \<le> x; b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
hence "vebt_pred (Leaf a b) x = Some 1"
[PROOF STATE]
proof (prove)
using this:
b

goal (1 subgoal):
 1. vebt_pred (Leaf a b) x = Some 1
[PROOF STEP]
by (simp add: Suc \<open>0 \<le> x \<and> x = Suc sucX\<close>)
[PROOF STATE]
proof (state)
this:
vebt_pred (Leaf a b) x = Some 1

goal (2 subgoals):
 1. \<lbrakk>2 \<le> x; b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_pred (Leaf a b) x = Some 1

goal (2 subgoals):
 1. \<lbrakk>2 \<le> x; b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
have "is_pred_in_set (set_vebt' (Leaf a b)) x 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Leaf a b)) x 1
[PROOF STEP]
by (simp add: Suc True \<open>0 \<le> x \<and> x = Suc sucX\<close> pred_member)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Leaf a b)) x 1

goal (2 subgoals):
 1. \<lbrakk>2 \<le> x; b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_pred (Leaf a b) x = Some 1
is_pred_in_set (set_vebt' (Leaf a b)) x 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Leaf a b) x = Some 1
is_pred_in_set (set_vebt' (Leaf a b)) x 1

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
using pred_member
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Leaf a b) x = Some 1
is_pred_in_set (set_vebt' (Leaf a b)) x 1
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal (1 subgoal):
 1. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> b

goal (1 subgoal):
 1. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
hence "b = False"
[PROOF STATE]
proof (prove)
using this:
\<not> b

goal (1 subgoal):
 1. b = False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b = False

goal (1 subgoal):
 1. \<lbrakk>2 \<le> x; \<not> b\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b = False

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
proof(cases a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>b = False; a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a

goal (2 subgoals):
 1. \<lbrakk>b = False; a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
hence "vebt_pred (Leaf a b) x = Some 0"
[PROOF STATE]
proof (prove)
using this:
a

goal (1 subgoal):
 1. vebt_pred (Leaf a b) x = Some 0
[PROOF STEP]
by (simp add: False Suc \<open>0 \<le> x \<and> x = Suc sucX\<close>)
[PROOF STATE]
proof (state)
this:
vebt_pred (Leaf a b) x = Some 0

goal (2 subgoals):
 1. \<lbrakk>b = False; a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_pred (Leaf a b) x = Some 0

goal (2 subgoals):
 1. \<lbrakk>b = False; a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
have "is_pred_in_set (set_vebt' (Leaf a b)) x 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Leaf a b)) x 0
[PROOF STEP]
by (simp add: False True \<open>0 \<le> x \<and> x = Suc sucX\<close> pred_member)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Leaf a b)) x 0

goal (2 subgoals):
 1. \<lbrakk>b = False; a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
 2. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_pred (Leaf a b) x = Some 0
is_pred_in_set (set_vebt' (Leaf a b)) x 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Leaf a b) x = Some 0
is_pred_in_set (set_vebt' (Leaf a b)) x 0

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
by (metis False VEBT_Member.vebt_member.simps(1) option.sel pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal (1 subgoal):
 1. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> a

goal (1 subgoal):
 1. \<lbrakk>b = False; \<not> a\<rbrakk> \<Longrightarrow> (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> a

goal (1 subgoal):
 1. (vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px
[PROOF STEP]
by (simp add: Suc \<open>0 \<le> x \<and> x = Suc sucX\<close> pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Leaf a b) x = Some px) = is_pred_in_set (set_vebt' (Leaf a b)) x px

goal (4 subgoals):
 1. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 2. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 3. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 4. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 2. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 3. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 4. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case (2 treeList n summary m deg)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = n
deg = n + m
\<not> Ex (both_member_options summary)
\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)

goal (4 subgoals):
 1. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 2. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 3. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 4. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = n
deg = n + m
\<not> Ex (both_member_options summary)
\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = n
deg = n + m
\<not> Ex (both_member_options summary)
\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)

goal (1 subgoal):
 1. (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
[PROOF STEP]
by (simp add: pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px

goal (3 subgoals):
 1. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 3. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 3. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case (3 treeList n summary m deg)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<not> Ex (both_member_options summary)
\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)

goal (3 subgoals):
 1. \<And>treeList n summary m deg x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<not> Ex (both_member_options summary); \<forall>t\<in>set treeList. \<not> Ex (both_member_options t)\<rbrakk> \<Longrightarrow> (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 3. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<not> Ex (both_member_options summary)
\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<not> Ex (both_member_options summary)
\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)

goal (1 subgoal):
 1. (vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px
[PROOF STEP]
by (simp add: pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node None deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node None deg treeList summary)) x px

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case (4 treeList n summary m deg mi ma)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = n
deg = n + m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t))
mi \<le> ma
ma < 2 ^ deg
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "n = m" and "n \<ge> 1" and "deg \<ge> 2" and "deg = n + m"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = n
deg = n + m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t))
mi \<le> ma
ma < 2 ^ deg
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))

goal (1 subgoal):
 1. (n = m &&& 1 \<le> n) &&& 2 \<le> deg &&& deg = n + m
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 1 \<le> n
 2. 2 \<le> deg
 3. deg = n + m
[PROOF STEP]
using "4.hyps"(2) "4.hyps"(5) Suc_le_eq deg_not_0
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
m = n
(Suc ?m \<le> ?n) = (?m < ?n)
invar_vebt ?t ?n \<Longrightarrow> 0 < ?n

goal (3 subgoals):
 1. 1 \<le> n
 2. 2 \<le> deg
 3. deg = n + m
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 2 \<le> deg
 2. deg = n + m
[PROOF STEP]
using "4.hyps"(2) "4.hyps"(5) "4.hyps"(6) deg_not_0
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
m = n
deg = n + m
invar_vebt ?t ?n \<Longrightarrow> 0 < ?n

goal (2 subgoals):
 1. 2 \<le> deg
 2. deg = n + m
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg = n + m
[PROOF STEP]
by (simp add: "4.hyps"(6))
[PROOF STATE]
proof (state)
this:
n = m
1 \<le> n
2 \<le> deg
deg = n + m

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n = m
1 \<le> n
2 \<le> deg
deg = n + m

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence thisvalid:"invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg"
[PROOF STATE]
proof (prove)
using this:
n = m
1 \<le> n
2 \<le> deg
deg = n + m

goal (1 subgoal):
 1. invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
[PROOF STEP]
using 4 invar_vebt.intros(4)[of treeList n summary m]
[PROOF STATE]
proof (prove)
using this:
n = m
1 \<le> n
2 \<le> deg
deg = n + m
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = n
deg = n + m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t))
mi \<le> ma
ma < 2 ^ deg
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))
\<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; m = n; ?deg = n + m; \<forall>i<2 ^ m. (\<exists>x. both_member_options (treeList ! i) x) = both_member_options summary i; ?mi = ?ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x); ?mi \<le> ?ma; ?ma < 2 ^ ?deg; ?mi \<noteq> ?ma \<longrightarrow> (\<forall>i<2 ^ m. (high ?ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ?ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> ?mi < x \<and> x \<le> ?ma))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (?mi, ?ma)) ?deg treeList summary) ?deg

goal (1 subgoal):
 1. invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n = m
1 \<le> n
2 \<le> deg
deg = n + m
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
[PROOF STEP]
have "deg div 2 =n" and "length treeList = 2^n"
[PROOF STATE]
proof (prove)
using this:
n = m
1 \<le> n
2 \<le> deg
deg = n + m
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. deg div 2 = n &&& length treeList = 2 ^ n
[PROOF STEP]
using add_self_div_2
[PROOF STATE]
proof (prove)
using this:
n = m
1 \<le> n
2 \<le> deg
deg = n + m
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
(?m + ?m) div 2 = ?m

goal (1 subgoal):
 1. deg div 2 = n &&& length treeList = 2 ^ n
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length treeList = 2 ^ n
[PROOF STEP]
by (simp add: "4.hyps"(4) "4.hyps"(5))
[PROOF STATE]
proof (state)
this:
deg div 2 = n
length treeList = 2 ^ n

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deg div 2 = n
length treeList = 2 ^ n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
deg div 2 = n
length treeList = 2 ^ n

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "x > ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
ma < x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 0: "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some ma"
[PROOF STATE]
proof (prove)
using this:
ma < x

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some ma
[PROOF STEP]
by (simp add: \<open>2 \<le> deg\<close> pred_max)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some ma

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 1:"ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)"
[PROOF STATE]
proof (prove)
using this:
ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))

goal (1 subgoal):
 1. ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
by (metis VEBT_Member.vebt_member.simps(5) \<open>2 \<le> deg\<close> add_numeral_left arith_simps(1) le_add_diff_inverse mem_Collect_eq numerals(1) plus_1_eq_Suc set_vebt'_def)
[PROOF STATE]
proof (state)
this:
ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 2:"y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> y \<le> x" for y
[PROOF STATE]
proof (prove)
using this:
ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)

goal (1 subgoal):
 1. y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> y \<le> x
[PROOF STEP]
using "4.hyps"(9) True member_inv set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)
mi \<le> ma
ma < x
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))
set_vebt' ?t = {x. vebt_member ?t x}

goal (1 subgoal):
 1. y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> y \<le> x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> ?y \<le> x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 3: "y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> (y < ma \<Longrightarrow> y \<le> x)" for y
[PROOF STATE]
proof (prove)
using this:
?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> ?y \<le> x

goal (1 subgoal):
 1. \<lbrakk>y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary); y < ma\<rbrakk> \<Longrightarrow> y \<le> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary); ?y < ma\<rbrakk> \<Longrightarrow> ?y \<le> x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 4: "\<forall> y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary); ?y < ma\<rbrakk> \<Longrightarrow> ?y \<le> x

goal (1 subgoal):
 1. \<forall>y\<in>set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma
[PROOF STEP]
by (metis "4.hyps"(9) True \<open>ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)\<close> less_or_eq_imp_le mem_Collect_eq member_inv pred_member set_vebt'_def)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis "0" option.sel leD le_less_Suc_eq not_less_eq pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> ma < x

goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "x \<le> ma"
[PROOF STATE]
proof (prove)
using this:
\<not> ma < x

goal (1 subgoal):
 1. x \<le> ma
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<le> ma

goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; length treeList = 2 ^ n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<le> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<le> ma

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "high x (deg div 2)< length treeList ")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high x (deg div 2) < length treeList

goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "high x n < 2^n \<and> low x n < 2^n"
[PROOF STATE]
proof (prove)
using this:
high x (deg div 2) < length treeList

goal (1 subgoal):
 1. high x n < 2 ^ n \<and> low x n < 2 ^ n
[PROOF STEP]
by (simp add: \<open>deg div 2 = n\<close> \<open>length treeList = 2 ^ n\<close> low_def)
[PROOF STATE]
proof (state)
this:
high x n < 2 ^ n \<and> low x n < 2 ^ n

goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?l = "low x (deg div 2)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?h = "high x (deg div 2)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?minlow = "vebt_mint (treeList ! ?h)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?pr = "vebt_pred summary ?h"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 1:"vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =
                           (if ?minlow \<noteq> None \<and> (Some ?l >\<^sub>o  ?minlow) then
                                                    Some (2^(deg div 2)) *\<^sub>o Some ?h +\<^sub>o vebt_pred (treeList ! ?h) ?l
                             else let pr = vebt_pred summary ?h in
                             if pr = None then (if x > mi then Some mi else None)
                             else Some (2^(deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))
[PROOF STEP]
by (smt True \<open>2 \<le> deg\<close> \<open>x \<le> ma\<close> pred_less_length_list)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))

goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "?minlow \<noteq> None \<and> (Some ?l >\<^sub>o  ?minlow)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))
[PROOF STEP]
obtain minl where 00:"(Some minl = ?minlow) \<and> ?l > minl"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. (\<And>minl. Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 01:"invar_vebt ((treeList ! ?h)) n \<and> (treeList ! ?h) \<in> set treeList "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
[PROOF STEP]
by (simp add: "4.hyps"(1) "4.hyps"(4) "4.hyps"(5) \<open>deg div 2 = n\<close> \<open>high x n < 2 ^ n \<and> low x n < 2 ^ n\<close>)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have  02:"vebt_member ((treeList ! ?h)) minl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) minl
[PROOF STEP]
using "00" "01" mint_member
[PROOF STATE]
proof (prove)
using this:
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?maxi\<rbrakk> \<Longrightarrow> vebt_member ?t ?maxi

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) minl
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) minl

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 03: "\<exists> y. y < ?l \<and> vebt_member ((treeList ! ?h)) y"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) minl

goal (1 subgoal):
 1. \<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y
[PROOF STEP]
using "00"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) minl
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)

goal (1 subgoal):
 1. \<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence afinite: "finite (set_vebt' (treeList ! ?h)) "
[PROOF STATE]
proof (prove)
using this:
\<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y

goal (1 subgoal):
 1. finite (set_vebt' (treeList ! high x (deg div 2)))
[PROOF STEP]
using "01" set_vebt_finite
[PROOF STATE]
proof (prove)
using this:
\<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
invar_vebt ?t ?n \<Longrightarrow> finite (set_vebt' ?t)

goal (1 subgoal):
 1. finite (set_vebt' (treeList ! high x (deg div 2)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (set_vebt' (treeList ! high x (deg div 2)))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (set_vebt' (treeList ! high x (deg div 2)))
[PROOF STEP]
obtain predy where 04:"is_pred_in_set (set_vebt' (treeList ! ?h)) ?l predy"
[PROOF STATE]
proof (prove)
using this:
finite (set_vebt' (treeList ! high x (deg div 2)))

goal (1 subgoal):
 1. (\<And>predy. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using "00" "01" mint_corr obtain_set_pred
[PROOF STATE]
proof (prove)
using this:
finite (set_vebt' (treeList ! high x (deg div 2)))
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?x\<rbrakk> \<Longrightarrow> min_in_set (set_vebt' ?t) ?x
\<lbrakk>?z < ?x; min_in_set ?A ?z; finite ?A\<rbrakk> \<Longrightarrow> \<exists>y. is_pred_in_set ?A ?x y

goal (1 subgoal):
 1. (\<And>predy. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 05:"Some predy =  vebt_pred (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (1 subgoal):
 1. Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))
[PROOF STEP]
using 4(1) 01
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList

goal (1 subgoal):
 1. Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x  =  Some (2^(deg div 2)*  ?h + predy) "
[PROOF STATE]
proof (prove)
using this:
Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
using  "1" True add_def mul_def option_shift.simps(3)
[PROOF STATE]
proof (prove)
using this:
Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))
(+\<^sub>o) = option_shift (+)
(*\<^sub>o) = option_shift (*)
option_shift ?f (Some ?a) (Some ?b) = Some (?f ?a ?b)

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 06: "predy \<in> set_vebt' (treeList ! ?h)"
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (1 subgoal):
 1. predy \<in> set_vebt' (treeList ! high x (deg div 2))
[PROOF STEP]
using "04" is_pred_in_set_def
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
is_pred_in_set ?xs ?x ?y = (?y \<in> ?xs \<and> ?y < ?x \<and> (\<forall>z\<in>?xs. z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. predy \<in> set_vebt' (treeList ! high x (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 07: "predy < 2^(deg div 2) \<and> ?h < 2^(deg div 2) \<and> deg div 2 + deg div 2 = deg"
[PROOF STATE]
proof (prove)
using this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. predy < 2 ^ (deg div 2) \<and> high x (deg div 2) < 2 ^ (deg div 2) \<and> deg div 2 + deg div 2 = deg
[PROOF STEP]
using "01" "04" "4.hyps"(5) "4.hyps"(6) \<open>high x n < 2 ^ n \<and> low x n < 2 ^ n\<close> member_bound pred_member
[PROOF STATE]
proof (prove)
using this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
m = n
deg = n + m
high x n < 2 ^ n \<and> low x n < 2 ^ n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. predy < 2 ^ (deg div 2) \<and> high x (deg div 2) < 2 ^ (deg div 2) \<and> deg div 2 + deg div 2 = deg
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
predy < 2 ^ (deg div 2) \<and> high x (deg div 2) < 2 ^ (deg div 2) \<and> deg div 2 + deg div 2 = deg

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?y = "2^(deg div 2)*  ?h + predy"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 08: "vebt_member (treeList ! ?h) predy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) predy
[PROOF STEP]
using "06" set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))
set_vebt' ?t = {x. vebt_member ?t x}

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) predy
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 09: "both_member_options (treeList ! ?h) predy"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) predy

goal (1 subgoal):
 1. both_member_options (treeList ! high x (deg div 2)) predy
[PROOF STEP]
using "01" both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) predy
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. both_member_options (treeList ! high x (deg div 2)) predy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high x (deg div 2)) predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 10: "high ?y (deg div 2) = ?h \<and> low ?y (deg div 2) = predy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy
[PROOF STEP]
by (simp add: "07" high_inv low_inv mult.commute)
[PROOF STATE]
proof (state)
this:
high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 14:"both_member_options (Node (Some (mi, ma)) deg treeList summary) ?y"
[PROOF STATE]
proof (prove)
using this:
high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by (metis "07" "09" "4.hyps"(4) "4.hyps"(5) Suc_1 \<open>2 \<le> deg\<close> \<open>deg div 2 = n\<close> add_leD1 both_member_options_from_chilf_to_complete_tree plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 15: "vebt_member (Node (Some (mi, ma)) deg treeList summary) ?y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
using "14" thisvalid valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 16: "Some ?y = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (2 ^ (deg div 2) * high x (deg div 2) + predy) = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x
[PROOF STEP]
by (simp add: \<open>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)\<close>)
[PROOF STATE]
proof (state)
this:
Some (2 ^ (deg div 2) * high x (deg div 2) + predy) = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 17: "x = ?h * 2^(deg div 2) + ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)
[PROOF STEP]
using bit_concat_def bit_split_inv
[PROOF STATE]
proof (prove)
using this:
bit_concat ?h ?l ?d = ?h * 2 ^ ?d + ?l
bit_concat (high ?x ?d) (low ?x ?d) ?d = ?x

goal (1 subgoal):
 1. x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 18: "x - ?y =   ?h * 2^(deg div 2) + ?l -?h * 2^(deg div 2) - predy "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy
[PROOF STEP]
by (metis "17" diff_diff_add mult.commute)
[PROOF STATE]
proof (state)
this:
x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 19: "?y < x"
[PROOF STATE]
proof (prove)
using this:
x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy

goal (1 subgoal):
 1. 2 ^ (deg div 2) * high x (deg div 2) + predy < x
[PROOF STEP]
using "04" "17" mult.commute nat_add_left_cancel_less pred_member
[PROOF STATE]
proof (prove)
using this:
x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)
?a * ?b = ?b * ?a
(?k + ?m < ?k + ?n) = (?m < ?n)
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. 2 ^ (deg div 2) * high x (deg div 2) + predy < x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
2 ^ (deg div 2) * high x (deg div 2) + predy < x

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 20: "z < x \<Longrightarrow> vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<Longrightarrow> z\<le> ?y " for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
assume "z < x" and "vebt_member (Node (Some (mi, ma)) deg treeList summary) z"
[PROOF STATE]
proof (state)
this:
z < x
vebt_member (Node (Some (mi, ma)) deg treeList summary) z

goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "high z (deg div 2) \<le> high x (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
z < x
vebt_member (Node (Some (mi, ma)) deg treeList summary) z

goal (1 subgoal):
 1. high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
by (simp add: div_le_mono high_def)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
proof(cases "high z (deg div 2) = high x (deg div 2)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) = high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = high x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) = high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence 0000: "high z (deg div 2) = high x (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = high x (deg div 2)

goal (1 subgoal):
 1. high z (deg div 2) = high x (deg div 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = high x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) = high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) = high x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = high x (deg div 2)

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
proof(cases "z = mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z = mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z = mi

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z = mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = mi

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
using "15" vebt_mint.simps(3) mint_corr_help thisvalid
[PROOF STATE]
proof (prove)
using this:
z = mi
vebt_member (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
vebt_mint (Node (Some (?mi, ?ma)) ?ux ?uy ?uz) = Some ?mi
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?mini; vebt_member ?t ?x\<rbrakk> \<Longrightarrow> ?mini \<le> ?x
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> mi

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence ad:"vebt_member (treeList ! ?h) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using vebt_member.simps(5)[of mi ma "deg-2" treeList summary z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi
vebt_member (Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary) z = (if z = mi then True else if z = ma then True else if z < mi then False else if ma < z then False else let h = high z (Suc (Suc (deg - 2)) div 2); l = low z (Suc (Suc (deg - 2)) div 2) in if h < length treeList then vebt_member (treeList ! h) l else False)

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by (metis True \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<close> \<open>x \<le> ma\<close> \<open>z < x\<close> leD member_inv)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
have "is_pred_in_set (set_vebt' (treeList ! ?h)) ?l predy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
[PROOF STEP]
using "04"
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
have "low z (deg div 2) < ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low z (deg div 2) < low x (deg div 2)
[PROOF STEP]
by (metis (full_types) True \<open>z < x\<close> bit_concat_def bit_split_inv nat_add_left_cancel_less)
[PROOF STATE]
proof (state)
this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "predy \<ge> low z (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. low z (deg div 2) \<le> predy
[PROOF STEP]
using 04 ad
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. low z (deg div 2) \<le> predy
[PROOF STEP]
unfolding is_pred_in_set_def
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)
predy \<in> set_vebt' (treeList ! high x (deg div 2)) \<and> predy < low x (deg div 2) \<and> (\<forall>z\<in>set_vebt' (treeList ! high x (deg div 2)). z < low x (deg div 2) \<longrightarrow> z \<le> predy)
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. low z (deg div 2) \<le> predy
[PROOF STEP]
by (simp add: set_vebt'_def)
[PROOF STATE]
proof (state)
this:
low z (deg div 2) \<le> predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "?y \<ge> z"
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) \<le> predy

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by (smt True bit_concat_def bit_split_inv diff_add_inverse diff_diff_add diff_is_0_eq mult.commute)
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<noteq> high x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "high z (deg div 2) < high ?y (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<noteq> high x (deg div 2)

goal (1 subgoal):
 1. high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)
[PROOF STEP]
using "10" \<open>high z (deg div 2) \<le> high x (deg div 2)\<close>
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<noteq> high x (deg div 2)
high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by (metis div_le_mono high_def nat_le_linear not_le)
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z\<rbrakk> \<Longrightarrow> ?z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ?y"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z\<rbrakk> \<Longrightarrow> ?z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by (simp add: "15" "19" pred_member)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
using 16
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)
Some (2 ^ (deg div 2) * high x (deg div 2) + predy) = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis eq_iff option.inject pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence i1:"?minlow =  None \<or> \<not> (Some ?l >\<^sub>o  ?minlow)"
[PROOF STATE]
proof (prove)
using this:
\<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))

goal (1 subgoal):
 1. vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 2: "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =  (
                            if ?pr = None then (if x > mi
                                                then Some mi
                                                else None)
                             else Some (2^(deg div 2)) *\<^sub>o ?pr +\<^sub>o vebt_maxt (treeList ! the ?pr))"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))
[PROOF STEP]
using "1"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have " invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x (deg div 2)) n
[PROOF STEP]
by (metis "4"(1) True inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x (deg div 2)) n

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 33:"\<nexists> u. vebt_member (treeList ! ?h) u \<and> u < ?l"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x (deg div 2)) n

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
proof(cases "?minlow = None")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
 2. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) = None

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
 2. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_mint (treeList ! high x (deg div 2)) = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
using mint_corr_help_empty[of "treeList ! ?h" n]
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None
\<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> set_vebt' (treeList ! high x (deg div 2)) = {}

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
by (simp add: \<open>invar_vebt (treeList ! high x (deg div 2)) n\<close> set_vebt'_def)
[PROOF STATE]
proof (state)
this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
obtain minilow where "?minlow =Some minilow"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>minilow. vebt_mint (treeList ! high x (deg div 2)) = Some minilow \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. (\<And>minilow. vebt_mint (treeList ! high x (deg div 2)) = Some minilow \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) = Some minilow

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
hence "minilow \<ge> ?l"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = Some minilow

goal (1 subgoal):
 1. low x (deg div 2) \<le> minilow
[PROOF STEP]
using "i1"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = Some minilow
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. low x (deg div 2) \<le> minilow
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
low x (deg div 2) \<le> minilow

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low x (deg div 2) \<le> minilow
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
low x (deg div 2) \<le> minilow

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
by (meson \<open>vebt_mint (treeList ! high x (deg div 2)) = Some minilow\<close> \<open>invar_vebt (treeList ! high x (deg div 2)) n\<close> leD less_le_trans mint_corr_help)
[PROOF STATE]
proof (state)
this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "?pr= None")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_pred summary (high x (deg div 2)) = None

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =  (if x > mi then Some mi else  None)"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) = None

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)
[PROOF STEP]
by (simp add: "2")
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "\<nexists> i. is_pred_in_set (set_vebt' summary) ?h i"
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)

goal (1 subgoal):
 1. \<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
[PROOF STEP]
using "4.hyps"(3) True
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
vebt_pred summary (high x (deg div 2)) = None

goal (1 subgoal):
 1. \<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "\<nexists> i. i < ?h \<and> vebt_member summary i "
[PROOF STATE]
proof (prove)
using this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i

goal (1 subgoal):
 1. \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
using pred_none_empty[of "set_vebt' summary" ?h]
[PROOF STATE]
proof (prove)
using this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
\<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))

goal (1 subgoal):
 1. \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
fix nn :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
have "\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)
[PROOF STEP]
using \<open>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i\<close> pred_none_empty set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
\<lbrakk>\<nexists>x. is_pred_in_set ?xs ?a x; finite ?xs\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>?xs. x < ?a)
set_vebt' ?t = {x. vebt_member ?t x}

goal (1 subgoal):
 1. \<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)
[PROOF STEP]
have "\<not> nn < high x (deg div 2) \<or> \<not> vebt_member summary nn"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)

goal (1 subgoal):
 1. \<not> nn < high x (deg div 2) \<or> \<not> vebt_member summary nn
[PROOF STEP]
by (metis (no_types) "4.hyps"(2) \<open>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i\<close> mem_Collect_eq set_vebt'_def set_vebt_finite)
[PROOF STATE]
proof (state)
this:
\<not> nn < high x (deg div 2) \<or> \<not> vebt_member summary nn

goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> ?nn2 < high x (deg div 2) \<or> \<not> vebt_member summary ?nn2

goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> ?nn2 < high x (deg div 2) \<or> \<not> vebt_member summary ?nn2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> ?nn2 < high x (deg div 2) \<or> \<not> vebt_member summary ?nn2

goal (1 subgoal):
 1. \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "x > mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi < x

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi"
[PROOF STATE]
proof (prove)
using this:
mi < x

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi
[PROOF STEP]
by (simp add: \<open>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)\<close>)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "(vebt_member (Node (Some (mi, ma)) deg treeList summary) z  \<and> z < x \<and> z > mi) \<Longrightarrow> False" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
assume "vebt_member (Node (Some (mi, ma)) deg treeList summary) z  \<and> z < x \<and> z > mi"
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
hence "vebt_member ( treeList ! (high z (deg div 2))) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using \<open>x \<le> ma\<close> member_inv not_le
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z
x \<le> ma
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
hence "high z (deg div 2) < 2^m"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. high z (deg div 2) < 2 ^ m
[PROOF STEP]
using "4.hyps"(4) \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z\<close> \<open>x \<le> ma\<close> member_inv
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
length treeList = 2 ^ m
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z
x \<le> ma
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))

goal (1 subgoal):
 1. high z (deg div 2) < 2 ^ m
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
hence "invar_vebt (treeList ! (high z (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
using 4(1)
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < 2 ^ m
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)

goal (1 subgoal):
 1. invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
by (simp add: "4.hyps"(4))
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
have "vebt_member summary (high z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
using 4(7)
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
using "4.hyps"(2) both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
invar_vebt summary m
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
have "(high z (deg div 2)) \<le> ?h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
by (simp add: \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z\<close> div_le_mono high_def less_or_eq_imp_le)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis "33" \<open>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)\<close> \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z\<close> \<open>vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))\<close> \<open>vebt_member summary (high z (deg div 2))\<close> bit_concat_def bit_split_inv le_neq_implies_less nat_add_left_cancel_less)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<and> mi < ?z \<Longrightarrow> False

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' ((Node (Some (mi, ma)) deg treeList summary))) x mi"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<and> mi < ?z \<Longrightarrow> False

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi
[PROOF STEP]
by (metis VEBT_Member.vebt_member.simps(5) True \<open>2 \<le> deg\<close> add_2_eq_Suc le_add_diff_inverse le_less_linear pred_member)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis \<open>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi\<close> \<open>x \<le> ma\<close> option.sel leD member_inv pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> mi < x

goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None"
[PROOF STATE]
proof (prove)
using this:
\<not> mi < x

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None
[PROOF STEP]
by (simp add: "2" True)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None

goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis (full_types) False less_trans member_inv option.distinct(1) pred_max pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_pred summary (high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence fst:"vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =
                    Some (2^(deg div 2)) *\<^sub>o ?pr +\<^sub>o vebt_maxt (treeList ! the ?pr)"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
[PROOF STEP]
using "2"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) \<noteq> None
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
obtain pr where "?pr = Some pr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>pr. vebt_pred summary (high x (deg div 2)) = Some pr \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. (\<And>pr. vebt_pred summary (high x (deg div 2)) = Some pr \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_pred summary (high x (deg div 2)) = Some pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' summary) ?h pr"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) = Some pr

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr
[PROOF STEP]
using "4.hyps"(3)
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) = Some pr
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_member summary pr"
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr

goal (1 subgoal):
 1. vebt_member summary pr
[PROOF STEP]
using pred_member
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. vebt_member summary pr
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member summary pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "both_member_options summary pr"
[PROOF STATE]
proof (prove)
using this:
vebt_member summary pr

goal (1 subgoal):
 1. both_member_options summary pr
[PROOF STEP]
using "4.hyps"(2) both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
vebt_member summary pr
invar_vebt summary m
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. both_member_options summary pr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options summary pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "pr < 2^m"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary pr

goal (1 subgoal):
 1. pr < 2 ^ m
[PROOF STEP]
using "4.hyps"(2) \<open>vebt_member summary pr\<close> member_bound
[PROOF STATE]
proof (prove)
using this:
both_member_options summary pr
invar_vebt summary m
vebt_member summary pr
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. pr < 2 ^ m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pr < 2 ^ m

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "\<exists> maxy. both_member_options (treeList ! pr) maxy"
[PROOF STATE]
proof (prove)
using this:
pr < 2 ^ m

goal (1 subgoal):
 1. \<exists>maxy. both_member_options (treeList ! pr) maxy
[PROOF STEP]
using "4.hyps"(7) \<open>both_member_options summary pr\<close>
[PROOF STATE]
proof (prove)
using this:
pr < 2 ^ m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
both_member_options summary pr

goal (1 subgoal):
 1. \<exists>maxy. both_member_options (treeList ! pr) maxy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>maxy. both_member_options (treeList ! pr) maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence fgh:"set_vebt' (treeList ! pr) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<exists>maxy. both_member_options (treeList ! pr) maxy

goal (1 subgoal):
 1. set_vebt' (treeList ! pr) \<noteq> {}
[PROOF STEP]
by (metis "4.hyps"(1) "4.hyps"(2) "4.hyps"(4) \<open>vebt_member summary pr\<close> empty_Collect_eq member_bound nth_mem set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
set_vebt' (treeList ! pr) \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "invar_vebt (treeList ! the ?pr) n"
[PROOF STATE]
proof (prove)
using this:
set_vebt' (treeList ! pr) \<noteq> {}

goal (1 subgoal):
 1. invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
[PROOF STEP]
by (simp add: "4.hyps"(1) "4.hyps"(4) \<open>pr < 2 ^ m\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close>)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
[PROOF STEP]
obtain maxy where "Some maxy = vebt_maxt (treeList ! pr)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n

goal (1 subgoal):
 1. (\<And>maxy. Some maxy = vebt_maxt (treeList ! pr) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> fgh option.sel vebt_maxt.elims maxt_corr_help_empty)
[PROOF STATE]
proof (state)
this:
Some maxy = vebt_maxt (treeList ! pr)

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "Some maxy = vebt_maxt (treeList ! the ?pr)"
[PROOF STATE]
proof (prove)
using this:
Some maxy = vebt_maxt (treeList ! pr)

goal (1 subgoal):
 1. Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
[PROOF STEP]
by (simp add: \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close>)
[PROOF STATE]
proof (state)
this:
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "max_in_set (set_vebt' (treeList ! the ?pr)) maxy"
[PROOF STATE]
proof (prove)
using this:
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))

goal (1 subgoal):
 1. max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy
[PROOF STEP]
using \<open>invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n\<close> maxt_corr
[PROOF STATE]
proof (prove)
using this:
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
\<lbrakk>invar_vebt ?t ?n; vebt_maxt ?t = Some ?x\<rbrakk> \<Longrightarrow> max_in_set (set_vebt' ?t) ?x

goal (1 subgoal):
 1. max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence scmem:"vebt_member (treeList ! the ?pr) maxy"
[PROOF STATE]
proof (prove)
using this:
max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy

goal (1 subgoal):
 1. vebt_member (treeList ! the (vebt_pred summary (high x (deg div 2)))) maxy
[PROOF STEP]
using \<open>Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))\<close> \<open>invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n\<close> maxt_member
[PROOF STATE]
proof (prove)
using this:
max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
\<lbrakk>invar_vebt ?t ?n; vebt_maxt ?t = Some ?maxi\<rbrakk> \<Longrightarrow> vebt_member ?t ?maxi

goal (1 subgoal):
 1. vebt_member (treeList ! the (vebt_pred summary (high x (deg div 2)))) maxy
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! the (vebt_pred summary (high x (deg div 2)))) maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?res =  "Some (2^(deg div 2)) *\<^sub>o ?pr +\<^sub>o vebt_maxt (treeList ! the ?pr)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
obtain res where snd: "res = the ?res"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>res. res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res = 2^(deg div 2) * pr + maxy"
[PROOF STATE]
proof (prove)
using this:
res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. res = 2 ^ (deg div 2) * pr + maxy
[PROOF STEP]
by (metis \<open>Some maxy = vebt_maxt (treeList ! pr)\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> add_def option.sel mul_def option_shift.simps(3))
[PROOF STATE]
proof (state)
this:
res = 2 ^ (deg div 2) * pr + maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "high res (deg div 2) = pr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high res (deg div 2) = pr
[PROOF STEP]
by (metis \<open>deg div 2 = n\<close> \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> \<open>invar_vebt (treeList ! the ?pr) n\<close> high_inv member_bound mult.commute scmem)
[PROOF STATE]
proof (state)
this:
high res (deg div 2) = pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res < x"
[PROOF STATE]
proof (prove)
using this:
high res (deg div 2) = pr

goal (1 subgoal):
 1. res < x
[PROOF STEP]
by (metis \<open>is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr\<close> div_le_mono high_def pred_member verit_comp_simplify1(3))
[PROOF STATE]
proof (state)
this:
res < x

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "both_member_options (treeList ! (high res (deg div 2))) (low res (deg div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))
[PROOF STEP]
by (metis \<open>deg div 2 = n\<close> \<open>high res (deg div 2) = pr\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> \<open>invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n\<close> both_member_options_equiv_member option.sel low_inv member_bound mult.commute scmem)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "both_member_options (Node (Some (mi, ma)) deg treeList summary) res"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) res
[PROOF STEP]
by (metis "4.hyps"(2) "4.hyps"(4) "4.hyps"(6) \<open>1 \<le> n\<close> \<open>both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))\<close> \<open>high res (deg div 2) = pr\<close> \<open>vebt_member summary pr\<close> both_member_options_from_chilf_to_complete_tree member_bound trans_le_add1)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_member (Node (Some (mi, ma)) deg treeList summary) res"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) res
[PROOF STEP]
using thisvalid valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) res
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) res
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res > mi"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. mi < res
[PROOF STEP]
by (metis "4.hyps"(11) \<open>both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))\<close> \<open>deg div 2 = n\<close> \<open>high res (deg div 2) = pr\<close> \<open>pr < 2 ^ m\<close> \<open>res < x\<close> \<open>x \<le> ma\<close> less_le_trans member_inv)
[PROOF STATE]
proof (state)
this:
mi < res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res < ma"
[PROOF STATE]
proof (prove)
using this:
mi < res

goal (1 subgoal):
 1. res < ma
[PROOF STEP]
using \<open>res < x\<close> \<open>x \<le> ma\<close> less_le_trans
[PROOF STATE]
proof (prove)
using this:
mi < res
res < x
x \<le> ma
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. res < ma
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
res < ma

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "(vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x) \<Longrightarrow> z \<le> res" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<Longrightarrow> z \<le> res
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<Longrightarrow> z \<le> res
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
assume "vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x"
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence 20: "z = mi \<or> z = ma \<or> (high z (deg div 2) < length treeList
                                    \<and> vebt_member ( treeList ! (high z (deg div 2))) (low z (deg div 2)))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x

goal (1 subgoal):
 1. z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using
              vebt_member.simps(5)[of mi ma "deg-2" treeList summary z]
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
vebt_member (Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary) z = (if z = mi then True else if z = ma then True else if z < mi then False else if ma < z then False else let h = high z (Suc (Suc (deg - 2)) div 2); l = low z (Suc (Suc (deg - 2)) div 2) in if h < length treeList then vebt_member (treeList ! h) l else False)

goal (1 subgoal):
 1. z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using member_inv
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
vebt_member (Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary) z = (if z = mi then True else if z = ma then True else if z < mi then False else if ma < z then False else let h = high z (Suc (Suc (deg - 2)) div 2); l = low z (Suc (Suc (deg - 2)) div 2) in if h < length treeList then vebt_member (treeList ! h) l else False)
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))

goal (1 subgoal):
 1. z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
have "z \<noteq> ma"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> ma
[PROOF STEP]
using \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> \<open>x \<le> ma\<close> leD
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
x \<le> ma
?y \<le> ?x \<Longrightarrow> \<not> ?x < ?y

goal (1 subgoal):
 1. z \<noteq> ma
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<noteq> ma

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence "mi \<noteq> ma"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> ma

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
by (metis \<open>mi < res\<close> \<open>res < x\<close> \<open>x \<le> ma\<close> leD less_trans)
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence "z < 2^deg"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. z < 2 ^ deg
[PROOF STEP]
using \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> member_bound thisvalid
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. z < 2 ^ deg
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z < 2 ^ deg

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence abc:"invar_vebt (treeList ! (high z (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
z < 2 ^ deg

goal (1 subgoal):
 1. invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
by (metis "4.hyps"(1) "4.hyps"(2) "4.hyps"(5) "4.hyps"(6) \<open>deg div 2 = n\<close> \<open>z < 2 ^ deg\<close> \<open>length treeList = 2 ^ n\<close> deg_not_0 exp_split_high_low(1) in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
show "z \<le> res"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
proof(cases "z = mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z = mi\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z = mi

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z = mi\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = mi

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
using \<open>mi < res\<close>
[PROOF STATE]
proof (prove)
using this:
z = mi
mi < res

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<le> res

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> mi

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence abe:"vebt_member( treeList ! (high z (deg div 2))) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using "20" \<open>z \<noteq> ma\<close>
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi
z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
z \<noteq> ma

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence abh:"vebt_member summary (high z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
by (metis "20" "4.hyps"(2) "4.hyps"(4) "4.hyps"(7) False \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> \<open>x \<le> ma\<close> abc both_member_options_equiv_member not_le)
[PROOF STATE]
proof (state)
this:
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
have aaa:"(high z (deg div 2)) = (high x (deg div 2)) \<Longrightarrow> vebt_member (treeList ! ?h) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using abe
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
have "high z(deg div 2) > pr \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
assume "high z(deg div 2) > pr"
[PROOF STATE]
proof (state)
this:
pr < high z (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "vebt_member summary (high z(deg div 2))"
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2)

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
using abh
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2)
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
have aaaa:"?h \<le> high z(deg div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high x (deg div 2) \<le> high z (deg div 2)
[PROOF STEP]
by (meson \<open>is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr\<close> \<open>pr < high z (deg div 2)\<close> abh leD not_le_imp_less pred_member)
[PROOF STATE]
proof (state)
this:
high x (deg div 2) \<le> high z (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
have bbbb:"?h \<ge> high z(deg div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
by (simp add: \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> div_le_mono dual_order.strict_implies_order high_def)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "?h = high z (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. high x (deg div 2) = high z (deg div 2)
[PROOF STEP]
using aaaa eq_iff
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)
high x (deg div 2) \<le> high z (deg div 2)
(?a = ?b) = (?a \<le> ?b \<and> ?b \<le> ?a)

goal (1 subgoal):
 1. high x (deg div 2) = high z (deg div 2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high x (deg div 2) = high z (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "vebt_member (treeList ! ?h) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
high x (deg div 2) = high z (deg div 2)

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using aaa
[PROOF STATE]
proof (prove)
using this:
high x (deg div 2) = high z (deg div 2)
high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "(low z (deg div 2)) < ?l"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. low z (deg div 2) < low x (deg div 2)
[PROOF STEP]
by (metis \<open>high x (deg div 2) = high z (deg div 2)\<close> \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> add_le_cancel_left div_mult_mod_eq high_def less_le low_def)
[PROOF STATE]
proof (state)
this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low z (deg div 2) < low x (deg div 2)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. False
[PROOF STEP]
using "33" \<open>vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))\<close>
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pr < high z (deg div 2) \<Longrightarrow> False

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "high z(deg div 2) \<le> pr"
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2) \<Longrightarrow> False

goal (1 subgoal):
 1. high z (deg div 2) \<le> pr
[PROOF STEP]
using not_less
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2) \<Longrightarrow> False
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. high z (deg div 2) \<le> pr
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> pr

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) \<le> pr
[PROOF STEP]
show " z \<le> res"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> pr

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
proof(cases "high z(deg div 2) = pr")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = pr

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "vebt_member (treeList ! (high z(deg div 2))) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = pr

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using abe
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = pr
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
have "low z (deg div 2) \<le> maxy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low z (deg div 2) \<le> maxy
[PROOF STEP]
using True \<open>Some maxy = vebt_maxt (treeList ! pr)\<close> abc abe maxt_corr_help
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = pr
Some maxy = vebt_maxt (treeList ! pr)
invar_vebt (treeList ! high z (deg div 2)) n
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
\<lbrakk>invar_vebt ?t ?n; vebt_maxt ?t = Some ?maxi; vebt_member ?t ?x\<rbrakk> \<Longrightarrow> ?x \<le> ?maxi

goal (1 subgoal):
 1. low z (deg div 2) \<le> maxy
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
low z (deg div 2) \<le> maxy

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "z \<le> res"
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) \<le> maxy

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by (metis True \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> add_le_cancel_left div_mult_mod_eq high_def low_def mult.commute)
[PROOF STATE]
proof (state)
this:
z \<le> res

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<le> res
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<le> res

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z \<le> res

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<noteq> pr

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "high z(deg div 2) < pr"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<noteq> pr

goal (1 subgoal):
 1. high z (deg div 2) < pr
[PROOF STEP]
by (simp add: \<open>high z (deg div 2) \<le> pr\<close> less_le)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < pr

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) < pr
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < pr

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by (metis \<open>high res (deg div 2) = pr\<close> div_le_mono high_def leD linear)
[PROOF STATE]
proof (state)
this:
z \<le> res

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> res

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> res

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<Longrightarrow> ?z \<le> res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<Longrightarrow> ?z \<le> res

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
[PROOF STEP]
using \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) res\<close> \<open>res < x\<close> pred_member
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<Longrightarrow> ?z \<le> res
vebt_member (Node (Some (mi, ma)) deg treeList summary) res
res < x
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
using fst snd
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis \<open>Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> add_shift dual_order.eq_iff mul_shift pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> high x (deg div 2) < length treeList

goal (1 subgoal):
 1. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> high x (deg div 2) < length treeList
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> high x (deg div 2) < length treeList

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis "4.hyps"(10) "4.hyps"(5) "4.hyps"(6) \<open>1 \<le> n\<close> \<open>deg div 2 = n\<close> \<open>length treeList = 2 ^ n\<close> \<open>x \<le> ma\<close> exp_split_high_low(1) le_less_trans le_neq_implies_less not_less not_less_zero zero_neq_one)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case (5 treeList n summary m deg mi ma)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t))
mi \<le> ma
ma < 2 ^ deg
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "Suc n = m"  and "deg = n + m" and "length treeList = 2^m \<and> invar_vebt summary m"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t))
mi \<le> ma
ma < 2 ^ deg
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))

goal (1 subgoal):
 1. Suc n = m &&& deg = n + m &&& length treeList = 2 ^ m \<and> invar_vebt summary m
[PROOF STEP]
by blast +
[PROOF STATE]
proof (state)
this:
Suc n = m
deg = n + m
length treeList = 2 ^ m \<and> invar_vebt summary m

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "n \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
Suc n = m
deg = n + m
length treeList = 2 ^ m \<and> invar_vebt summary m

goal (1 subgoal):
 1. 1 \<le> n
[PROOF STEP]
using "5.hyps"(1) set_n_deg_not_0
[PROOF STATE]
proof (prove)
using this:
Suc n = m
deg = n + m
length treeList = 2 ^ m \<and> invar_vebt summary m
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
\<lbrakk>\<forall>t\<in>set ?treeList. invar_vebt t ?n; length ?treeList = 2 ^ ?m\<rbrakk> \<Longrightarrow> 1 \<le> ?n

goal (1 subgoal):
 1. 1 \<le> n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 \<le> n

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "deg \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. 2 \<le> deg
[PROOF STEP]
by (simp add: "5.hyps"(5) "5.hyps"(6))
[PROOF STATE]
proof (state)
this:
2 \<le> deg

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "deg div 2 =n"
[PROOF STATE]
proof (prove)
using this:
2 \<le> deg

goal (1 subgoal):
 1. deg div 2 = n
[PROOF STEP]
by (simp add: "5.hyps"(5) "5.hyps"(6))
[PROOF STATE]
proof (state)
this:
deg div 2 = n

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
deg div 2 = n

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence thisvalid:"invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg"
[PROOF STATE]
proof (prove)
using this:
deg div 2 = n

goal (1 subgoal):
 1. invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
[PROOF STEP]
using 5 invar_vebt.intros(5)[of treeList n summary m]
[PROOF STATE]
proof (prove)
using this:
deg div 2 = n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt summary m
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t))
mi \<le> ma
ma < 2 ^ deg
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))
\<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; m = Suc n; ?deg = n + m; \<forall>i<2 ^ m. (\<exists>x. both_member_options (treeList ! i) x) = both_member_options summary i; ?mi = ?ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x); ?mi \<le> ?ma; ?ma < 2 ^ ?deg; ?mi \<noteq> ?ma \<longrightarrow> (\<forall>i<2 ^ m. (high ?ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ?ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> ?mi < x \<and> x \<le> ?ma))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (?mi, ?ma)) ?deg treeList summary) ?deg

goal (1 subgoal):
 1. invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
deg div 2 = n
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
[PROOF STEP]
have "deg div 2 =n"
[PROOF STATE]
proof (prove)
using this:
deg div 2 = n
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. deg div 2 = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
deg div 2 = n

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x px. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa); invar_vebt summary m; \<And>x px. (vebt_pred summary x = Some px) = is_pred_in_set (set_vebt' summary) x px; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<not> Ex (both_member_options t)); mi \<le> ma; ma < 2 ^ deg; mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> ma))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deg div 2 = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
deg div 2 = n

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "x > ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
ma < x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 0: "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some ma"
[PROOF STATE]
proof (prove)
using this:
ma < x

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some ma
[PROOF STEP]
by (simp add: \<open>2 \<le> deg\<close> pred_max)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some ma

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 1:"ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)"
[PROOF STATE]
proof (prove)
using this:
ma = the (vebt_maxt (Node (Some (mi, ma)) deg treeList summary))

goal (1 subgoal):
 1. ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
by (metis VEBT_Member.vebt_member.simps(5) \<open>2 \<le> deg\<close> add_numeral_left arith_simps(1) le_add_diff_inverse mem_Collect_eq numerals(1) plus_1_eq_Suc set_vebt'_def)
[PROOF STATE]
proof (state)
this:
ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 2:"y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> y \<le> x" for y
[PROOF STATE]
proof (prove)
using this:
ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)

goal (1 subgoal):
 1. y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> y \<le> x
[PROOF STEP]
using "5.hyps"(9) True member_inv set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)
mi \<le> ma
ma < x
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))
set_vebt' ?t = {x. vebt_member ?t x}

goal (1 subgoal):
 1. y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> y \<le> x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> ?y \<le> x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 3: "y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> (y < ma \<Longrightarrow> y \<le> x)" for y
[PROOF STATE]
proof (prove)
using this:
?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary) \<Longrightarrow> ?y \<le> x

goal (1 subgoal):
 1. \<lbrakk>y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary); y < ma\<rbrakk> \<Longrightarrow> y \<le> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary); ?y < ma\<rbrakk> \<Longrightarrow> ?y \<le> x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 4: "\<forall> y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary); ?y < ma\<rbrakk> \<Longrightarrow> ?y \<le> x

goal (1 subgoal):
 1. \<forall>y\<in>set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>set_vebt' (Node (Some (mi, ma)) deg treeList summary). y < ma \<longrightarrow> y \<le> x

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma
[PROOF STEP]
by (metis "5.hyps"(9) True \<open>ma \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)\<close> less_or_eq_imp_le mem_Collect_eq member_inv pred_member set_vebt'_def)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma

goal (2 subgoals):
 1. \<lbrakk>deg div 2 = n; ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x ma

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis "0" option.sel leD le_less_Suc_eq not_less_eq pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> ma < x

goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "x \<le> ma"
[PROOF STATE]
proof (prove)
using this:
\<not> ma < x

goal (1 subgoal):
 1. x \<le> ma
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<le> ma

goal (1 subgoal):
 1. \<lbrakk>deg div 2 = n; \<not> ma < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<le> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<le> ma

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "high x (deg div 2)< length treeList ")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high x (deg div 2) < length treeList

goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "high x n < 2^m \<and> low x n < 2^n"
[PROOF STATE]
proof (prove)
using this:
high x (deg div 2) < length treeList

goal (1 subgoal):
 1. high x n < 2 ^ m \<and> low x n < 2 ^ n
[PROOF STEP]
by (simp add: \<open>deg div 2 = n\<close> \<open>length treeList = 2 ^ m\<close> low_def)
[PROOF STATE]
proof (state)
this:
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?l = "low x (deg div 2)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?h = "high x (deg div 2)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?minlow = "vebt_mint (treeList ! ?h)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?pr = "vebt_pred summary ?h"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 1:"vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =
                           (if ?minlow \<noteq> None \<and> (Some ?l >\<^sub>o  ?minlow) then
                                                    Some (2^(deg div 2)) *\<^sub>o Some ?h +\<^sub>o vebt_pred (treeList ! ?h) ?l
                             else let pr = vebt_pred summary ?h in
                             if pr = None then (if x > mi then Some mi else None)
                             else Some (2^(deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))
[PROOF STEP]
by (smt True \<open>2 \<le> deg\<close> \<open>x \<le> ma\<close> pred_less_length_list)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))

goal (2 subgoals):
 1. \<lbrakk>x \<le> ma; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "?minlow \<noteq> None \<and> (Some ?l >\<^sub>o  ?minlow)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))
[PROOF STEP]
obtain minl where 00:"(Some minl = ?minlow) \<and> ?l > minl"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. (\<And>minl. Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 01:"invar_vebt ((treeList ! ?h)) n \<and> (treeList ! ?h) \<in> set treeList "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
[PROOF STEP]
by (metis "5.hyps"(1) \<open>deg div 2 = n\<close> \<open>high x n < 2 ^ m \<and> low x n < 2 ^ n\<close> \<open>length treeList = 2 ^ m \<and> invar_vebt summary m\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have  02:"vebt_member ((treeList ! ?h)) minl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) minl
[PROOF STEP]
using "00" "01" mint_member
[PROOF STATE]
proof (prove)
using this:
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?maxi\<rbrakk> \<Longrightarrow> vebt_member ?t ?maxi

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) minl
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) minl

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 03: "\<exists> y. y < ?l \<and> vebt_member ((treeList ! ?h)) y"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) minl

goal (1 subgoal):
 1. \<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y
[PROOF STEP]
using "00"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) minl
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)

goal (1 subgoal):
 1. \<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence afinite: "finite (set_vebt' (treeList ! ?h)) "
[PROOF STATE]
proof (prove)
using this:
\<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y

goal (1 subgoal):
 1. finite (set_vebt' (treeList ! high x (deg div 2)))
[PROOF STEP]
using "01" set_vebt_finite
[PROOF STATE]
proof (prove)
using this:
\<exists>y<low x (deg div 2). vebt_member (treeList ! high x (deg div 2)) y
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
invar_vebt ?t ?n \<Longrightarrow> finite (set_vebt' ?t)

goal (1 subgoal):
 1. finite (set_vebt' (treeList ! high x (deg div 2)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (set_vebt' (treeList ! high x (deg div 2)))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (set_vebt' (treeList ! high x (deg div 2)))
[PROOF STEP]
obtain predy where 04:"is_pred_in_set (set_vebt' (treeList ! ?h)) ?l predy"
[PROOF STATE]
proof (prove)
using this:
finite (set_vebt' (treeList ! high x (deg div 2)))

goal (1 subgoal):
 1. (\<And>predy. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using "00" "01" mint_corr obtain_set_pred
[PROOF STATE]
proof (prove)
using this:
finite (set_vebt' (treeList ! high x (deg div 2)))
Some minl = vebt_mint (treeList ! high x (deg div 2)) \<and> minl < low x (deg div 2)
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?x\<rbrakk> \<Longrightarrow> min_in_set (set_vebt' ?t) ?x
\<lbrakk>?z < ?x; min_in_set ?A ?z; finite ?A\<rbrakk> \<Longrightarrow> \<exists>y. is_pred_in_set ?A ?x y

goal (1 subgoal):
 1. (\<And>predy. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 05:"Some predy =  vebt_pred (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (1 subgoal):
 1. Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))
[PROOF STEP]
using 5(1) 01
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList

goal (1 subgoal):
 1. Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x  =  Some (2^(deg div 2)*  ?h + predy) "
[PROOF STATE]
proof (prove)
using this:
Some predy = vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by (metis "1" True add_def mul_def option_shift.simps(3))
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 06: "predy \<in> set_vebt' (treeList ! ?h)"
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (1 subgoal):
 1. predy \<in> set_vebt' (treeList ! high x (deg div 2))
[PROOF STEP]
using "04" is_pred_in_set_def
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
is_pred_in_set ?xs ?x ?y = (?y \<in> ?xs \<and> ?y < ?x \<and> (\<forall>z\<in>?xs. z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. predy \<in> set_vebt' (treeList ! high x (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 07: "predy < 2^(deg div 2) \<and> ?h < 2^(deg div 2 +1) \<and> deg div 2 + deg div 2 +1 = deg"
[PROOF STATE]
proof (prove)
using this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. predy < 2 ^ (deg div 2) \<and> high x (deg div 2) < 2 ^ (deg div 2 + 1) \<and> deg div 2 + deg div 2 + 1 = deg
[PROOF STEP]
using "04" "5.hyps"(5) "5.hyps"(6) \<open>high x n < 2 ^ m \<and> low x n < 2 ^ n\<close> pred_member
[PROOF STATE]
proof (prove)
using this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
m = Suc n
deg = n + m
high x n < 2 ^ m \<and> low x n < 2 ^ n
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. predy < 2 ^ (deg div 2) \<and> high x (deg div 2) < 2 ^ (deg div 2 + 1) \<and> deg div 2 + deg div 2 + 1 = deg
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
predy < 2 ^ (deg div 2) \<and> high x (deg div 2) < 2 ^ (deg div 2 + 1) \<and> deg div 2 + deg div 2 + 1 = deg

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?y = "2^(deg div 2)*  ?h + predy"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 08: "vebt_member (treeList ! ?h) predy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) predy
[PROOF STEP]
using "06" set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
predy \<in> set_vebt' (treeList ! high x (deg div 2))
set_vebt' ?t = {x. vebt_member ?t x}

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) predy
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 09: "both_member_options (treeList ! ?h) predy"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) predy

goal (1 subgoal):
 1. both_member_options (treeList ! high x (deg div 2)) predy
[PROOF STEP]
using "01" both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) predy
invar_vebt (treeList ! high x (deg div 2)) n \<and> treeList ! high x (deg div 2) \<in> set treeList
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. both_member_options (treeList ! high x (deg div 2)) predy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high x (deg div 2)) predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 10: "high ?y (deg div 2) = ?h \<and> low ?y (deg div 2) = predy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy
[PROOF STEP]
by (simp add: "07" high_inv low_inv mult.commute)
[PROOF STATE]
proof (state)
this:
high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 14:"both_member_options (Node (Some (mi, ma)) deg treeList summary) ?y"
[PROOF STATE]
proof (prove)
using this:
high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
using "07" "09" "5.hyps"(4) \<open>deg div 2 = n\<close> \<open>high x n < 2 ^ m \<and> low x n < 2 ^ n\<close> both_member_options_from_chilf_to_complete_tree
[PROOF STATE]
proof (prove)
using this:
high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy
predy < 2 ^ (deg div 2) \<and> high x (deg div 2) < 2 ^ (deg div 2 + 1) \<and> deg div 2 + deg div 2 + 1 = deg
both_member_options (treeList ! high x (deg div 2)) predy
length treeList = 2 ^ m
deg div 2 = n
high x n < 2 ^ m \<and> low x n < 2 ^ n
\<lbrakk>high ?x (?deg div 2) < length ?treeList; 1 \<le> ?deg; both_member_options (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2))\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 15: "vebt_member (Node (Some (mi, ma)) deg treeList summary) ?y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
using "14" thisvalid valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 16: "Some ?y = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (2 ^ (deg div 2) * high x (deg div 2) + predy) = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x
[PROOF STEP]
by (simp add: \<open>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2) * high x (deg div 2) + predy)\<close>)
[PROOF STATE]
proof (state)
this:
Some (2 ^ (deg div 2) * high x (deg div 2) + predy) = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 17: "x = ?h * 2^(deg div 2) + ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)
[PROOF STEP]
using bit_concat_def bit_split_inv
[PROOF STATE]
proof (prove)
using this:
bit_concat ?h ?l ?d = ?h * 2 ^ ?d + ?l
bit_concat (high ?x ?d) (low ?x ?d) ?d = ?x

goal (1 subgoal):
 1. x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 18: "x - ?y =   ?h * 2^(deg div 2) + ?l -?h * 2^(deg div 2) - predy "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy
[PROOF STEP]
by (metis "17" diff_diff_add mult.commute)
[PROOF STATE]
proof (state)
this:
x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 19: "?y < x"
[PROOF STATE]
proof (prove)
using this:
x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy

goal (1 subgoal):
 1. 2 ^ (deg div 2) * high x (deg div 2) + predy < x
[PROOF STEP]
using "04" "17" mult.commute nat_add_left_cancel_less pred_member
[PROOF STATE]
proof (prove)
using this:
x - (2 ^ (deg div 2) * high x (deg div 2) + predy) = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2) - high x (deg div 2) * 2 ^ (deg div 2) - predy
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
x = high x (deg div 2) * 2 ^ (deg div 2) + low x (deg div 2)
?a * ?b = ?b * ?a
(?k + ?m < ?k + ?n) = (?m < ?n)
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. 2 ^ (deg div 2) * high x (deg div 2) + predy < x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
2 ^ (deg div 2) * high x (deg div 2) + predy < x

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have 20: "z < x \<Longrightarrow> vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<Longrightarrow> z\<le> ?y " for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
assume "z < x" and "vebt_member (Node (Some (mi, ma)) deg treeList summary) z"
[PROOF STATE]
proof (state)
this:
z < x
vebt_member (Node (Some (mi, ma)) deg treeList summary) z

goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "high z (deg div 2) \<le> high x (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
z < x
vebt_member (Node (Some (mi, ma)) deg treeList summary) z

goal (1 subgoal):
 1. high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
by (simp add: div_le_mono high_def)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
proof(cases "high z (deg div 2) = high x (deg div 2)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) = high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = high x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) = high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence 0000: "high z (deg div 2) = high x (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = high x (deg div 2)

goal (1 subgoal):
 1. high z (deg div 2) = high x (deg div 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = high x (deg div 2)

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) = high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) = high x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = high x (deg div 2)

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
proof(cases "z = mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z = mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z = mi

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z = mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
 2. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = mi

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by (metis "15" "5.hyps"(9) add.left_neutral le_add2 less_imp_le_nat member_inv)
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> mi

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence ad:"vebt_member (treeList ! ?h) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using vebt_member.simps(5)[of mi ma "deg-2" treeList summary z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi
vebt_member (Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary) z = (if z = mi then True else if z = ma then True else if z < mi then False else if ma < z then False else let h = high z (Suc (Suc (deg - 2)) div 2); l = low z (Suc (Suc (deg - 2)) div 2) in if h < length treeList then vebt_member (treeList ! h) l else False)

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by (metis True \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z\<close> \<open>x \<le> ma\<close> \<open>z < x\<close> leD member_inv)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
have "is_pred_in_set (set_vebt' (treeList ! ?h)) ?l predy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
[PROOF STEP]
using "04"
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
have "low z (deg div 2) < ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low z (deg div 2) < low x (deg div 2)
[PROOF STEP]
by (metis (full_types) True \<open>z < x\<close> bit_concat_def bit_split_inv nat_add_left_cancel_less)
[PROOF STATE]
proof (state)
this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "predy \<ge> low z (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. low z (deg div 2) \<le> predy
[PROOF STEP]
using 04 ad
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)
is_pred_in_set (set_vebt' (treeList ! high x (deg div 2))) (low x (deg div 2)) predy
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. low z (deg div 2) \<le> predy
[PROOF STEP]
unfolding is_pred_in_set_def
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)
predy \<in> set_vebt' (treeList ! high x (deg div 2)) \<and> predy < low x (deg div 2) \<and> (\<forall>z\<in>set_vebt' (treeList ! high x (deg div 2)). z < low x (deg div 2) \<longrightarrow> z \<le> predy)
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. low z (deg div 2) \<le> predy
[PROOF STEP]
by (simp add: set_vebt'_def)
[PROOF STATE]
proof (state)
this:
low z (deg div 2) \<le> predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "?y \<ge> z"
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) \<le> predy

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by (smt True bit_concat_def bit_split_inv diff_add_inverse diff_diff_add diff_is_0_eq mult.commute)
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) = high x (deg div 2); z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<noteq> high x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
hence "high z (deg div 2) < high ?y (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<noteq> high x (deg div 2)

goal (1 subgoal):
 1. high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)
[PROOF STEP]
using "10" \<open>high z (deg div 2) \<le> high x (deg div 2)\<close>
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<noteq> high x (deg div 2)
high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = high x (deg div 2) \<and> low (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2) = predy
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> high x (deg div 2); high z (deg div 2) \<noteq> high x (deg div 2)\<rbrakk> \<Longrightarrow> z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < high (2 ^ (deg div 2) * high x (deg div 2) + predy) (deg div 2)

goal (1 subgoal):
 1. z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy
[PROOF STEP]
by (metis div_le_mono high_def nat_le_linear not_le)
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z\<rbrakk> \<Longrightarrow> ?z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt'(Node (Some (mi, ma)) deg treeList summary)) x ?y"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?z < x; vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z\<rbrakk> \<Longrightarrow> ?z \<le> 2 ^ (deg div 2) * high x (deg div 2) + predy

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
by (simp add: "15" "19" pred_member)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (2 subgoals):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
using 16
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x (2 ^ (deg div 2) * high x (deg div 2) + predy)
Some (2 ^ (deg div 2) * high x (deg div 2) + predy) = vebt_pred (Node (Some (mi, ma)) deg treeList summary) x

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis eq_iff option.inject pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence i1:"?minlow =  None \<or> \<not> (Some ?l >\<^sub>o  ?minlow)"
[PROOF STATE]
proof (prove)
using this:
\<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))

goal (1 subgoal):
 1. vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 2: "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =  (
                            if ?pr = None then (if x > mi
                                                then Some mi
                                                else None)
                             else Some (2^(deg div 2)) *\<^sub>o ?pr +\<^sub>o vebt_maxt (treeList ! the ?pr))"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))
[PROOF STEP]
using "1"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have " invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x (deg div 2)) n
[PROOF STEP]
by (metis "5"(1) True inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x (deg div 2)) n

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence 33:"\<nexists> u. vebt_member (treeList ! ?h) u \<and> u < ?l"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x (deg div 2)) n

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
proof(cases "?minlow = None")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
 2. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) = None

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
 2. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_mint (treeList ! high x (deg div 2)) = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
using mint_corr_help_empty[of "treeList ! ?h" n]
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = None
\<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> set_vebt' (treeList ! high x (deg div 2)) = {}

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
by (simp add: \<open>invar_vebt (treeList ! high x (deg div 2)) n\<close> set_vebt'_def)
[PROOF STATE]
proof (state)
this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
obtain minilow where "?minlow =Some minilow"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>minilow. vebt_mint (treeList ! high x (deg div 2)) = Some minilow \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. (\<And>minilow. vebt_mint (treeList ! high x (deg div 2)) = Some minilow \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_mint (treeList ! high x (deg div 2)) = Some minilow

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
hence "minilow \<ge> ?l"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = Some minilow

goal (1 subgoal):
 1. low x (deg div 2) \<le> minilow
[PROOF STEP]
using "i1"
[PROOF STATE]
proof (prove)
using this:
vebt_mint (treeList ! high x (deg div 2)) = Some minilow
vebt_mint (treeList ! high x (deg div 2)) = None \<or> \<not> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2))

goal (1 subgoal):
 1. low x (deg div 2) \<le> minilow
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
low x (deg div 2) \<le> minilow

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high x (deg div 2)) n; vebt_mint (treeList ! high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low x (deg div 2) \<le> minilow
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
low x (deg div 2) \<le> minilow

goal (1 subgoal):
 1. \<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
by (meson \<open>vebt_mint (treeList ! high x (deg div 2)) = Some minilow\<close> \<open>invar_vebt (treeList ! high x (deg div 2)) n\<close> leD less_le_trans mint_corr_help)
[PROOF STATE]
proof (state)
this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)) then Some (2 ^ (deg div 2)) *\<^sub>o Some (high x (deg div 2)) +\<^sub>o vebt_pred (treeList ! high x (deg div 2)) (low x (deg div 2)) else let pr = vebt_pred summary (high x (deg div 2)) in if pr = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o pr +\<^sub>o vebt_maxt (treeList ! the pr)); \<not> (vebt_mint (treeList ! high x (deg div 2)) \<noteq> None \<and> Some (low x (deg div 2)) >\<^sub>o vebt_mint (treeList ! high x (deg div 2)))\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "?pr= None")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_pred summary (high x (deg div 2)) = None

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =  (if x > mi then Some mi else  None)"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) = None

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)
[PROOF STEP]
by (simp add: "2")
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "\<nexists> i. is_pred_in_set (set_vebt' summary) ?h i"
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)

goal (1 subgoal):
 1. \<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
[PROOF STEP]
using "5.hyps"(3) True
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px
vebt_pred summary (high x (deg div 2)) = None

goal (1 subgoal):
 1. \<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "\<nexists> i. i < ?h \<and> vebt_member summary i "
[PROOF STATE]
proof (prove)
using this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i

goal (1 subgoal):
 1. \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
using pred_none_empty[of "set_vebt' summary" ?h]
[PROOF STATE]
proof (prove)
using this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
\<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))

goal (1 subgoal):
 1. \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
fix nn :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
have "\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)
[PROOF STEP]
using \<open>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i\<close> pred_none_empty set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i
\<lbrakk>\<nexists>x. is_pred_in_set ?xs ?a x; finite ?xs\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>?xs. x < ?a)
set_vebt' ?t = {x. vebt_member ?t x}

goal (1 subgoal):
 1. \<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)
[PROOF STEP]
have "\<not> nn < high x (deg div 2) \<or> \<not> vebt_member summary nn"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ((is_pred_in_set (Collect (vebt_member summary)) (high x (deg div 2)) esk1_0 \<or> infinite (Collect (vebt_member summary))) \<or> n \<notin> Collect (vebt_member summary)) \<or> \<not> n < high x (deg div 2)

goal (1 subgoal):
 1. \<not> nn < high x (deg div 2) \<or> \<not> vebt_member summary nn
[PROOF STEP]
by (metis (no_types) "5.hyps"(2) \<open>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i\<close> mem_Collect_eq set_vebt'_def set_vebt_finite)
[PROOF STATE]
proof (state)
this:
\<not> nn < high x (deg div 2) \<or> \<not> vebt_member summary nn

goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> ?nn2 < high x (deg div 2) \<or> \<not> vebt_member summary ?nn2

goal (1 subgoal):
 1. \<lbrakk>\<nexists>i. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) i; \<lbrakk>\<nexists>x. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) x; finite (set_vebt' summary)\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>set_vebt' summary. x < high x (deg div 2))\<rbrakk> \<Longrightarrow> \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> ?nn2 < high x (deg div 2) \<or> \<not> vebt_member summary ?nn2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> ?nn2 < high x (deg div 2) \<or> \<not> vebt_member summary ?nn2

goal (1 subgoal):
 1. \<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)

goal (2 subgoals):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) = None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
proof(cases "x > mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi < x

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi"
[PROOF STATE]
proof (prove)
using this:
mi < x

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi
[PROOF STEP]
by (simp add: \<open>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if mi < x then Some mi else None)\<close>)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "(vebt_member (Node (Some (mi, ma)) deg treeList summary) z  \<and> z < x \<and> z > mi) \<Longrightarrow> False" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
assume "vebt_member (Node (Some (mi, ma)) deg treeList summary) z  \<and> z < x \<and> z > mi"
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
hence "vebt_member ( treeList ! (high z (deg div 2))) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using \<open>x \<le> ma\<close> member_inv not_le
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z
x \<le> ma
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
hence "high z (deg div 2) < 2^m"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. high z (deg div 2) < 2 ^ m
[PROOF STEP]
using "5.hyps"(4) \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z\<close> \<open>x \<le> ma\<close> member_inv
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
length treeList = 2 ^ m
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z
x \<le> ma
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))

goal (1 subgoal):
 1. high z (deg div 2) < 2 ^ m
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
hence "invar_vebt (treeList ! (high z (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
using 5(1)
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < 2 ^ m
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. (vebt_pred t x = Some xa) = is_pred_in_set (set_vebt' t) x xa)

goal (1 subgoal):
 1. invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
by (simp add: "5.hyps"(4))
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
have "vebt_member summary (high z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
using 5(7)
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
using "5.hyps"(2) both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
high z (deg div 2) < 2 ^ m
invar_vebt (treeList ! high z (deg div 2)) n
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
invar_vebt summary m
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
have "(high z (deg div 2)) \<le> ?h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
by (simp add: \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z\<close> div_le_mono high_def less_or_eq_imp_le)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis "33" \<open>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i)\<close> \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<and> mi < z\<close> \<open>vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))\<close> \<open>vebt_member summary (high z (deg div 2))\<close> bit_concat_def bit_split_inv le_neq_implies_less nat_add_left_cancel_less)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<and> mi < ?z \<Longrightarrow> False

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' ((Node (Some (mi, ma)) deg treeList summary))) x mi"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<and> mi < ?z \<Longrightarrow> False

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi
[PROOF STEP]
by (metis VEBT_Member.vebt_member.simps(5) True \<open>2 \<le> deg\<close> add_2_eq_Suc le_add_diff_inverse le_less_linear pred_member)
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi

goal (2 subgoals):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
 2. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x mi

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis \<open>vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some mi\<close> \<open>x \<le> ma\<close> option.sel leD member_inv pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> mi < x

goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None"
[PROOF STATE]
proof (prove)
using this:
\<not> mi < x

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None
[PROOF STEP]
by (simp add: "2" True)
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None

goal (1 subgoal):
 1. \<lbrakk>\<not> (\<exists>i<high x (deg div 2). vebt_member summary i); \<not> mi < x\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = None

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis (full_types) False less_trans member_inv option.distinct(1) pred_max pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_pred summary (high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence fst:"vebt_pred (Node (Some (mi, ma)) deg treeList summary) x =
                    Some (2^(deg div 2)) *\<^sub>o ?pr +\<^sub>o vebt_maxt (treeList ! the ?pr)"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
[PROOF STEP]
using "2"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) \<noteq> None
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = (if vebt_pred summary (high x (deg div 2)) = None then if mi < x then Some mi else None else Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
obtain pr where "?pr = Some pr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>pr. vebt_pred summary (high x (deg div 2)) = Some pr \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) \<noteq> None

goal (1 subgoal):
 1. (\<And>pr. vebt_pred summary (high x (deg div 2)) = Some pr \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_pred summary (high x (deg div 2)) = Some pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' summary) ?h pr"
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) = Some pr

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr
[PROOF STEP]
using "5.hyps"(3)
[PROOF STATE]
proof (prove)
using this:
vebt_pred summary (high x (deg div 2)) = Some pr
(vebt_pred summary ?x = Some ?px) = is_pred_in_set (set_vebt' summary) ?x ?px

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_member summary pr"
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr

goal (1 subgoal):
 1. vebt_member summary pr
[PROOF STEP]
using pred_member
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. vebt_member summary pr
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member summary pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "both_member_options summary pr"
[PROOF STATE]
proof (prove)
using this:
vebt_member summary pr

goal (1 subgoal):
 1. both_member_options summary pr
[PROOF STEP]
using "5.hyps"(2) both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
vebt_member summary pr
invar_vebt summary m
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. both_member_options summary pr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options summary pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "pr < 2^m"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary pr

goal (1 subgoal):
 1. pr < 2 ^ m
[PROOF STEP]
using "5.hyps"(2) \<open>vebt_member summary pr\<close> member_bound
[PROOF STATE]
proof (prove)
using this:
both_member_options summary pr
invar_vebt summary m
vebt_member summary pr
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. pr < 2 ^ m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pr < 2 ^ m

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "\<exists> maxy. both_member_options (treeList ! pr) maxy"
[PROOF STATE]
proof (prove)
using this:
pr < 2 ^ m

goal (1 subgoal):
 1. \<exists>maxy. both_member_options (treeList ! pr) maxy
[PROOF STEP]
using "5.hyps"(7) \<open>both_member_options summary pr\<close>
[PROOF STATE]
proof (prove)
using this:
pr < 2 ^ m
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
both_member_options summary pr

goal (1 subgoal):
 1. \<exists>maxy. both_member_options (treeList ! pr) maxy
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>maxy. both_member_options (treeList ! pr) maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence fgh:"set_vebt' (treeList ! pr) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<exists>maxy. both_member_options (treeList ! pr) maxy

goal (1 subgoal):
 1. set_vebt' (treeList ! pr) \<noteq> {}
[PROOF STEP]
by (metis "5.hyps"(1) "5.hyps"(4) Collect_empty_eq \<open>pr < 2 ^ m\<close> nth_mem set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
set_vebt' (treeList ! pr) \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "invar_vebt (treeList ! the ?pr) n"
[PROOF STATE]
proof (prove)
using this:
set_vebt' (treeList ! pr) \<noteq> {}

goal (1 subgoal):
 1. invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
[PROOF STEP]
by (simp add: "5.hyps"(1) "5.hyps"(4) \<open>pr < 2 ^ m\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close>)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
[PROOF STEP]
obtain maxy where "Some maxy = vebt_maxt (treeList ! pr)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n

goal (1 subgoal):
 1. (\<And>maxy. Some maxy = vebt_maxt (treeList ! pr) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> fgh option.sel vebt_maxt.elims maxt_corr_help_empty)
[PROOF STATE]
proof (state)
this:
Some maxy = vebt_maxt (treeList ! pr)

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "Some maxy = vebt_maxt (treeList ! the ?pr)"
[PROOF STATE]
proof (prove)
using this:
Some maxy = vebt_maxt (treeList ! pr)

goal (1 subgoal):
 1. Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
[PROOF STEP]
by (simp add: \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close>)
[PROOF STATE]
proof (state)
this:
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "max_in_set (set_vebt' (treeList ! the ?pr)) maxy"
[PROOF STATE]
proof (prove)
using this:
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))

goal (1 subgoal):
 1. max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy
[PROOF STEP]
using \<open>invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n\<close> maxt_corr
[PROOF STATE]
proof (prove)
using this:
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
\<lbrakk>invar_vebt ?t ?n; vebt_maxt ?t = Some ?x\<rbrakk> \<Longrightarrow> max_in_set (set_vebt' ?t) ?x

goal (1 subgoal):
 1. max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence scmem:"vebt_member (treeList ! the ?pr) maxy"
[PROOF STATE]
proof (prove)
using this:
max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy

goal (1 subgoal):
 1. vebt_member (treeList ! the (vebt_pred summary (high x (deg div 2)))) maxy
[PROOF STEP]
using \<open>Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))\<close> \<open>invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n\<close> maxt_member
[PROOF STATE]
proof (prove)
using this:
max_in_set (set_vebt' (treeList ! the (vebt_pred summary (high x (deg div 2))))) maxy
Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n
\<lbrakk>invar_vebt ?t ?n; vebt_maxt ?t = Some ?maxi\<rbrakk> \<Longrightarrow> vebt_member ?t ?maxi

goal (1 subgoal):
 1. vebt_member (treeList ! the (vebt_pred summary (high x (deg div 2)))) maxy
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! the (vebt_pred summary (high x (deg div 2)))) maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
let ?res =  "Some (2^(deg div 2)) *\<^sub>o ?pr +\<^sub>o vebt_maxt (treeList ! the ?pr)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
obtain res where snd: "res = the ?res"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>res. res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res = 2^(deg div 2) * pr + maxy"
[PROOF STATE]
proof (prove)
using this:
res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. res = 2 ^ (deg div 2) * pr + maxy
[PROOF STEP]
by (metis \<open>Some maxy = vebt_maxt (treeList ! pr)\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> add_def option.sel mul_def option_shift.simps(3))
[PROOF STATE]
proof (state)
this:
res = 2 ^ (deg div 2) * pr + maxy

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "high res (deg div 2) = pr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high res (deg div 2) = pr
[PROOF STEP]
by (metis \<open>deg div 2 = n\<close> \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> \<open>invar_vebt (treeList ! the ?pr) n\<close> high_inv member_bound mult.commute scmem)
[PROOF STATE]
proof (state)
this:
high res (deg div 2) = pr

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res < x"
[PROOF STATE]
proof (prove)
using this:
high res (deg div 2) = pr

goal (1 subgoal):
 1. res < x
[PROOF STEP]
by (metis \<open>is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr\<close> div_le_mono high_def pred_member verit_comp_simplify1(3))
[PROOF STATE]
proof (state)
this:
res < x

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "both_member_options (treeList ! (high res (deg div 2))) (low res (deg div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))
[PROOF STEP]
by (metis \<open>deg div 2 = n\<close> \<open>high res (deg div 2) = pr\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> \<open>invar_vebt (treeList ! the (vebt_pred summary (high x (deg div 2)))) n\<close> both_member_options_equiv_member option.sel low_inv member_bound mult.commute scmem)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "both_member_options (Node (Some (mi, ma)) deg treeList summary) res"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) res
[PROOF STEP]
by (metis "5.hyps"(2) "5.hyps"(4) "5.hyps"(6) \<open>1 \<le> n\<close> \<open>both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))\<close> \<open>high res (deg div 2) = pr\<close> \<open>vebt_member summary pr\<close> both_member_options_from_chilf_to_complete_tree member_bound trans_le_add1)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "vebt_member (Node (Some (mi, ma)) deg treeList summary) res"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) res
[PROOF STEP]
using thisvalid valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) res
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) res
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res > mi"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) res

goal (1 subgoal):
 1. mi < res
[PROOF STEP]
by (metis "5.hyps"(11) \<open>both_member_options (treeList ! high res (deg div 2)) (low res (deg div 2))\<close> \<open>deg div 2 = n\<close> \<open>high res (deg div 2) = pr\<close> \<open>pr < 2 ^ m\<close> \<open>res < x\<close> \<open>x \<le> ma\<close> less_le_trans member_inv)
[PROOF STATE]
proof (state)
this:
mi < res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "res < ma"
[PROOF STATE]
proof (prove)
using this:
mi < res

goal (1 subgoal):
 1. res < ma
[PROOF STEP]
using \<open>res < x\<close> \<open>x \<le> ma\<close> less_le_trans
[PROOF STATE]
proof (prove)
using this:
mi < res
res < x
x \<le> ma
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. res < ma
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
res < ma

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
have "(vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x) \<Longrightarrow> z \<le> res" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<Longrightarrow> z \<le> res
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x \<Longrightarrow> z \<le> res
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
assume "vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x"
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence 20: "z = mi \<or> z = ma \<or> (high z (deg div 2) < length treeList
                                    \<and> vebt_member ( treeList ! (high z (deg div 2))) (low z (deg div 2)))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x

goal (1 subgoal):
 1. z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using
              vebt_member.simps(5)[of mi ma "deg-2" treeList summary z]
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
vebt_member (Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary) z = (if z = mi then True else if z = ma then True else if z < mi then False else if ma < z then False else let h = high z (Suc (Suc (deg - 2)) div 2); l = low z (Suc (Suc (deg - 2)) div 2) in if h < length treeList then vebt_member (treeList ! h) l else False)

goal (1 subgoal):
 1. z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using member_inv
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
vebt_member (Node (Some (mi, ma)) (Suc (Suc (deg - 2))) treeList summary) z = (if z = mi then True else if z = ma then True else if z < mi then False else if ma < z then False else let h = high z (Suc (Suc (deg - 2)) div 2); l = low z (Suc (Suc (deg - 2)) div 2) in if h < length treeList then vebt_member (treeList ! h) l else False)
vebt_member (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x \<Longrightarrow> 2 \<le> ?deg \<and> (?x = ?mi \<or> ?x = ?ma \<or> ?x < ?ma \<and> ?mi < ?x \<and> high ?x (?deg div 2) < length ?treeList \<and> vebt_member (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2)))

goal (1 subgoal):
 1. z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
have "z \<noteq> ma"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> ma
[PROOF STEP]
using \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> \<open>x \<le> ma\<close> leD
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
x \<le> ma
?y \<le> ?x \<Longrightarrow> \<not> ?x < ?y

goal (1 subgoal):
 1. z \<noteq> ma
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<noteq> ma

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence "mi \<noteq> ma"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> ma

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
by (metis \<open>mi < res\<close> \<open>res < x\<close> \<open>x \<le> ma\<close> leD less_trans)
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence "z < 2^deg"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. z < 2 ^ deg
[PROOF STEP]
using \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> member_bound thisvalid
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. z < 2 ^ deg
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z < 2 ^ deg

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence "(high z (deg div 2)) <2^m"
[PROOF STATE]
proof (prove)
using this:
z < 2 ^ deg

goal (1 subgoal):
 1. high z (deg div 2) < 2 ^ m
[PROOF STEP]
by (metis "5.hyps"(5) "5.hyps"(6) \<open>1 \<le> n\<close> \<open>deg div 2 = n\<close> exp_split_high_low(1) less_le_trans numeral_One zero_less_Suc zero_less_numeral)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
hence abc:"invar_vebt (treeList ! (high z (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < 2 ^ m

goal (1 subgoal):
 1. invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
by (simp add: "5.hyps"(1) "5.hyps"(4))
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. vebt_member (Node (Some (mi, ma)) deg treeList summary) z__ \<and> z__ < x \<Longrightarrow> z__ \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high z (deg div 2)) n
[PROOF STEP]
show "z \<le> res"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high z (deg div 2)) n

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
proof(cases "z = mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z = mi\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z = mi

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z = mi\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = mi

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
using \<open>mi < res\<close>
[PROOF STATE]
proof (prove)
using this:
z = mi
mi < res

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<le> res

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> mi

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence abe:"vebt_member( treeList ! (high z (deg div 2))) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using "20" \<open>z \<noteq> ma\<close>
[PROOF STATE]
proof (prove)
using this:
z \<noteq> mi
z = mi \<or> z = ma \<or> high z (deg div 2) < length treeList \<and> vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
z \<noteq> ma

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence abh:"vebt_member summary (high z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
using "5.hyps"(7) \<open>high z (deg div 2) < 2 ^ m\<close> \<open>length treeList = 2 ^ m \<and> invar_vebt summary m\<close> abc both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
\<forall>i<2 ^ m. Ex (both_member_options (treeList ! i)) = both_member_options summary i
high z (deg div 2) < 2 ^ m
length treeList = 2 ^ m \<and> invar_vebt summary m
invar_vebt (treeList ! high z (deg div 2)) n
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
have aaa:"(high z (deg div 2)) = (high x (deg div 2)) \<Longrightarrow> vebt_member (treeList ! ?h) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using abe
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
have "high z(deg div 2) > pr \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
assume "high z(deg div 2) > pr"
[PROOF STATE]
proof (state)
this:
pr < high z (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "vebt_member summary (high z(deg div 2))"
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2)

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
using abh
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2)
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. vebt_member summary (high z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member summary (high z (deg div 2))

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
have aaaa:"?h \<le> high z(deg div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high x (deg div 2) \<le> high z (deg div 2)
[PROOF STEP]
by (meson \<open>is_pred_in_set (set_vebt' summary) (high x (deg div 2)) pr\<close> \<open>pr < high z (deg div 2)\<close> abh leD not_le_imp_less pred_member)
[PROOF STATE]
proof (state)
this:
high x (deg div 2) \<le> high z (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
have bbbb:"?h \<ge> high z(deg div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high z (deg div 2) \<le> high x (deg div 2)
[PROOF STEP]
by (simp add: \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> div_le_mono dual_order.strict_implies_order high_def)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "?h = high z (deg div 2)"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)

goal (1 subgoal):
 1. high x (deg div 2) = high z (deg div 2)
[PROOF STEP]
using aaaa eq_iff
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> high x (deg div 2)
high x (deg div 2) \<le> high z (deg div 2)
(?a = ?b) = (?a \<le> ?b \<and> ?b \<le> ?a)

goal (1 subgoal):
 1. high x (deg div 2) = high z (deg div 2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high x (deg div 2) = high z (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "vebt_member (treeList ! ?h) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
high x (deg div 2) = high z (deg div 2)

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using aaa
[PROOF STATE]
proof (prove)
using this:
high x (deg div 2) = high z (deg div 2)
high z (deg div 2) = high x (deg div 2) \<Longrightarrow> vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
hence "(low z (deg div 2)) < ?l"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. low z (deg div 2) < low x (deg div 2)
[PROOF STEP]
by (metis \<open>high x (deg div 2) = high z (deg div 2)\<close> \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) z \<and> z < x\<close> add_le_cancel_left div_mult_mod_eq high_def less_le low_def)
[PROOF STATE]
proof (state)
this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. pr < high z (deg div 2) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low z (deg div 2) < low x (deg div 2)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)

goal (1 subgoal):
 1. False
[PROOF STEP]
using "33" \<open>vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))\<close>
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) < low x (deg div 2)
\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2)
vebt_member (treeList ! high x (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pr < high z (deg div 2) \<Longrightarrow> False

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "high z(deg div 2) \<le> pr"
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2) \<Longrightarrow> False

goal (1 subgoal):
 1. high z (deg div 2) \<le> pr
[PROOF STEP]
using not_less
[PROOF STATE]
proof (prove)
using this:
pr < high z (deg div 2) \<Longrightarrow> False
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. high z (deg div 2) \<le> pr
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<le> pr

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high z (deg div 2)) n; z \<noteq> mi\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) \<le> pr
[PROOF STEP]
show " z \<le> res"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<le> pr

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
proof(cases "high z(deg div 2) = pr")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high z (deg div 2) = pr

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "vebt_member (treeList ! (high z(deg div 2))) (low z (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = pr

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
using abe
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = pr
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (1 subgoal):
 1. vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
have "low z (deg div 2) \<le> maxy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low z (deg div 2) \<le> maxy
[PROOF STEP]
using True \<open>Some maxy = vebt_maxt (treeList ! pr)\<close> abc abe maxt_corr_help
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) = pr
Some maxy = vebt_maxt (treeList ! pr)
invar_vebt (treeList ! high z (deg div 2)) n
vebt_member (treeList ! high z (deg div 2)) (low z (deg div 2))
\<lbrakk>invar_vebt ?t ?n; vebt_maxt ?t = Some ?maxi; vebt_member ?t ?x\<rbrakk> \<Longrightarrow> ?x \<le> ?maxi

goal (1 subgoal):
 1. low z (deg div 2) \<le> maxy
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
low z (deg div 2) \<le> maxy

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "z \<le> res"
[PROOF STATE]
proof (prove)
using this:
low z (deg div 2) \<le> maxy

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by (metis True \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> add_le_cancel_left div_mult_mod_eq high_def low_def mult.commute)
[PROOF STATE]
proof (state)
this:
z \<le> res

goal (2 subgoals):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) = pr\<rbrakk> \<Longrightarrow> z \<le> res
 2. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<le> res
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<le> res

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z \<le> res

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high z (deg div 2) \<noteq> pr

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
hence "high z(deg div 2) < pr"
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) \<noteq> pr

goal (1 subgoal):
 1. high z (deg div 2) < pr
[PROOF STEP]
by (simp add: \<open>high z (deg div 2) \<le> pr\<close> less_le)
[PROOF STATE]
proof (state)
this:
high z (deg div 2) < pr

goal (1 subgoal):
 1. \<lbrakk>high z (deg div 2) \<le> pr; high z (deg div 2) \<noteq> pr\<rbrakk> \<Longrightarrow> z \<le> res
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high z (deg div 2) < pr
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high z (deg div 2) < pr

goal (1 subgoal):
 1. z \<le> res
[PROOF STEP]
by (metis \<open>high res (deg div 2) = pr\<close> div_le_mono high_def leD linear)
[PROOF STATE]
proof (state)
this:
z \<le> res

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> res

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<le> res

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<Longrightarrow> ?z \<le> res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
hence "is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res"
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<Longrightarrow> ?z \<le> res

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
[PROOF STEP]
using \<open>vebt_member (Node (Some (mi, ma)) deg treeList summary) res\<close> \<open>res < x\<close> pred_member
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some (mi, ma)) deg treeList summary) ?z \<and> ?z < x \<Longrightarrow> ?z \<le> res
vebt_member (Node (Some (mi, ma)) deg treeList summary) res
res < x
is_pred_in_set (set_vebt' ?t) ?x ?y = (vebt_member ?t ?y \<and> ?y < ?x \<and> (\<forall>z. vebt_member ?t z \<and> z < ?x \<longrightarrow> z \<le> ?y))

goal (1 subgoal):
 1. is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res

goal (1 subgoal):
 1. \<lbrakk>\<nexists>u. vebt_member (treeList ! high x (deg div 2)) u \<and> u < low x (deg div 2); vebt_pred summary (high x (deg div 2)) \<noteq> None\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
using fst snd
[PROOF STATE]
proof (prove)
using this:
is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x res
vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))
res = the (Some (2 ^ (deg div 2)) *\<^sub>o vebt_pred summary (high x (deg div 2)) +\<^sub>o vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2)))))

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis \<open>Some maxy = vebt_maxt (treeList ! the (vebt_pred summary (high x (deg div 2))))\<close> \<open>vebt_pred summary (high x (deg div 2)) = Some pr\<close> \<open>res = 2 ^ (deg div 2) * pr + maxy\<close> add_shift dual_order.eq_iff mul_shift pred_member)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal (1 subgoal):
 1. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> high x (deg div 2) < length treeList

goal (1 subgoal):
 1. \<lbrakk>x \<le> ma; \<not> high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> high x (deg div 2) < length treeList
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> high x (deg div 2) < length treeList

goal (1 subgoal):
 1. (vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px
[PROOF STEP]
by (metis "5.hyps"(10) "5.hyps"(4) "5.hyps"(5) "5.hyps"(6) \<open>1 \<le> n\<close> \<open>deg div 2 = n\<close> \<open>x \<le> ma\<close> exp_split_high_low(1) le_0_eq le_less_trans verit_comp_simplify1(3) zero_less_Suc zero_neq_one)
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(vebt_pred (Node (Some (mi, ma)) deg treeList summary) x = Some px) = is_pred_in_set (set_vebt' (Node (Some (mi, ma)) deg treeList summary)) x px

goal:
No subgoals!
[PROOF STEP]
qed