[STATEMENT]
theorem valid_pres_insert: "invar_vebt t n \<Longrightarrow> x< 2^n \<Longrightarrow> invar_vebt (vebt_insert t x) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; x < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert t x) n
[PROOF STEP]
proof(induction t n arbitrary: x rule: invar_vebt.induct)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>a b x. x < 2 ^ Suc 0 \<Longrightarrow> invar_vebt (vebt_insert (Leaf a b) x) (Suc 0)
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 5. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case (1 a b)
[PROOF STATE]
proof (state)
this:
x < 2 ^ Suc 0

goal (5 subgoals):
 1. \<And>a b x. x < 2 ^ Suc 0 \<Longrightarrow> invar_vebt (vebt_insert (Leaf a b) x) (Suc 0)
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 5. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ Suc 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ Suc 0

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Leaf a b) x) (Suc 0)
[PROOF STEP]
using vebt_insert.simps(1)[of a b x]
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ Suc 0
vebt_insert (Leaf a b) x = (if x = 0 then Leaf True b else if x = 1 then Leaf a True else Leaf a b)

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Leaf a b) x) (Suc 0)
[PROOF STEP]
by (simp add: invar_vebt.intros(1))
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Leaf a b) x) (Suc 0)

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[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<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
invar_vebt summary m
length treeList = 2 ^ m
m = n
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
x < 2 ^ deg

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence 0: " ( \<forall> t \<in> set treeList. invar_vebt t n) " and 1:" invar_vebt summary n" and 2:" length treeList = 2^n" and
    3:" deg = 2*n" and 4:" (\<nexists> i. both_member_options summary i)" and 5:" (\<forall> t \<in> set treeList. \<nexists> x. both_member_options t x) " and 6: "n\<ge> 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
invar_vebt summary m
length treeList = 2 ^ m
m = n
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
x < 2 ^ deg

goal (1 subgoal):
 1. (\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary n &&& length treeList = 2 ^ n) &&& (deg = 2 * n &&& \<nexists>i. both_member_options summary i) &&& \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x &&& 1 \<le> n
[PROOF STEP]
using "2.prems"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
invar_vebt summary m
length treeList = 2 ^ m
m = n
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
x < 2 ^ deg
x < 2 ^ deg

goal (1 subgoal):
 1. (\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary n &&& length treeList = 2 ^ n) &&& (deg = 2 * n &&& \<nexists>i. both_member_options summary i) &&& \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x &&& 1 \<le> n
[PROOF STEP]
by (auto simp add: Suc_leI deg_not_0)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary n
length treeList = 2 ^ n
deg = 2 * n
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
1 \<le> n

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let  ?t = "Node None deg treeList summary"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?tnew = "vebt_insert ?t x"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 6:"?tnew =  (Node (Some (x,x)) deg  treeList summary)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary
[PROOF STEP]
using vebt_insert.simps(4)[of "deg-2" treeList summary x]
[PROOF STATE]
proof (prove)
using this:
vebt_insert (Node None (Suc (Suc (deg - 2))) treeList summary) x = Node (Some (x, x)) (Suc (Suc (deg - 2))) treeList summary

goal (1 subgoal):
 1. vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary
[PROOF STEP]
by (metis "1" "2.hyps"(3) "2.hyps"(4) add_2_eq_Suc add_diff_inverse_nat add_self_div_2 deg_not_0 div_less gr_implies_not0)
[PROOF STATE]
proof (state)
this:
vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 7:"(x = x \<longrightarrow> (\<forall> t \<in> set treeList. \<nexists> x. both_member_options t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)
[PROOF STEP]
using \<open>\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x

goal (1 subgoal):
 1. x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 8:"x \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<le> x

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 9:" x < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ deg
[PROOF STEP]
by (simp add: "2.prems")
[PROOF STATE]
proof (state)
this:
x < 2 ^ deg

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 10:"(x \<noteq> x \<longrightarrow> (\<forall> i < 2^(2^n).  (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and>
                     (\<forall> y. (high y deg = i \<and> both_member_options (treeList ! i) (low y deg)  ) \<longrightarrow> x < y \<and> y \<le> x) ))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))

goal (4 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 4. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
[PROOF STEP]
using 0 1 2 3 4 5 6 7 8 9 10 invar_vebt.intros(4)[of treeList n summary m deg x x]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary n
length treeList = 2 ^ n
deg = 2 * n
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary
x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)
x \<le> x
x < 2 ^ deg
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
\<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; x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x); x \<le> x; x < 2 ^ deg; x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ m. (high x n = i \<longrightarrow> both_member_options (treeList ! i) (low x n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> x < x \<and> x \<le> x))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (x, x)) deg treeList summary) deg

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
[PROOF STEP]
by (metis "2.hyps"(3) "2.hyps"(4) nth_mem)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node None deg treeList summary) x) deg

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[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<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
invar_vebt summary m
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
x < 2 ^ deg

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence 0: " ( \<forall> t \<in> set treeList. invar_vebt t n) " and 1:" invar_vebt summary m" and 2:" length treeList = 2^m" and
    3:" deg = n+m" and 4:" (\<nexists> i. both_member_options summary i)" and 5:" (\<forall> t \<in> set treeList. \<nexists> x. both_member_options t x) " and 6: "n\<ge> 1"
    and 7: "Suc n = m"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
invar_vebt summary m
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
x < 2 ^ deg

goal (1 subgoal):
 1. ((\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary m) &&& length treeList = 2 ^ m &&& deg = n + m) &&& (\<nexists>i. both_member_options summary i &&& \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x) &&& 1 \<le> n &&& Suc n = m
[PROOF STEP]
using "3.prems"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
invar_vebt summary m
length treeList = 2 ^ m
m = Suc n
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
x < 2 ^ deg
x < 2 ^ deg

goal (1 subgoal):
 1. ((\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary m) &&& length treeList = 2 ^ m &&& deg = n + m) &&& (\<nexists>i. both_member_options summary i &&& \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x) &&& 1 \<le> n &&& Suc n = m
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); \<And>x. x < 2 * 2 ^ n \<Longrightarrow> invar_vebt (vebt_insert summary x) (Suc n); invar_vebt summary (Suc n); length treeList = 2 * 2 ^ n; m = Suc n; deg = Suc (n + n); \<forall>x. \<not> both_member_options summary x; \<forall>t\<in>set treeList. \<forall>x. \<not> both_member_options t x; x < 2 * 2 ^ (n + n)\<rbrakk> \<Longrightarrow> Suc 0 \<le> n
[PROOF STEP]
by (metis "3.hyps"(2) One_nat_def set_n_deg_not_0)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
1 \<le> n
Suc n = m

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let  ?t = "Node None deg treeList summary"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?tnew = "vebt_insert ?t x"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 6:"?tnew =  (Node (Some (x,x)) deg  treeList summary)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary
[PROOF STEP]
using vebt_insert.simps(4)[of "deg-2" treeList summary x]
[PROOF STATE]
proof (prove)
using this:
vebt_insert (Node None (Suc (Suc (deg - 2))) treeList summary) x = Node (Some (x, x)) (Suc (Suc (deg - 2))) treeList summary

goal (1 subgoal):
 1. vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary
[PROOF STEP]
by (smt "3" "3.hyps"(3) "6" Nat.add_diff_assoc One_nat_def Suc_le_mono add_diff_inverse_nat add_gr_0 add_numeral_left diff_is_0_eq' not_less not_less_iff_gr_or_eq numeral_2_eq_2 numerals(1) plus_1_eq_Suc semiring_norm(2))
[PROOF STATE]
proof (state)
this:
vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 7:"(x = x \<longrightarrow> (\<forall> t \<in> set treeList. \<nexists> x. both_member_options t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)
[PROOF STEP]
using \<open>\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x

goal (1 subgoal):
 1. x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 8:"x \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<le> x

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 9:" x < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ deg
[PROOF STEP]
by (simp add: "3.prems")
[PROOF STATE]
proof (state)
this:
x < 2 ^ deg

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 10:"(x \<noteq> x \<longrightarrow> (\<forall> i < 2^(2^n).  (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and>
                     (\<forall> y. (high y deg = i \<and> both_member_options (treeList ! i) (low y deg)  ) \<longrightarrow> x < y \<and> y \<le> x) ))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))

goal (3 subgoals):
 1. \<And>treeList n summary m deg x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) m; length treeList = 2 ^ m; m = Suc n; deg = n + m; \<nexists>i. both_member_options summary i; \<forall>t\<in>set treeList. \<nexists>x. both_member_options t x; x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 3. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
[PROOF STEP]
using 0 1 2 3 4 5 6 7 8 9 10 invar_vebt.intros(5)[of treeList n summary m deg x x]  "3.hyps"(3) nth_mem
[PROOF STATE]
proof (prove)
using this:
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<nexists>i. both_member_options summary i
\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x
vebt_insert (Node None deg treeList summary) x = Node (Some (x, x)) deg treeList summary
x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x)
x \<le> x
x < 2 ^ deg
x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ 2 ^ n. (high x deg = i \<longrightarrow> both_member_options (treeList ! i) (low x deg)) \<and> (\<forall>y. high y deg = i \<and> both_member_options (treeList ! i) (low y deg) \<longrightarrow> x < y \<and> y \<le> x))
\<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; x = x \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>x. both_member_options t x); x \<le> x; x < 2 ^ deg; x \<noteq> x \<longrightarrow> (\<forall>i<2 ^ m. (high x n = i \<longrightarrow> both_member_options (treeList ! i) (low x n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList ! i) (low x n) \<longrightarrow> x < x \<and> x \<le> x))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (x, x)) deg treeList summary) deg
m = Suc n
?n < length ?xs \<Longrightarrow> ?xs ! ?n \<in> set ?xs

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node None deg treeList summary) x) deg
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node None deg treeList summary) x) deg

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[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<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
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))
x < 2 ^ deg

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence myIHs: "x \<in> set treeList \<Longrightarrow> invar_vebt x n \<Longrightarrow> xa < 2 ^ n \<Longrightarrow> invar_vebt (vebt_insert x xa) n" for x xa
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
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))
xa__ < 2 ^ deg

goal (1 subgoal):
 1. \<lbrakk>x \<in> set treeList; invar_vebt x n; xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert x xa) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> set treeList; invar_vebt ?x n; ?xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert ?x ?xa) n

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence 0: "( \<forall> t \<in> set treeList. invar_vebt t n)" and 1: " invar_vebt summary m" and 2:"length treeList = 2^m" and 3:" deg = n+m" and
    4: "(\<forall> i < 2^m. (\<exists> y. both_member_options (treeList ! i) y) \<longleftrightarrow> ( both_member_options summary i))" and
    5: "(mi = ma \<longrightarrow> (\<forall> t \<in> set treeList. \<nexists> y. both_member_options t y))" and 6:"mi \<le> ma  \<and> ma < 2^deg" and
    7: "(mi \<noteq> ma \<longrightarrow> (\<forall> i < 2^m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (treeList ! i) (low y n)  ) \<longrightarrow> mi < y \<and> y \<le> ma)))"
    and 8: "n = m" and 9: "deg div 2 = n"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> set treeList; invar_vebt ?x n; ?xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert ?x ?xa) n

goal (1 subgoal):
 1. ((\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary m) &&& length treeList = 2 ^ m &&& deg = n + m &&& \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i) &&& (mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y) &&& mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)) &&& n = m &&& deg div 2 = n
[PROOF STEP]
using "4" add_self_div_2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> set treeList; invar_vebt ?x n; ?xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert ?x ?xa) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
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))
x < 2 ^ deg
(?m + ?m) div 2 = ?m

goal (1 subgoal):
 1. ((\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary m) &&& length treeList = 2 ^ m &&& deg = n + m &&& \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i) &&& (mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y) &&& mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)) &&& n = m &&& deg div 2 = n
[PROOF STEP]
by  blast+
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
n = m
deg div 2 = n

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
n = m
deg div 2 = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
n = m
deg div 2 = n

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
proof(cases "x = mi \<or> x = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; x = mi \<or> x = ma\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = mi \<or> x = ma

goal (2 subgoals):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; x = mi \<or> x = ma\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = mi \<or> x = ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = mi \<or> x = ma

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
using insert_simp_mima[of x mi ma deg treeList summary]
        invar_vebt.intros(4)[of treeList n summary m deg mi ma]
[PROOF STATE]
proof (prove)
using this:
x = mi \<or> x = ma
\<lbrakk>x = mi \<or> x = ma; 2 \<le> deg\<rbrakk> \<Longrightarrow> vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
\<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 (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
by (smt "0" "1" "2" "3" "4" "4.hyps"(3) "4.hyps"(7) "4.hyps"(8) "5" "7" "9" deg_not_0 div_greater_zero_iff)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (x = mi \<or> x = ma)

goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence mimaxrel: "x \<noteq> mi \<and> x \<noteq> ma"
[PROOF STATE]
proof (prove)
using this:
\<not> (x = mi \<or> x = ma)

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

goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> mi \<and> x \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> mi \<and> x \<noteq> ma

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
proof(cases "mi < x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi < x

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence abcdef: "mi < x"
[PROOF STATE]
proof (prove)
using this:
mi < x

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

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?h = "high x n" and ?l="low x n"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have highlowprop: "high x n < 2^m \<and> low x n < 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high x n < 2 ^ m \<and> low x n < 2 ^ n
[PROOF STEP]
using "1" "3" "4.hyps"(3) "4.prems" deg_not_0 exp_split_high_low(1) exp_split_high_low(2)
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
deg = n + m
m = n
x < 2 ^ deg
invar_vebt ?t ?n \<Longrightarrow> 0 < ?n
\<lbrakk>?x < 2 ^ (?n + ?m); 0 < ?n; 0 < ?m\<rbrakk> \<Longrightarrow> high ?x ?n < 2 ^ ?m
\<lbrakk>?x < 2 ^ (?n + ?m); 0 < ?n; 0 < ?m\<rbrakk> \<Longrightarrow> low ?x ?n < 2 ^ ?n

goal (1 subgoal):
 1. high x n < 2 ^ m \<and> low x n < 2 ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 10:"vebt_insert (Node (Some (mi,ma)) deg  treeList summary) x =
                 Node (Some (mi, max x ma)) deg  (treeList[?h:=vebt_insert (treeList ! ?h) ?l])
                               (if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, max x ma)) deg (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)
[PROOF STEP]
using "2" "3" False True \<open>high x n < 2 ^ m \<and> low x n < 2  ^ n\<close> insert_simp_norm
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
deg = n + m
\<not> (x = mi \<or> x = ma)
mi < x
high x n < 2 ^ m \<and> low x n < 2 ^ n
\<lbrakk>high ?x (?deg div 2) < length ?treeList; ?mi < ?x; 2 \<le> ?deg; ?x \<noteq> ?ma\<rbrakk> \<Longrightarrow> vebt_insert (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x = Node (Some (?mi, max ?x ?ma)) ?deg (?treeList[high ?x (?deg div 2) := vebt_insert (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2))]) (if minNull (?treeList ! high ?x (?deg div 2)) then vebt_insert ?summary (high ?x (?deg div 2)) else ?summary)

goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, max x ma)) deg (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)
[PROOF STEP]
by (metis "1" "4.hyps"(3) "9" deg_not_0 div_greater_zero_iff)
[PROOF STATE]
proof (state)
this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, max x ma)) deg (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?maxnew = "max x ma" and ?nextTreeList = "(take ?h treeList @ [vebt_insert (treeList ! ?h) ?l] @ drop (?h+1) treeList)" and
        ?nextSummary = "(if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 11: "( \<forall> t \<in> set ?nextTreeList. invar_vebt t n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). invar_vebt t n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
assume " t \<in> set ?nextTreeList"
[PROOF STATE]
proof (state)
this:
t \<in> set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList)

goal (1 subgoal):
 1. \<And>t. t \<in> set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
hence 111:"t \<in> set (take ?h treeList) \<or> t \<in> set ([vebt_insert (treeList ! ?h) ?l] @ drop (?h+1) treeList)"
[PROOF STATE]
proof (prove)
using this:
t \<in> set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList)

goal (1 subgoal):
 1. t \<in> set (take (high x n) treeList) \<or> t \<in> set ([vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<in> set (take (high x n) treeList) \<or> t \<in> set ([vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList)

goal (1 subgoal):
 1. \<And>t. t \<in> set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
show "invar_vebt t n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
proof(cases "t \<in> set (take ?h treeList) ")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<in> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
 2. t \<notin> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
t \<in> set (take (high x n) treeList)

goal (2 subgoals):
 1. t \<in> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
 2. t \<notin> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> set (take (high x n) treeList)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t \<in> set (take (high x n) treeList)

goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
by (meson "0" in_set_takeD)
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal (1 subgoal):
 1. t \<notin> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<notin> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
t \<notin> set (take (high x n) treeList)

goal (1 subgoal):
 1. t \<notin> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
hence 1110: "t = vebt_insert (treeList ! ?h) ?l \<or> t \<in> set ( drop (?h+1) treeList)"
[PROOF STATE]
proof (prove)
using this:
t \<notin> set (take (high x n) treeList)

goal (1 subgoal):
 1. t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList)
[PROOF STEP]
using "111"
[PROOF STATE]
proof (prove)
using this:
t \<notin> set (take (high x n) treeList)
t \<in> set (take (high x n) treeList) \<or> t \<in> set ([vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList)

goal (1 subgoal):
 1. t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList)

goal (1 subgoal):
 1. t \<notin> set (take (high x n) treeList) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList)

goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
proof(cases "t =  vebt_insert (treeList ! ?h) ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t = vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
 2. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t \<noteq> vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
t = vebt_insert (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t = vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
 2. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t \<noteq> vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
[PROOF STEP]
have 11110: "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x n) n
[PROOF STEP]
by (simp add: "2" "4.IH"(1) highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t = vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
 2. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t \<noteq> vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
[PROOF STEP]
have 11111: "?l < 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low x n < 2 ^ n
[PROOF STEP]
by (simp add: low_def)
[PROOF STATE]
proof (state)
this:
low x n < 2 ^ n

goal (2 subgoals):
 1. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t = vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
 2. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t \<noteq> vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low x n < 2 ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
low x n < 2 ^ n

goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
using myIHs[of "treeList ! ?h"]
[PROOF STATE]
proof (prove)
using this:
low x n < 2 ^ n
\<lbrakk>treeList ! high x n \<in> set treeList; invar_vebt (treeList ! high x n) n; ?xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (treeList ! high x n) ?xa) n

goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
by (simp add: "11110" "2" True highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal (1 subgoal):
 1. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t \<noteq> vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t \<noteq> vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
t \<noteq> vebt_insert (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. \<lbrakk>t = vebt_insert (treeList ! high x n) (low x n) \<or> t \<in> set (drop (high x n + 1) treeList); t \<noteq> vebt_insert (treeList ! high x n) (low x n)\<rbrakk> \<Longrightarrow> invar_vebt t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<noteq> vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t \<noteq> vebt_insert (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
by (metis "0" "1110" append_assoc append_take_drop_id in_set_conv_decomp)
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). invar_vebt t n

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 12: "invar_vebt ?nextSummary n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
proof(cases "minNull (treeList ! high x n)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
minNull (treeList ! high x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high x n)

goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
using "4.IH"(2) "8" highlowprop
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high x n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
n = m
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (treeList ! high x n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> minNull (treeList ! high x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (treeList ! high x n)

goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n
[PROOF STEP]
by (simp add: "1" "8")
[PROOF STATE]
proof (state)
this:
invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) n

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 13: "\<forall> i < 2^m. (\<exists> y. both_member_options (?nextTreeList ! i) y) \<longleftrightarrow> ( both_member_options ?nextSummary i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
show "i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options   ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
assume "i< 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
show "(\<exists>y. both_member_options ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof(cases "minNull (treeList ! high x n)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence tc: "minNull (treeList ! high x n)"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high x n)

goal (1 subgoal):
 1. minNull (treeList ! high x n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence nsprop: "?nextSummary = vebt_insert summary ?h"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high x n)

goal (1 subgoal):
 1. (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = vebt_insert summary (high x n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = vebt_insert summary (high x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have insprop:"?nextTreeList ! ?h = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
by (metis "2" Suc_eq_plus1 append_Cons highlowprop nth_list_update_eq self_append_conv2 upd_conv_take_nth_drop)
[PROOF STATE]
proof (state)
this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof(cases "i = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high x n

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 161:"\<nexists> y. vebt_member (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. vebt_member (treeList ! high x n) y
[PROOF STEP]
by (simp add: min_Null_member tc)
[PROOF STATE]
proof (state)
this:
\<nexists>y. vebt_member (treeList ! high x n) y

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence 162:"\<nexists> y. both_member_options (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. vebt_member (treeList ! high x n) y

goal (1 subgoal):
 1. \<nexists>y. both_member_options (treeList ! high x n) y
[PROOF STEP]
by (metis "2" "4.IH"(1) highlowprop nth_mem valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
\<nexists>y. both_member_options (treeList ! high x n) y

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence 163:"\<not> both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high x n) y

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
using "11" "2" "4" True \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high x n) y
\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). invar_vebt t n
length treeList = 2 ^ m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
i = high x n
i < 2 ^ m

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> both_member_options summary i

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 164:"?nextTreeList ! i = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
using True insprop
[PROOF STATE]
proof (prove)
using this:
i = high x n
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 165:"invar_vebt (vebt_insert (treeList ! ?h) ?l) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (vebt_insert (treeList ! high x n) (low x n)) n
[PROOF STEP]
by (simp add: "11")
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (treeList ! high x n) (low x n)) n

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 166:"both_member_options (vebt_insert (treeList ! ?h) ?l) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)
[PROOF STEP]
using myIHs[of "treeList ! ?h" ?l]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>treeList ! high x n \<in> set treeList; invar_vebt (treeList ! high x n) n; low x n < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (treeList ! high x n) (low x n)) n

goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)
[PROOF STEP]
by (metis "0" "2" highlowprop nth_mem valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 167:"\<exists> y. both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
using "164" "166"
[PROOF STATE]
proof (prove)
using this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! high x n) (low x n)
both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)

goal (1 subgoal):
 1. \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y

goal (2 subgoals):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
using "1" "11" "2" True nsprop valid_insert_both_member_options_add highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
invar_vebt summary m
\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). invar_vebt t n
length treeList = 2 ^ m
i = high x n
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = vebt_insert summary (high x n)
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?x) ?x
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have "?nextTreeList ! i = treeList ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i
[PROOF STEP]
by (metis "2" False \<open>i < 2 ^ m\<close> highlowprop nth_repl)
[PROOF STATE]
proof (state)
this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i

goal (1 subgoal):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have fstprop:"both_member_options ((?nextTreeList) ! i) y \<Longrightarrow> both_member_options (?nextSummary) i " for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
using "1" "4" \<open>(take (high x n) treeList @ [VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i\<close> \<open>i < 2 ^ m\<close> highlowprop valid_insert_both_member_options_pres
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i
i < 2 ^ m
high x n < 2 ^ m \<and> low x n < 2 ^ n
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n; ?y < 2 ^ ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?y) ?x

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have" both_member_options (?nextSummary) i \<Longrightarrow> \<exists> y . both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
assume  "both_member_options (?nextSummary) i "
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
have "i \<noteq> high x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high x n
[PROOF STEP]
by (simp add: False)
[PROOF STATE]
proof (state)
this:
i \<noteq> high x n

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
hence "both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> high x n

goal (1 subgoal):
 1. both_member_options summary i
[PROOF STEP]
by (smt (z3) "1" "12" \<open>both_member_options (if minNull (treeList ! high x n) then VEBT_Insert.vebt_insert summary (high x n) else summary) i\<close> \<open>i < 2 ^ m\<close> both_member_options_equiv_member highlowprop post_member_pre_member)
[PROOF STATE]
proof (state)
this:
both_member_options summary i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! i) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary i

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
by (simp add: "4" \<open>i < 2 ^ m\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
using \<open>(take (high x n) treeList @ [VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! i) y
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i

goal (1 subgoal):
 1. \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y

goal (1 subgoal):
 1. \<lbrakk>(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (treeList ! high x n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence "?nextSummary = summary"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (treeList ! high x n)

goal (1 subgoal):
 1. (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! high x n) y"
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! high x n) y
[PROOF STEP]
using not_min_Null_member False
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y
\<not> minNull (treeList ! high x n)

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

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence "both_member_options summary (high x n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high x n) y

goal (1 subgoal):
 1. both_member_options summary (high x n)
[PROOF STEP]
using "4" highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high x n) y
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. both_member_options summary (high x n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary (high x n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence " both_member_options (?nextTreeList ! high x n) ?l"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high x n)

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n) (low x n)
[PROOF STEP]
by (metis "0" "2" Suc_eq_plus1 append_Cons append_Nil highlowprop nth_list_update_eq nth_mem upd_conv_take_nth_drop valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n) (low x n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n) (low x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! high x n) (low x n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by (smt (verit, best) "2" "4" False \<open>both_member_options summary (high x n)\<close> \<open>i < 2 ^ m\<close> highlowprop nth_repl)
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (\<exists>y. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 14: "(mi = max ma x \<longrightarrow> (\<forall> t \<in> set ?nextTreeList. \<nexists> y. both_member_options t y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi = max ma x \<longrightarrow> (\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). \<nexists>y. both_member_options t y)
[PROOF STEP]
using True max_less_iff_conj
[PROOF STATE]
proof (prove)
using this:
mi < x
(max ?x ?y < ?z) = (?x < ?z \<and> ?y < ?z)

goal (1 subgoal):
 1. mi = max ma x \<longrightarrow> (\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). \<nexists>y. both_member_options t y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mi = max ma x \<longrightarrow> (\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). \<nexists>y. both_member_options t y)

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 15: "mi \<le> max ma x  \<and> max ma x < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi \<le> max ma x \<and> max ma x < 2 ^ deg
[PROOF STEP]
using "4.hyps"(8) "4.prems" abcdef
[PROOF STATE]
proof (prove)
using this:
ma < 2 ^ deg
x < 2 ^ deg
mi < x

goal (1 subgoal):
 1. mi \<le> max ma x \<and> max ma x < 2 ^ deg
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mi \<le> max ma x \<and> max ma x < 2 ^ deg

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 16:  "(mi \<noteq> max ma x \<longrightarrow> (\<forall> i < 2^m. (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> mi < y \<and> y \<le> max ma x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mi \<noteq> max ma x \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
assume "mi \<noteq> max ma x"
[PROOF STATE]
proof (state)
this:
mi \<noteq> max ma x

goal (1 subgoal):
 1. mi \<noteq> max ma x \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
show "(\<forall> i < 2^m. (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> mi < y \<and> y \<le> max ma x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
fix i::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
show "i < 2 ^ m\<longrightarrow>
         (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
         (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
assume "i < 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
show " (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
         (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. \<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show "(high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high (max ma x) n = i \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
assume "high (max ma x) n = i"
[PROOF STATE]
proof (state)
this:
high (max ma x) n = i

goal (1 subgoal):
 1. high (max ma x) n = i \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
show "both_member_options (?nextTreeList ! i) (low (max ma x) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
proof(cases "high x n = high ma n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high x n = high ma n

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
hence "?nextTreeList ! i = vebt_insert (treeList ! i) (low x n)"
[PROOF STATE]
proof (prove)
using this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m

goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
                      "2" True \<open>high (max ma x) n = i\<close> \<open>i < 2 ^ m\<close> concat_inth  length_take max_def
[PROOF STATE]
proof (prove)
using this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)
length treeList = 2 ^ m
high x n = high ma n
high (max ma x) n = i
i < 2 ^ m
(?xs @ [?x] @ ?ys) ! length ?xs = ?x
length (take ?n ?xs) = min (length ?xs) ?n
max ?a ?b = (if ?a \<le> ?b then ?b else ?a)

goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
by (metis Suc_eq_plus1 append_Cons append_Nil nth_list_update_eq upd_conv_take_nth_drop)
[PROOF STATE]
proof (state)
this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low x n)"
[PROOF STATE]
proof (prove)
using this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n)
[PROOF STEP]
using  Un_iff \<open>i < 2 ^ m\<close>
                      \<open>invar_vebt (treeList ! i) n\<close> both_member_options_equiv_member highlowprop
                      list.set_intros(1) set_append valid_insert_both_member_options_add
[PROOF STATE]
proof (prove)
using this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)
(?c \<in> ?A \<union> ?B) = (?c \<in> ?A \<or> ?c \<in> ?B)
i < 2 ^ m
invar_vebt (treeList ! i) n
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x
high x n < 2 ^ m \<and> low x n < 2 ^ n
?x21.0 \<in> set (?x21.0 # ?x22.0)
set (?xs @ ?ys) = set ?xs \<union> set ?ys
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?x) ?x

goal (1 subgoal):
 1. vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n)
[PROOF STEP]
by (metis "11" True \<open>high (max ma x) n = i\<close> max_def)
[PROOF STATE]
proof (state)
this:
vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n)

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n)

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
proof(cases "mi = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi = ma

goal (2 subgoals):
 1. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi = ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi = ma

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
by (metis \<open>(take (high x n) treeList @ [VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = VEBT_Insert.vebt_insert (treeList ! i) (low x n)\<close> \<open>mi \<noteq> max ma x\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop max_def valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
hence "vebt_member (treeList ! i) (low ma n)"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low ma n)
[PROOF STEP]
by (metis "7" True \<open>high (max ma x) n = i\<close> \<open>invar_vebt (treeList ! i) n\<close> both_member_options_equiv_member highlowprop linorder_cases max.absorb3 max.absorb4 mimaxrel)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low ma n) \<or> (low ma n = low x n)"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low ma n) \<or> low ma n = low x n
[PROOF STEP]
using post_member_pre_member[of " (treeList ! i)" n "low x n" "low  ma n" ]
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)
\<lbrakk>invar_vebt (treeList ! i) n; low x n < 2 ^ n; low ma n < 2 ^ n; vebt_member (vebt_insert (treeList ! i) (low x n)) (low ma n)\<rbrakk> \<Longrightarrow> vebt_member (treeList ! i) (low ma n) \<or> low x n = low ma n

goal (1 subgoal):
 1. vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low ma n) \<or> low ma n = low x n
[PROOF STEP]
by (metis "2" "4.IH"(1) \<open>(take (high x n) treeList @ [VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = VEBT_Insert.vebt_insert (treeList ! i) (low x n)\<close> \<open>i < 2 ^ m\<close> both_member_options_equiv_member highlowprop member_bound nth_mem valid_insert_both_member_options_pres)
[PROOF STATE]
proof (state)
this:
vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low ma n) \<or> low ma n = low x n

goal (1 subgoal):
 1. \<lbrakk>vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low ma n) \<or> low ma n = low x n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low ma n) \<or> low ma n = low x n

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
by (metis "2" "4.IH"(1) True \<open>(take (high x n) treeList @ [VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = VEBT_Insert.vebt_insert (treeList ! i) (low x n)\<close> \<open>high (max ma x) n = i\<close> both_member_options_equiv_member highlowprop max_def nth_mem valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal (1 subgoal):
 1. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high x n \<noteq> high ma n

goal (1 subgoal):
 1. high x n \<noteq> high ma n \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high x n \<noteq> high ma n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high x n \<noteq> high ma n

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
proof(cases "x < ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high x n \<noteq> high ma n; x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. \<lbrakk>high x n \<noteq> high ma n; \<not> x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < ma

goal (2 subgoals):
 1. \<lbrakk>high x n \<noteq> high ma n; x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
 2. \<lbrakk>high x n \<noteq> high ma n; \<not> x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < ma

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
by (metis "2" "7" False \<open>high (max ma x) n = i\<close> \<open>i < 2 ^ m\<close> abcdef highlowprop less_trans max.strict_order_iff nth_repl)
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal (1 subgoal):
 1. \<lbrakk>high x n \<noteq> high ma n; \<not> x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high x n \<noteq> high ma n; \<not> x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < ma

goal (1 subgoal):
 1. \<lbrakk>high x n \<noteq> high ma n; \<not> x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
hence "x > ma"
[PROOF STATE]
proof (prove)
using this:
\<not> x < ma

goal (1 subgoal):
 1. ma < x
[PROOF STEP]
using mimaxrel nat_neq_iff
[PROOF STATE]
proof (prove)
using this:
\<not> x < ma
x \<noteq> mi \<and> x \<noteq> ma
(?m \<noteq> ?n) = (?m < ?n \<or> ?n < ?m)

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

goal (1 subgoal):
 1. \<lbrakk>high x n \<noteq> high ma n; \<not> x < ma\<rbrakk> \<Longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ma < x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ma < x

goal (1 subgoal):
 1. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)
[PROOF STEP]
by (metis "2" "4.IH"(1) One_nat_def \<open>high (max ma x) n = i\<close> add.right_neutral add_Suc_right append_Cons highlowprop max.commute max.strict_order_iff nth_list_update_eq nth_mem self_append_conv2 upd_conv_take_nth_drop valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)

goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show "(\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show "high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
assume bb:"high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)"
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n)

goal (1 subgoal):
 1. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show " mi < y \<and> y \<le> max ma x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof(cases "i = high x n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high x n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence cc:" i = high x n"
[PROOF STATE]
proof (prove)
using this:
i = high x n

goal (1 subgoal):
 1. i = high x n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = high x n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence aa:"?nextTreeList ! i = vebt_insert (treeList ! i) (low x n)"
[PROOF STATE]
proof (prove)
using this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m

goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
[PROOF STATE]
proof (prove)
using this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
by (metis "2" Suc_eq_plus1 append_Cons append_self_conv2 cc highlowprop nth_list_update_eq upd_conv_take_nth_drop)
[PROOF STATE]
proof (state)
this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "invar_vebt (?nextTreeList ! i) n"
[PROOF STATE]
proof (prove)
using this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. invar_vebt ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) n
[PROOF STEP]
by (simp add: "11" True)
[PROOF STATE]
proof (state)
this:
invar_vebt ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n) \<or> (low y n) = (low x n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n) \<or> low y n = low x n
[PROOF STEP]
by (metis \<open>invar_vebt (treeList ! i) n\<close> aa bb highlowprop member_bound post_member_pre_member valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof(cases "low y n = low x n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low x n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "high x n = high y n \<and> low y n = low x n"
[PROOF STATE]
proof (prove)
using this:
low y n = low x n

goal (1 subgoal):
 1. high x n = high y n \<and> low y n = low x n
[PROOF STEP]
by (simp add: bb cc)
[PROOF STATE]
proof (state)
this:
high x n = high y n \<and> low y n = low x n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "x = y"
[PROOF STATE]
proof (prove)
using this:
high x n = high y n \<and> low y n = low x n

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (metis bit_split_inv)
[PROOF STATE]
proof (state)
this:
x = y

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = y

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using abcdef
[PROOF STATE]
proof (prove)
using this:
x = y
mi < x

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
using \<open>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n\<close>
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5 inthall
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
\<lbrakk>\<And>x. x \<in> set ?xs \<Longrightarrow> ?P x; ?n < length ?xs\<rbrakk> \<Longrightarrow> ?P (?xs ! ?n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
by (metis "2" \<open>i < 2 ^ m\<close> min_Null_member not_min_Null_member)
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using "7" \<open>i < 2 ^ m\<close> \<open>vebt_member (treeList ! i) (low y n)\<close> \<open>invar_vebt (treeList ! i) n\<close> bb both_member_options_equiv_member max.coboundedI1
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
i < 2 ^ m
vebt_member (treeList ! i) (low y n)
invar_vebt (treeList ! i) n
high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n)
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x
?c \<le> ?a \<Longrightarrow> ?c \<le> max ?a ?b

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high x n

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence aa:"?nextTreeList ! i = (treeList ! i)"
[PROOF STATE]
proof (prove)
using this:
length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m

goal (1 subgoal):
 1. (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i
[PROOF STEP]
by (metis "2" False \<open>i < 2 ^ m\<close> highlowprop nth_repl)
[PROOF STATE]
proof (state)
this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "both_member_options (treeList !i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
(take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i = treeList ! i
high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5 "2" \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
length treeList = 2 ^ m
i < 2 ^ m

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

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using 7
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using \<open>both_member_options (treeList ! i) (low y n)\<close> \<open>i < 2 ^ m\<close> bb max.coboundedI1
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
both_member_options (treeList ! i) (low y n)
i < 2 ^ m
high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n)
?c \<le> ?a \<Longrightarrow> ?c \<le> max ?a ?b

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
using invar_vebt.intros(4)[of ?nextTreeList  n ?nextSummary m deg mi "max ma x"]
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))
\<lbrakk>\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). invar_vebt t n; invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) m; length (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. (\<exists>x. both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) x) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i; mi = max ma x \<longrightarrow> (\<forall>t\<in>set (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList). \<nexists>x. both_member_options t x); mi \<le> max ma x; max ma x < 2 ^ deg; mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low (max ma x) n)) \<and> (\<forall>x. high x n = i \<and> both_member_options ((take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> max ma x))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (mi, max ma x)) deg (take (high x n) treeList @ [vebt_insert (treeList ! high x n) (low x n)] @ drop (high x n + 1) treeList) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)) deg

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
by (smt (z3) "10" "11" "12" "13" "15" "2" "3" "8" One_nat_def abcdef add.right_neutral add_Suc_right append_Cons highlowprop leD max.cobounded2 max.commute pos_n_replace self_append_conv2 upd_conv_take_nth_drop)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> mi < x

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence abcdef: "x < mi"
[PROOF STATE]
proof (prove)
using this:
\<not> mi < x

goal (1 subgoal):
 1. x < mi
[PROOF STEP]
using antisym_conv3 mimaxrel
[PROOF STATE]
proof (prove)
using this:
\<not> mi < x
\<not> ?y < ?x \<Longrightarrow> (\<not> ?x < ?y) = (?x = ?y)
x \<noteq> mi \<and> x \<noteq> ma

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

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?h = "high mi n" and ?l="low mi n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have highlowprop: "high mi n < 2^m \<and> low mi n < 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high mi n < 2 ^ m \<and> low mi n < 2 ^ n
[PROOF STEP]
using "1" "3" "4.hyps"(3) "4.hyps"(7) "4.hyps"(8) deg_not_0 exp_split_high_low(1) exp_split_high_low(2) le_less_trans
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
deg = n + m
m = n
mi \<le> ma
ma < 2 ^ deg
invar_vebt ?t ?n \<Longrightarrow> 0 < ?n
\<lbrakk>?x < 2 ^ (?n + ?m); 0 < ?n; 0 < ?m\<rbrakk> \<Longrightarrow> high ?x ?n < 2 ^ ?m
\<lbrakk>?x < 2 ^ (?n + ?m); 0 < ?n; 0 < ?m\<rbrakk> \<Longrightarrow> low ?x ?n < 2 ^ ?n
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. high mi n < 2 ^ m \<and> low mi n < 2 ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 10:"vebt_insert (Node (Some (mi,ma)) deg  treeList summary) x =
                 Node (Some (x, max mi ma)) deg  (treeList[?h:=vebt_insert (treeList ! ?h) ?l])
                               (if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (x, max mi ma)) deg (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary)
[PROOF STEP]
by (metis "1" "2" "4.hyps"(3) "9" abcdef deg_not_0 div_greater_zero_iff highlowprop insert_simp_excp mimaxrel)
[PROOF STATE]
proof (state)
this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (x, max mi ma)) deg (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary)

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?maxnew = "max mi ma" and ?nextTreeList = "(treeList[ ?h :=vebt_insert (treeList ! ?h) ?l])" and
        ?nextSummary = "(if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 11: "( \<forall> t \<in> set ?nextTreeList. invar_vebt t n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
assume " t \<in> set ?nextTreeList"
[PROOF STATE]
proof (state)
this:
t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)])

goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)])
[PROOF STEP]
obtain i where "?nextTreeList ! i = t \<and> i < 2^m"
[PROOF STATE]
proof (prove)
using this:
t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)])

goal (1 subgoal):
 1. (\<And>i. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = t \<and> i < 2 ^ m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis "2" in_set_conv_nth length_list_update)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = t \<and> i < 2 ^ m

goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
show "invar_vebt t n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
by (metis "2" "4.IH"(1) \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = t \<and> i < 2 ^ m\<close> highlowprop nth_list_update_eq nth_list_update_neq nth_mem)
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 12: "invar_vebt ?nextSummary n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) n
[PROOF STEP]
using "1" "4.IH"(2) "8" highlowprop
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
n = m
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
invar_vebt (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) n

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 13: "\<forall> i < 2^m. (\<exists> y. both_member_options (?nextTreeList ! i) y) \<longleftrightarrow> ( both_member_options ?nextSummary i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
show "i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options   ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
assume "i< 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
show "(\<exists>y. both_member_options ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof(cases "minNull (treeList ! high mi n)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence tc: "minNull (treeList ! high mi n)"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high mi n)

goal (1 subgoal):
 1. minNull (treeList ! high mi n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence nsprop: "?nextSummary = vebt_insert summary ?h"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high mi n)

goal (1 subgoal):
 1. (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = vebt_insert summary (high mi n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = vebt_insert summary (high mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have insprop:"?nextTreeList ! ?h = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
by (simp add: "2" highlowprop)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof(cases "i = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high mi n

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 161:"\<nexists> y. vebt_member (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. vebt_member (treeList ! high mi n) y
[PROOF STEP]
by (simp add: min_Null_member tc)
[PROOF STATE]
proof (state)
this:
\<nexists>y. vebt_member (treeList ! high mi n) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence 162:"\<nexists> y. both_member_options (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. vebt_member (treeList ! high mi n) y

goal (1 subgoal):
 1. \<nexists>y. both_member_options (treeList ! high mi n) y
[PROOF STEP]
by (metis "2" "4.IH"(1) highlowprop nth_mem valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
\<nexists>y. both_member_options (treeList ! high mi n) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence 163:"\<not> both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high mi n) y

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
using "11" "2" "4" True \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high mi n) y
\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n
length treeList = 2 ^ m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
i = high mi n
i < 2 ^ m

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> both_member_options summary i

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 164:"?nextTreeList ! i = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
using True insprop
[PROOF STATE]
proof (prove)
using this:
i = high mi n
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 165:"invar_vebt (vebt_insert (treeList ! ?h) ?l) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (vebt_insert (treeList ! high mi n) (low mi n)) n
[PROOF STEP]
by (simp add: "2" "4.IH"(1) highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (treeList ! high mi n) (low mi n)) n

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 166:"both_member_options (vebt_insert (treeList ! ?h) ?l) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)
[PROOF STEP]
using myIHs[of "treeList ! ?h" ?l]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>treeList ! high mi n \<in> set treeList; invar_vebt (treeList ! high mi n) n; low mi n < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (treeList ! high mi n) (low mi n)) n

goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)
[PROOF STEP]
by (metis "0" "2" highlowprop in_set_member inthall valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 167:"\<exists> y. both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
using "164" "166"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)
both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
using "1" "11" "2" True nsprop valid_insert_both_member_options_add highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
invar_vebt summary m
\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n
length treeList = 2 ^ m
i = high mi n
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = vebt_insert summary (high mi n)
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?x) ?x
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high mi n

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have "?nextTreeList ! i = treeList ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
i \<noteq> high mi n

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have fstprop:"both_member_options ((?nextTreeList) ! i) y \<Longrightarrow> both_member_options (?nextSummary) i " for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
using "1" "4" \<open>i < 2 ^ m\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i\<close> highlowprop valid_insert_both_member_options_pres
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
i < 2 ^ m
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
high mi n < 2 ^ m \<and> low mi n < 2 ^ n
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n; ?y < 2 ^ ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?y) ?x

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have" both_member_options (?nextSummary) i \<Longrightarrow> \<exists> y . both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
assume  "both_member_options (?nextSummary) i "
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
have "i \<noteq> high mi n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high mi n
[PROOF STEP]
by (simp add: False)
[PROOF STATE]
proof (state)
this:
i \<noteq> high mi n

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
hence "both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> high mi n

goal (1 subgoal):
 1. both_member_options summary i
[PROOF STEP]
by (smt (z3) "1" "12" \<open>both_member_options (if minNull (treeList ! high mi n) then VEBT_Insert.vebt_insert summary (high mi n) else summary) i\<close> \<open>i < 2 ^ m\<close> both_member_options_equiv_member highlowprop post_member_pre_member)
[PROOF STATE]
proof (state)
this:
both_member_options summary i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! i) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary i

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
by (simp add: "4" \<open>i < 2 ^ m\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
by (simp add: \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (treeList ! high mi n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence "?nextSummary = summary"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (treeList ! high mi n)

goal (1 subgoal):
 1. (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! high mi n) y"
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! high mi n) y
[PROOF STEP]
using not_min_Null_member False
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y
\<not> minNull (treeList ! high mi n)

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

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence "both_member_options summary (high mi n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high mi n) y

goal (1 subgoal):
 1. both_member_options summary (high mi n)
[PROOF STEP]
using "4" highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high mi n) y
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. both_member_options summary (high mi n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary (high mi n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence " both_member_options (?nextTreeList ! high mi n) ?l"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high mi n)

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)
[PROOF STEP]
by (metis "0" "2" highlowprop nth_list_update_eq nth_mem valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by (metis (full_types, opaque_lifting) "4" False \<open>both_member_options summary (high mi n)\<close> \<open>i < 2 ^ m\<close> nth_list_update_neq)
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 14: "(x = max ma mi \<longrightarrow> (\<forall> t \<in> set ?nextTreeList. \<nexists> y. both_member_options t y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>y. both_member_options t y)
[PROOF STEP]
using mimaxrel
[PROOF STATE]
proof (prove)
using this:
x \<noteq> mi \<and> x \<noteq> ma

goal (1 subgoal):
 1. x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>y. both_member_options t y)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>y. both_member_options t y)

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 15: "x \<le> max ma mi  \<and> max ma mi < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> max ma mi \<and> max ma mi < 2 ^ deg
[PROOF STEP]
using "6" abcdef
[PROOF STATE]
proof (prove)
using this:
mi \<le> ma \<and> ma < 2 ^ deg
x < mi

goal (1 subgoal):
 1. x \<le> max ma mi \<and> max ma mi < 2 ^ deg
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x \<le> max ma mi \<and> max ma mi < 2 ^ deg

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 16:  "(x \<noteq> max ma mi \<longrightarrow> (\<forall> i < 2^m. (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> x < y \<and> y \<le> max ma mi)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> max ma mi \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
assume "x \<noteq> max ma mi"
[PROOF STATE]
proof (state)
this:
x \<noteq> max ma mi

goal (1 subgoal):
 1. x \<noteq> max ma mi \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
show "(\<forall> i < 2^m. (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> x < y \<and> y \<le> max ma mi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
fix i::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
show "i < 2 ^ m\<longrightarrow>
         (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
         (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
assume "i < 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
show " (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
         (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show "(high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high (max ma mi) n = i \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
assume "high (max ma mi) n = i"
[PROOF STATE]
proof (state)
this:
high (max ma mi) n = i

goal (1 subgoal):
 1. high (max ma mi) n = i \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
show "both_member_options (?nextTreeList ! i) (low (max ma mi) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
proof(cases "high mi n = high ma n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high mi n = high ma n

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "?nextTreeList ! i = vebt_insert (treeList ! i) (low mi n)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
by (metis "2" True \<open>high (max ma mi) n = i\<close> highlowprop max_def nth_list_update_eq)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low mi n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (1 subgoal):
 1. vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)
[PROOF STEP]
by (metis "11" "2" True \<open>high (max ma mi) n = i\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop max_def set_update_memI valid_insert_both_member_options_add valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
proof(cases "mi = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi = ma

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi = ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi = ma

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
using \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low mi n)\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop valid_insert_both_member_options_add
[PROOF STATE]
proof (prove)
using this:
mi = ma
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
invar_vebt (treeList ! i) n
high mi n < 2 ^ m \<and> low mi n < 2 ^ n
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?x) ?x

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "vebt_member (treeList ! i) (low ma n)"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low ma n)
[PROOF STEP]
using "6" "7" \<open>high (max ma mi) n = i\<close> \<open>i < 2 ^ m\<close> \<open>invar_vebt (treeList ! i) n\<close> both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
high (max ma mi) n = i
i < 2 ^ m
invar_vebt (treeList ! i) n
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low ma n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low ma n) \<or> (low ma n = low mi n)"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n
[PROOF STEP]
using post_member_pre_member[of " (treeList ! i)" n "low mi n" "low  ma n" ]
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)
\<lbrakk>invar_vebt (treeList ! i) n; low mi n < 2 ^ n; low ma n < 2 ^ n; vebt_member (vebt_insert (treeList ! i) (low mi n)) (low ma n)\<rbrakk> \<Longrightarrow> vebt_member (treeList ! i) (low ma n) \<or> low mi n = low ma n

goal (1 subgoal):
 1. vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n
[PROOF STEP]
by (metis "11" "2" "7" True \<open>high (max ma mi) n = i\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low mi n)\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop max_def member_bound set_update_memI valid_insert_both_member_options_pres valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
by (metis "11" "2" "4.hyps"(7) "7" False True \<open>high (max ma mi) n = i\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low mi n)\<close> both_member_options_equiv_member highlowprop less_irrefl max.commute max_def set_update_memI)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high mi n \<noteq> high ma n

goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "?nextTreeList ! i = treeList ! i"
[PROOF STATE]
proof (prove)
using this:
high mi n \<noteq> high ma n

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
by (metis "4.hyps"(7) \<open>high (max ma mi) n = i\<close> max.commute max_def nth_list_update_neq)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
by (metis "4.hyps"(7) "7" False \<open>high (max ma mi) n = i\<close> \<open>i < 2 ^ m\<close> max.orderE)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show "(\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show "high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
assume bb:"high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)"
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n)

goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show " x < y \<and> y \<le> max ma mi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof(cases "i = high mi n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high mi n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence cc:" i = high mi n"
[PROOF STATE]
proof (prove)
using this:
i = high mi n

goal (1 subgoal):
 1. i = high mi n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = high mi n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence aa:"?nextTreeList ! i = vebt_insert (treeList ! i) (low mi n)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
by (simp add: cc highlowprop)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "invar_vebt (?nextTreeList ! i) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (1 subgoal):
 1. invar_vebt (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) n
[PROOF STEP]
by (simp add: "2" "4.IH"(1) cc highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n) \<or> (low y n) = (low mi n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n
[PROOF STEP]
by (metis \<open>invar_vebt (treeList ! i) n\<close> aa bb both_member_options_equiv_member highlowprop member_bound post_member_pre_member)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof(cases "low y n = low mi n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low mi n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "high mi n = high y n \<and> low y n = low mi n"
[PROOF STATE]
proof (prove)
using this:
low y n = low mi n

goal (1 subgoal):
 1. high mi n = high y n \<and> low y n = low mi n
[PROOF STEP]
by (simp add: bb cc)
[PROOF STATE]
proof (state)
this:
high mi n = high y n \<and> low y n = low mi n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "mi = y"
[PROOF STATE]
proof (prove)
using this:
high mi n = high y n \<and> low y n = low mi n

goal (1 subgoal):
 1. mi = y
[PROOF STEP]
by (metis bit_split_inv)
[PROOF STATE]
proof (state)
this:
mi = y

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi = y

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
using abcdef
[PROOF STATE]
proof (prove)
using this:
mi = y
x < mi

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low mi n

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low mi n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
using \<open>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n\<close>
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low mi n
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5 inthall
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
\<lbrakk>\<And>x. x \<in> set ?xs \<Longrightarrow> ?P x; ?n < length ?xs\<rbrakk> \<Longrightarrow> ?P (?xs ! ?n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
by (metis "2" \<open>i < 2 ^ m\<close> min_Null_member not_min_Null_member)
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
using "7"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
by (metis \<open>i < 2 ^ m\<close> \<open>vebt_member (treeList ! i) (low y n)\<close> \<open>invar_vebt (treeList ! i) n\<close> abcdef bb both_member_options_equiv_member max.absorb1 max.strict_order_iff max_less_iff_conj)
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high mi n

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence aa:"?nextTreeList ! i = (treeList ! i)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
i \<noteq> high mi n

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "both_member_options (treeList ! i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5  "2" \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
length treeList = 2 ^ m
i < 2 ^ m

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

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
using 7
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
by (metis \<open>both_member_options (treeList ! i) (low y n)\<close> \<open>i < 2 ^ m\<close> abcdef bb max.absorb1 max.strict_order_iff max_less_iff_conj)
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
using invar_vebt.intros(4)[of ?nextTreeList n ?nextSummary m deg x "max ma mi"]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))
\<lbrakk>\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n; invar_vebt (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) m; length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m; m = n; deg = n + m; \<forall>i<2 ^ m. (\<exists>x. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) x) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i; x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>x. both_member_options t x); x \<le> max ma mi; max ma mi < 2 ^ deg; x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low x n) \<longrightarrow> x < x \<and> x \<le> max ma mi))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (x, max ma mi)) deg (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary)) deg

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
by (smt (z3) "10" "11" "12" "13" "14" "15" "2" "3" "4.hyps"(3) "4.hyps"(7) length_list_update max.absorb1 max.absorb2)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[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<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
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))
x < 2 ^ deg

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence myIHs: "x \<in> set treeList \<Longrightarrow> invar_vebt x n \<Longrightarrow> xa < 2 ^ n \<Longrightarrow> invar_vebt (vebt_insert x xa) n" for x xa
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
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))
xa__ < 2 ^ deg

goal (1 subgoal):
 1. \<lbrakk>x \<in> set treeList; invar_vebt x n; xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert x xa) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> set treeList; invar_vebt ?x n; ?xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert ?x ?xa) n

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence 0: "( \<forall> t \<in> set treeList. invar_vebt t n)" and 1: " invar_vebt summary m" and 2:"length treeList = 2^m" and 3:" deg = n+m" and
    4: "(\<forall> i < 2^m. (\<exists> y. both_member_options (treeList ! i) y) \<longleftrightarrow> ( both_member_options summary i))" and
    5: "(mi = ma \<longrightarrow> (\<forall> t \<in> set treeList. \<nexists> y. both_member_options t y))" and 6:"mi \<le> ma  \<and> ma < 2^deg" and
    7: "(mi \<noteq> ma \<longrightarrow> (\<forall> i < 2^m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (treeList ! i) (low y n)  ) \<longrightarrow> mi < y \<and> y \<le> ma)))"
    and 8: "Suc n = m" and 9: "deg div 2 = n"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> set treeList; invar_vebt ?x n; ?xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert ?x ?xa) n

goal (1 subgoal):
 1. ((\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary m) &&& length treeList = 2 ^ m &&& deg = n + m &&& \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i) &&& (mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y) &&& mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)) &&& Suc n = m &&& deg div 2 = n
[PROOF STEP]
using "5" add_self_div_2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> set treeList; invar_vebt ?x n; ?xa < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert ?x ?xa) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n)
?x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary ?x) m
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))
x < 2 ^ deg
(?m + ?m) div 2 = ?m

goal (1 subgoal):
 1. ((\<forall>t\<in>set treeList. invar_vebt t n &&& invar_vebt summary m) &&& length treeList = 2 ^ m &&& deg = n + m &&& \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i) &&& (mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y) &&& mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)) &&& Suc n = m &&& deg div 2 = n
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg div 2 = n
[PROOF STEP]
by (simp add: "5.hyps"(3) "5.hyps"(4))
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
Suc n = m
deg div 2 = n

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x<2 ^ n. invar_vebt (vebt_insert t x) n); invar_vebt summary m; \<And>x. x < 2 ^ m \<Longrightarrow> invar_vebt (vebt_insert summary x) 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)); x < 2 ^ deg\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
Suc n = m
deg div 2 = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n
invar_vebt summary m
length treeList = 2 ^ m
deg = n + m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
Suc n = m
deg div 2 = n

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
proof(cases "x = mi \<or> x = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; x = mi \<or> x = ma\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = mi \<or> x = ma

goal (2 subgoals):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; x = mi \<or> x = ma\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = mi \<or> x = ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = mi \<or> x = ma

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
using insert_simp_mima[of x mi ma deg treeList summary]
        invar_vebt.intros(5)[of treeList n summary m deg mi ma]
[PROOF STATE]
proof (prove)
using this:
x = mi \<or> x = ma
\<lbrakk>x = mi \<or> x = ma; 2 \<le> deg\<rbrakk> \<Longrightarrow> vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
\<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 (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
by (smt "0" "1" "2" "3" "4" "5" "5.hyps"(3) "5.hyps"(7) "5.hyps"(8) "7" "9" div_less not_less not_one_le_zero set_n_deg_not_0)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (x = mi \<or> x = ma)

goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence mimaxrel: "x \<noteq> mi \<and> x \<noteq> ma"
[PROOF STATE]
proof (prove)
using this:
\<not> (x = mi \<or> x = ma)

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

goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; invar_vebt summary m; length treeList = 2 ^ m; deg = n + m; \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i; mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y); mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma)); Suc n = m; deg div 2 = n; \<not> (x = mi \<or> x = ma)\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> mi \<and> x \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> mi \<and> x \<noteq> ma

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
proof(cases "mi < x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi < x

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence abcdef: "mi < x"
[PROOF STATE]
proof (prove)
using this:
mi < x

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

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?h = "high x n" and ?l="low x n"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have highlowprop: "high x n < 2^m \<and> low x n < 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high x n < 2 ^ m \<and> low x n < 2 ^ n
[PROOF STEP]
by (metis "1" "2" "3" "5.IH"(1) "5.prems" Euclidean_Division.div_eq_0_iff add_nonneg_eq_0_iff deg_not_0 div_exp_eq exp_split_high_low(2) high_def not_one_le_zero one_add_one power_not_zero set_n_deg_not_0 zero_le_one zero_neq_one)
[PROOF STATE]
proof (state)
this:
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 10:"vebt_insert (Node (Some (mi,ma)) deg  treeList summary) x =
                 Node (Some (mi, max x ma)) deg  (treeList[?h :=vebt_insert (treeList ! ?h) ?l])
                               (if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, max x ma)) deg (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)
[PROOF STEP]
using "2" "3" False True \<open>high x n < 2 ^ m \<and> low x n < 2  ^ n\<close> insert_simp_norm
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
deg = n + m
\<not> (x = mi \<or> x = ma)
mi < x
high x n < 2 ^ m \<and> low x n < 2 ^ n
\<lbrakk>high ?x (?deg div 2) < length ?treeList; ?mi < ?x; 2 \<le> ?deg; ?x \<noteq> ?ma\<rbrakk> \<Longrightarrow> vebt_insert (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x = Node (Some (?mi, max ?x ?ma)) ?deg (?treeList[high ?x (?deg div 2) := vebt_insert (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2))]) (if minNull (?treeList ! high ?x (?deg div 2)) then vebt_insert ?summary (high ?x (?deg div 2)) else ?summary)

goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, max x ma)) deg (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)
[PROOF STEP]
by (smt "5.IH"(1) "9" div_greater_zero_iff div_if less_Suc_eq_0_disj not_one_le_zero set_n_deg_not_0)
[PROOF STATE]
proof (state)
this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, max x ma)) deg (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?maxnew = "max x ma" and ?nextTreeList = "(treeList[ ?h :=vebt_insert (treeList ! ?h) ?l])" and
        ?nextSummary = "(if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 11: "( \<forall> t \<in> set ?nextTreeList. invar_vebt t n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). invar_vebt t n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
assume " t \<in> set ?nextTreeList"
[PROOF STATE]
proof (state)
this:
t \<in> set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)])
[PROOF STEP]
obtain i where "i <2^m \<and> ?nextTreeList ! i = t"
[PROOF STATE]
proof (prove)
using this:
t \<in> set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. (\<And>i. i < 2 ^ m \<and> treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis "2" in_set_conv_nth length_list_update)
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<and> treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = t

goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
show "invar_vebt t n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
by (metis "2" "5.IH"(1) \<open>i < 2 ^ m \<and> treeList[high x n := VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] ! i = t\<close> highlowprop nth_list_update_eq nth_list_update_neq nth_mem)
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). invar_vebt t n

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 12: "invar_vebt ?nextSummary m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) m
[PROOF STEP]
by (simp add: "1" "5.IH"(2) highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) m

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 13: "\<forall> i < 2^m. (\<exists> y. both_member_options (?nextTreeList ! i) y) \<longleftrightarrow> ( both_member_options ?nextSummary i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
show "i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options   ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
assume "i< 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
show "(\<exists>y. both_member_options ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof(cases "minNull (treeList ! high x n)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence tc: "minNull (treeList ! high x n)"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high x n)

goal (1 subgoal):
 1. minNull (treeList ! high x n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence nsprop: "?nextSummary = vebt_insert summary ?h"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high x n)

goal (1 subgoal):
 1. (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = vebt_insert summary (high x n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = vebt_insert summary (high x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have insprop:"?nextTreeList ! ?h = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
by (simp add: "2" highlowprop)
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
proof(cases "i = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high x n

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 161:"\<nexists> y. vebt_member (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. vebt_member (treeList ! high x n) y
[PROOF STEP]
by (simp add: min_Null_member tc)
[PROOF STATE]
proof (state)
this:
\<nexists>y. vebt_member (treeList ! high x n) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence 162:"\<nexists> y. both_member_options (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. vebt_member (treeList ! high x n) y

goal (1 subgoal):
 1. \<nexists>y. both_member_options (treeList ! high x n) y
[PROOF STEP]
by (metis "0" "2" highlowprop nth_mem valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
\<nexists>y. both_member_options (treeList ! high x n) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence 163:"\<not> both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high x n) y

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
using "11" "2" "4" True \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high x n) y
\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). invar_vebt t n
length treeList = 2 ^ m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
i = high x n
i < 2 ^ m

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> both_member_options summary i

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 164:"?nextTreeList ! i = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
using True insprop
[PROOF STATE]
proof (prove)
using this:
i = high x n
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! high x n) (low x n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 165:"invar_vebt (vebt_insert (treeList ! ?h) ?l) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (vebt_insert (treeList ! high x n) (low x n)) n
[PROOF STEP]
by (simp add: "11" "2" highlowprop set_update_memI)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (treeList ! high x n) (low x n)) n

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 166:"both_member_options (vebt_insert (treeList ! ?h) ?l) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)
[PROOF STEP]
using myIHs[of "treeList ! ?h" ?l]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>treeList ! high x n \<in> set treeList; invar_vebt (treeList ! high x n) n; low x n < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (treeList ! high x n) (low x n)) n

goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)
[PROOF STEP]
by (metis "0" "2" highlowprop in_set_member inthall valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have 167:"\<exists> y. both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
using "164" "166"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! high x n) (low x n)
both_member_options (vebt_insert (treeList ! high x n) (low x n)) (low x n)

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i = high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
 2. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
using "1" "11" "2" True nsprop valid_insert_both_member_options_add highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
invar_vebt summary m
\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). invar_vebt t n
length treeList = 2 ^ m
i = high x n
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = vebt_insert summary (high x n)
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?x) ?x
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have "?nextTreeList ! i = treeList ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
i \<noteq> high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i

goal (1 subgoal):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have fstprop:"both_member_options ((?nextTreeList) ! i) y \<Longrightarrow> both_member_options (?nextSummary) i " for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
using "1" "4" \<open>i < 2 ^ m\<close> \<open>treeList[high x n := VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i\<close> highlowprop valid_insert_both_member_options_pres
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
i < 2 ^ m
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i
high x n < 2 ^ m \<and> low x n < 2 ^ n
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n; ?y < 2 ^ ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?y) ?x

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
have" both_member_options (?nextSummary) i \<Longrightarrow> \<exists> y . both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
assume  "both_member_options (?nextSummary) i "
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
have "i \<noteq> high x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high x n
[PROOF STEP]
by (simp add: False)
[PROOF STATE]
proof (state)
this:
i \<noteq> high x n

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
hence "both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> high x n

goal (1 subgoal):
 1. both_member_options summary i
[PROOF STEP]
by (smt "1" "12" \<open>both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i\<close> \<open>i < 2 ^ m\<close> both_member_options_equiv_member highlowprop post_member_pre_member)
[PROOF STATE]
proof (state)
this:
both_member_options summary i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! i) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary i

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
by (simp add: "4" \<open>i < 2 ^ m\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
by (simp add: \<open>treeList[high x n := VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y

goal (1 subgoal):
 1. \<lbrakk>treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n = vebt_insert (treeList ! high x n) (low x n); i \<noteq> high x n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (treeList ! high x n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence "?nextSummary = summary"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (treeList ! high x n)

goal (1 subgoal):
 1. (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! high x n) y"
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! high x n) y
[PROOF STEP]
using not_min_Null_member False
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) = summary
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y
\<not> minNull (treeList ! high x n)

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

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence "both_member_options summary (high x n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high x n) y

goal (1 subgoal):
 1. both_member_options summary (high x n)
[PROOF STEP]
using "4" highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high x n) y
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. both_member_options summary (high x n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary (high x n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
hence " both_member_options (?nextTreeList ! high x n) ?l"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high x n)

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n) (low x n)
[PROOF STEP]
by (metis "0" "2" highlowprop nth_list_update_eq nth_mem valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n) (low x n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high x n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n) (low x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! high x n) (low x n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i
[PROOF STEP]
by (metis (full_types) "4" False \<open>both_member_options summary (high x n)\<close> \<open>i < 2 ^ m\<close> nth_list_update_neq)
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) y) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 14: "(mi = max ma x \<longrightarrow> (\<forall> t \<in> set ?nextTreeList. \<nexists> y. both_member_options t y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi = max ma x \<longrightarrow> (\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). \<nexists>y. both_member_options t y)
[PROOF STEP]
using True max_less_iff_conj
[PROOF STATE]
proof (prove)
using this:
mi < x
(max ?x ?y < ?z) = (?x < ?z \<and> ?y < ?z)

goal (1 subgoal):
 1. mi = max ma x \<longrightarrow> (\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). \<nexists>y. both_member_options t y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mi = max ma x \<longrightarrow> (\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). \<nexists>y. both_member_options t y)

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 15: "mi \<le> max ma x  \<and> max ma x < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi \<le> max ma x \<and> max ma x < 2 ^ deg
[PROOF STEP]
using "5.hyps"(8) "5.prems" abcdef
[PROOF STATE]
proof (prove)
using this:
ma < 2 ^ deg
x < 2 ^ deg
mi < x

goal (1 subgoal):
 1. mi \<le> max ma x \<and> max ma x < 2 ^ deg
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mi \<le> max ma x \<and> max ma x < 2 ^ deg

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 16:  "(mi \<noteq> max ma x \<longrightarrow> (\<forall> i < 2^m. (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> mi < y \<and> y \<le> max ma x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mi \<noteq> max ma x \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
assume "mi \<noteq> max ma x"
[PROOF STATE]
proof (state)
this:
mi \<noteq> max ma x

goal (1 subgoal):
 1. mi \<noteq> max ma x \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
show "(\<forall> i < 2^m. (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> mi < y \<and> y \<le> max ma x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
fix i::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
show "i < 2 ^ m\<longrightarrow>
                (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
                (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
assume "i < 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
show " (high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n)) \<and>
                   (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. \<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show "(high (max ma x) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma x) n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high (max ma x) n = i \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
assume "high (max ma x) n = i"
[PROOF STATE]
proof (state)
this:
high (max ma x) n = i

goal (1 subgoal):
 1. high (max ma x) n = i \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
show "both_member_options (?nextTreeList ! i) (low (max ma x) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
proof(cases "high x n = high ma n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high x n = high ma n

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
hence "?nextTreeList ! i = vebt_insert (treeList ! i) (low x n)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
[PROOF STATE]
proof (prove)
using this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
by (metis "2" False True \<open>high (max ma x) n = i\<close> highlowprop linorder_neqE_nat max.commute max.strict_order_iff nth_list_update_eq)
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low x n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n)
[PROOF STEP]
by (metis "11" "2" True \<open>high (max ma x) n = i\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop max_def set_update_memI valid_insert_both_member_options_add valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n)

goal (2 subgoals):
 1. high x n = high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n)

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
proof(cases "mi = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi = ma

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
 2. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi = ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi = ma

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
by (metis \<open>treeList[high x n := VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low x n)\<close> \<open>invar_vebt (treeList ! i) n\<close> abcdef highlowprop max.commute max.strict_order_iff valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
hence "vebt_member (treeList ! i) (low ma n)"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low ma n)
[PROOF STEP]
by (metis "7" True \<open>high (max ma x) n = i\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop max_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low ma n) \<or> (low ma n = low x n)"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low ma n) \<or> low ma n = low x n
[PROOF STEP]
using post_member_pre_member[of " (treeList ! i)" n "low x n" "low  ma n" ]
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)
\<lbrakk>invar_vebt (treeList ! i) n; low x n < 2 ^ n; low ma n < 2 ^ n; vebt_member (vebt_insert (treeList ! i) (low x n)) (low ma n)\<rbrakk> \<Longrightarrow> vebt_member (treeList ! i) (low ma n) \<or> low x n = low ma n

goal (1 subgoal):
 1. vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low ma n) \<or> low ma n = low x n
[PROOF STEP]
by (metis "1" "11" "2" "3" "5.hyps"(8) "7" False True \<open>treeList[high x n := VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low x n)\<close> \<open>invar_vebt (treeList ! i) n\<close> deg_not_0 exp_split_high_low(2) highlowprop nth_list_update_neq set_update_memI valid_insert_both_member_options_pres valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low ma n) \<or> low ma n = low x n

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low ma n) \<or> low ma n = low x n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low ma n) \<or> low ma n = low x n

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
by (metis "11" "2" True \<open>high (max ma x) n = i\<close> \<open>treeList[high x n := VEBT_Insert.vebt_insert (treeList ! high x n) (low x n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low x n)\<close> \<open>invar_vebt (treeList ! i) n\<close> both_member_options_equiv_member highlowprop max_def set_update_memI valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)

goal (1 subgoal):
 1. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high x n \<noteq> high ma n

goal (1 subgoal):
 1. high x n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high x n \<noteq> high ma n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high x n \<noteq> high ma n

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)
[PROOF STEP]
by (metis "0" "2" "7" \<open>high (max ma x) n = i\<close> \<open>i < 2 ^ m\<close> \<open>mi \<noteq> max ma x\<close> highlowprop max_def nth_list_update_eq nth_list_update_neq nth_mem valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)

goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show "(\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show "high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
assume bb:"high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)"
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n)

goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
show " mi < y \<and> y \<le> max ma x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof(cases "i = high x n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high x n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence cc:" i = high x n"
[PROOF STATE]
proof (prove)
using this:
i = high x n

goal (1 subgoal):
 1. i = high x n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = high x n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence aa:"?nextTreeList ! i = vebt_insert (treeList ! i) (low x n)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
[PROOF STATE]
proof (prove)
using this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)
[PROOF STEP]
by (simp add: cc highlowprop)
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "invar_vebt (?nextTreeList ! i) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. invar_vebt (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) n
[PROOF STEP]
by (simp add: "2" "5.IH"(1) cc highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n) \<or> (low y n) = (low x n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n) \<or> low y n = low x n
[PROOF STEP]
by (metis \<open>high y n = i \<and> both_member_options ((treeList[?h:=vebt_insert (treeList ! high x n) (low x n)]) ! i) (low y n)\<close>
                          \<open>invar_vebt (treeList ! i) n\<close> aa highlowprop member_bound post_member_pre_member valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n

goal (2 subgoals):
 1. i = high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
proof(cases "low y n = low x n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low x n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "high x n = high y n \<and> low y n = low x n"
[PROOF STATE]
proof (prove)
using this:
low y n = low x n

goal (1 subgoal):
 1. high x n = high y n \<and> low y n = low x n
[PROOF STEP]
by (simp add: bb cc)
[PROOF STATE]
proof (state)
this:
high x n = high y n \<and> low y n = low x n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "x = y"
[PROOF STATE]
proof (prove)
using this:
high x n = high y n \<and> low y n = low x n

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (metis bit_split_inv)
[PROOF STATE]
proof (state)
this:
x = y

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n = low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = y

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using abcdef
[PROOF STATE]
proof (prove)
using this:
x = y
mi < x

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
using \<open>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n\<close>
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n
vebt_member (treeList ! i) (low y n) \<or> low y n = low x n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5 inthall
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
\<lbrakk>\<And>x. x \<in> set ?xs \<Longrightarrow> ?P x; ?n < length ?xs\<rbrakk> \<Longrightarrow> ?P (?xs ! ?n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
by (metis "2" \<open>i < 2 ^ m\<close> min_Null_member not_min_Null_member)
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low x n; low y n \<noteq> low x n\<rbrakk> \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using "7" \<open>i < 2 ^ m\<close> \<open>vebt_member (treeList ! i) (low y n)\<close> \<open>invar_vebt (treeList ! i) n\<close> bb both_member_options_equiv_member max.coboundedI1
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
i < 2 ^ m
vebt_member (treeList ! i) (low y n)
invar_vebt (treeList ! i) n
high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n)
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x
?c \<le> ?a \<Longrightarrow> ?c \<le> max ?a ?b

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high x n

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high x n < 2 ^ m \<and> low x n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence aa:"?nextTreeList ! i = (treeList ! i)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m
i \<noteq> high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "both_member_options (treeList ! i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i = treeList ! i
high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using "2" \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
length treeList = 2 ^ m
i < 2 ^ m

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

goal (1 subgoal):
 1. i \<noteq> high x n \<Longrightarrow> mi < y \<and> y \<le> max ma x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using 7
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
using \<open>both_member_options (treeList ! i) (low y n)\<close> \<open>i < 2 ^ m\<close> bb max.coboundedI1
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
both_member_options (treeList ! i) (low y n)
i < 2 ^ m
high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n)
?c \<le> ?a \<Longrightarrow> ?c \<le> max ?a ?b

goal (1 subgoal):
 1. mi < y \<and> y \<le> max ma x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))

goal (2 subgoals):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
 2. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
using invar_vebt.intros(5)[of ?nextTreeList  n ?nextSummary m deg mi "max ma x"]
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> max ma x))
\<lbrakk>\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). invar_vebt t n; invar_vebt (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) m; length (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. (\<exists>x. both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) x) = both_member_options (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary) i; mi = max ma x \<longrightarrow> (\<forall>t\<in>set (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]). \<nexists>x. both_member_options t x); mi \<le> max ma x; max ma x < 2 ^ deg; mi \<noteq> max ma x \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma x) n = i \<longrightarrow> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low (max ma x) n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)] ! i) (low x n) \<longrightarrow> mi < x \<and> x \<le> max ma x))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (mi, max ma x)) deg (treeList[high x n := vebt_insert (treeList ! high x n) (low x n)]) (if minNull (treeList ! high x n) then vebt_insert summary (high x n) else summary)) deg

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
by (smt (z3) "10" "11" "12" "13" "14" "15" "2" "3" "8" length_list_update max.commute)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> mi < x

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
hence abcdef: "x < mi"
[PROOF STATE]
proof (prove)
using this:
\<not> mi < x

goal (1 subgoal):
 1. x < mi
[PROOF STEP]
using antisym_conv3 mimaxrel
[PROOF STATE]
proof (prove)
using this:
\<not> mi < x
\<not> ?y < ?x \<Longrightarrow> (\<not> ?x < ?y) = (?x = ?y)
x \<noteq> mi \<and> x \<noteq> ma

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

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?h = "high mi n" and ?l="low mi n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have highlowprop: "high mi n < 2^m \<and> low mi n < 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high mi n < 2 ^ m \<and> low mi n < 2 ^ n
[PROOF STEP]
by (metis (full_types) "1" "2" "3" "5.IH"(1) "5.hyps"(7) "5.hyps"(8) deg_not_0 exp_split_high_low(1) exp_split_high_low(2) le_less_trans not_one_le_zero set_n_deg_not_0)
[PROOF STATE]
proof (state)
this:
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 10:"vebt_insert (Node (Some (mi,ma)) deg  treeList summary) x =
                 Node (Some (x, max mi ma)) deg  (treeList[ ?h :=vebt_insert (treeList ! ?h) ?l])
                               (if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (x, max mi ma)) deg (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary)
[PROOF STEP]
by (metis "0" "2" "9" abcdef div_less highlowprop insert_simp_excp mimaxrel not_less not_one_le_zero set_n_deg_not_0)
[PROOF STATE]
proof (state)
this:
vebt_insert (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (x, max mi ma)) deg (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary)

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
let ?maxnew = "max mi ma" and ?nextTreeList = "(treeList[ ?h:=vebt_insert (treeList ! ?h) ?l])" and
        ?nextSummary = "(if minNull (treeList ! ?h) then  vebt_insert summary ?h else summary)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 11: "( \<forall> t \<in> set ?nextTreeList. invar_vebt t n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
assume " t \<in> set ?nextTreeList"
[PROOF STATE]
proof (state)
this:
t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)])

goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)])
[PROOF STEP]
obtain i where "i < 2^m \<and> ?nextTreeList ! i = t"
[PROOF STATE]
proof (prove)
using this:
t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)])

goal (1 subgoal):
 1. (\<And>i. i < 2 ^ m \<and> treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis "2" in_set_conv_nth length_list_update)
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<and> treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = t

goal (1 subgoal):
 1. \<And>t. t \<in> set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) \<Longrightarrow> invar_vebt t n
[PROOF STEP]
thus "invar_vebt t n"
[PROOF STATE]
proof (prove)
using this:
i < 2 ^ m \<and> treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = t

goal (1 subgoal):
 1. invar_vebt t n
[PROOF STEP]
by (metis "2" "5.IH"(1) highlowprop nth_list_update_eq nth_list_update_neq nth_mem)
[PROOF STATE]
proof (state)
this:
invar_vebt t n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 12: "invar_vebt ?nextSummary m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) m
[PROOF STEP]
by (simp add: "1" "5.IH"(2) highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) m

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 13: "\<forall> i < 2^m. (\<exists> y. both_member_options (?nextTreeList ! i) y) \<longleftrightarrow> ( both_member_options ?nextSummary i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
show "i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options   ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
assume "i< 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
show "(\<exists>y. both_member_options ((?nextTreeList) ! i) y) = both_member_options (?nextSummary) i "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof(cases "minNull (treeList ! high mi n)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence tc: "minNull (treeList ! high mi n)"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high mi n)

goal (1 subgoal):
 1. minNull (treeList ! high mi n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
minNull (treeList ! high mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence nsprop: "?nextSummary = vebt_insert summary ?h"
[PROOF STATE]
proof (prove)
using this:
minNull (treeList ! high mi n)

goal (1 subgoal):
 1. (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = vebt_insert summary (high mi n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = vebt_insert summary (high mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have insprop:"?nextTreeList ! ?h = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
by (simp add: "2" highlowprop)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)

goal (2 subgoals):
 1. minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
proof(cases "i = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high mi n

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 161:"\<nexists> y. vebt_member (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. vebt_member (treeList ! high mi n) y
[PROOF STEP]
by (simp add: min_Null_member tc)
[PROOF STATE]
proof (state)
this:
\<nexists>y. vebt_member (treeList ! high mi n) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence 162:"\<nexists> y. both_member_options (treeList ! ?h) y"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. vebt_member (treeList ! high mi n) y

goal (1 subgoal):
 1. \<nexists>y. both_member_options (treeList ! high mi n) y
[PROOF STEP]
by (metis "0" "2" highlowprop nth_mem valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
\<nexists>y. both_member_options (treeList ! high mi n) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence 163:"\<not> both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high mi n) y

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
using "11" "2" "4" True \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
\<nexists>y. both_member_options (treeList ! high mi n) y
\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n
length treeList = 2 ^ m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
i = high mi n
i < 2 ^ m

goal (1 subgoal):
 1. \<not> both_member_options summary i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> both_member_options summary i

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 164:"?nextTreeList ! i = vebt_insert (treeList ! ?h) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
using True insprop
[PROOF STATE]
proof (prove)
using this:
i = high mi n
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n)

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 165:"invar_vebt (vebt_insert (treeList ! ?h) ?l) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (vebt_insert (treeList ! high mi n) (low mi n)) n
[PROOF STEP]
by (simp add: "11" "2" highlowprop set_update_memI)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (treeList ! high mi n) (low mi n)) n

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 166:"both_member_options (vebt_insert (treeList ! ?h) ?l) ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)
[PROOF STEP]
using myIHs[of "treeList ! ?h" ?l]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>treeList ! high mi n \<in> set treeList; invar_vebt (treeList ! high mi n) n; low mi n < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (treeList ! high mi n) (low mi n)) n

goal (1 subgoal):
 1. both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)
[PROOF STEP]
by (metis "0" "2" highlowprop in_set_member inthall valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have 167:"\<exists> y. both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
using "164" "166"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! high mi n) (low mi n)
both_member_options (vebt_insert (treeList ! high mi n) (low mi n)) (low mi n)

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i = high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
using "1" "11" "2" True nsprop valid_insert_both_member_options_add highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
invar_vebt summary m
\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n
length treeList = 2 ^ m
i = high mi n
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = vebt_insert summary (high mi n)
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?x) ?x
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high mi n

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have "?nextTreeList ! i = treeList ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
by (metis False nth_list_update_neq)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have fstprop:"both_member_options ((?nextTreeList) ! i) y \<Longrightarrow> both_member_options (?nextSummary) i " for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
using "1" "4" \<open>i < 2 ^ m\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i\<close> highlowprop valid_insert_both_member_options_pres
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
i < 2 ^ m
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
high mi n < 2 ^ m \<and> low mi n < 2 ^ n
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n; ?y < 2 ^ ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?y) ?x

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
have" both_member_options (?nextSummary) i \<Longrightarrow> \<exists> y . both_member_options ((?nextTreeList) ! i) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
assume  "both_member_options (?nextSummary) i "
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
have "i \<noteq> high mi n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high mi n
[PROOF STEP]
by (simp add: False)
[PROOF STATE]
proof (state)
this:
i \<noteq> high mi n

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
hence "both_member_options summary i"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> high mi n

goal (1 subgoal):
 1. both_member_options summary i
[PROOF STEP]
by (smt (z3) "1" "12" \<open>both_member_options (if minNull (treeList ! high mi n) then VEBT_Insert.vebt_insert summary (high mi n) else summary) i\<close> \<open>i < 2 ^ m\<close> both_member_options_equiv_member highlowprop post_member_pre_member)
[PROOF STATE]
proof (state)
this:
both_member_options summary i

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! i) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary i

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
by (simp add: "4" \<open>i < 2 ^ m\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. both_member_options (treeList ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! i) y

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
by (simp add: \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n = vebt_insert (treeList ! high mi n) (low mi n); i \<noteq> high mi n\<rbrakk> \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) ?y \<Longrightarrow> both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i \<Longrightarrow> \<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (treeList ! high mi n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence "?nextSummary = summary"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (treeList ! high mi n)

goal (1 subgoal):
 1. (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence "\<exists> y. both_member_options (treeList ! high mi n) y"
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary

goal (1 subgoal):
 1. \<exists>y. both_member_options (treeList ! high mi n) y
[PROOF STEP]
using not_min_Null_member False
[PROOF STATE]
proof (prove)
using this:
(if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) = summary
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y
\<not> minNull (treeList ! high mi n)

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

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence "both_member_options summary (high mi n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high mi n) y

goal (1 subgoal):
 1. both_member_options summary (high mi n)
[PROOF STEP]
using "4" highlowprop
[PROOF STATE]
proof (prove)
using this:
\<exists>y. both_member_options (treeList ! high mi n) y
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList ! i) y) = both_member_options summary i
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. both_member_options summary (high mi n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary (high mi n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
hence " both_member_options (?nextTreeList ! high mi n) ?l"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high mi n)

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)
[PROOF STEP]
by (metis "0" "2" highlowprop nth_list_update_eq nth_mem valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)

goal (1 subgoal):
 1. \<not> minNull (treeList ! high mi n) \<Longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! high mi n) (low mi n)

goal (1 subgoal):
 1. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i
[PROOF STEP]
by (metis (full_types) "4" False \<open>both_member_options summary (high mi n)\<close> \<open>i < 2 ^ m\<close> nth_list_update_neq)
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (\<exists>y. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) y) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 14: "(x = max ma mi \<longrightarrow> (\<forall> t \<in> set ?nextTreeList. \<nexists> y. both_member_options t y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>y. both_member_options t y)
[PROOF STEP]
using mimaxrel
[PROOF STATE]
proof (prove)
using this:
x \<noteq> mi \<and> x \<noteq> ma

goal (1 subgoal):
 1. x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>y. both_member_options t y)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>y. both_member_options t y)

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 15: "x \<le> max ma mi  \<and> max ma mi < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> max ma mi \<and> max ma mi < 2 ^ deg
[PROOF STEP]
using "6" abcdef
[PROOF STATE]
proof (prove)
using this:
mi \<le> ma \<and> ma < 2 ^ deg
x < mi

goal (1 subgoal):
 1. x \<le> max ma mi \<and> max ma mi < 2 ^ deg
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x \<le> max ma mi \<and> max ma mi < 2 ^ deg

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
have 16:  "(x \<noteq> max ma mi \<longrightarrow> (\<forall> i < 2^m. (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> x < y \<and> y \<le> max ma mi)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> max ma mi \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
assume "x \<noteq> max ma mi"
[PROOF STATE]
proof (state)
this:
x \<noteq> max ma mi

goal (1 subgoal):
 1. x \<noteq> max ma mi \<Longrightarrow> \<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
show "(\<forall> i < 2^m. (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
                                         (\<forall> y. (high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)  ) \<longrightarrow> x < y \<and> y \<le> max ma mi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
fix i::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
show "i < 2 ^ m\<longrightarrow>
                (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
                (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
assume "i < 2^m"
[PROOF STATE]
proof (state)
this:
i < 2 ^ m

goal (1 subgoal):
 1. i < 2 ^ m \<Longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
show " (high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n)) \<and>
                   (\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show "(high (max ma mi) n = i \<longrightarrow> both_member_options (?nextTreeList ! i) (low (max ma mi) n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high (max ma mi) n = i \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
assume "high (max ma mi) n = i"
[PROOF STATE]
proof (state)
this:
high (max ma mi) n = i

goal (1 subgoal):
 1. high (max ma mi) n = i \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
show "both_member_options (?nextTreeList ! i) (low (max ma mi) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
proof(cases "high mi n = high ma n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high mi n = high ma n

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "?nextTreeList ! i = vebt_insert (treeList ! i) (low mi n)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
by (metis "2" "5.hyps"(7) True \<open>high (max ma mi) n = i\<close> highlowprop max.orderE nth_list_update_eq)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low mi n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (1 subgoal):
 1. vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)
[PROOF STEP]
by (metis "11" "2" True \<open>high (max ma mi) n = i\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop max_def set_update_memI valid_insert_both_member_options_add valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)

goal (2 subgoals):
 1. high mi n = high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n)

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
proof(cases "mi = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi = ma

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi = ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi = ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi = ma

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
using \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low mi n)\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop valid_insert_both_member_options_add
[PROOF STATE]
proof (prove)
using this:
mi = ma
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
invar_vebt (treeList ! i) n
high mi n < 2 ^ m \<and> low mi n < 2 ^ n
\<lbrakk>invar_vebt ?t ?n; ?x < 2 ^ ?n\<rbrakk> \<Longrightarrow> both_member_options (vebt_insert ?t ?x) ?x

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "vebt_member (treeList ! i) (low ma n)"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low ma n)
[PROOF STEP]
using "6" "7" \<open>high (max ma mi) n = i\<close> \<open>i < 2 ^ m\<close> \<open>invar_vebt (treeList ! i) n\<close> both_member_options_equiv_member
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<le> ma \<and> 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>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))
high (max ma mi) n = i
i < 2 ^ m
invar_vebt (treeList ! i) n
invar_vebt ?t ?n \<Longrightarrow> both_member_options ?t ?x = vebt_member ?t ?x

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low ma n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "vebt_member (?nextTreeList ! i) (low ma n) \<or> (low ma n = low mi n)"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)

goal (1 subgoal):
 1. vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n
[PROOF STEP]
using post_member_pre_member[of " (treeList ! i)" n "low mi n" "low  ma n" ]
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low ma n)
\<lbrakk>invar_vebt (treeList ! i) n; low mi n < 2 ^ n; low ma n < 2 ^ n; vebt_member (vebt_insert (treeList ! i) (low mi n)) (low ma n)\<rbrakk> \<Longrightarrow> vebt_member (treeList ! i) (low ma n) \<or> low mi n = low ma n

goal (1 subgoal):
 1. vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n
[PROOF STEP]
by (metis "1" "11" "2" "3" "5.hyps"(8) "7" True \<open>high (max ma mi) n = i\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low mi n)\<close> \<open>invar_vebt (treeList ! i) n\<close> deg_not_0 exp_split_high_low(2) highlowprop max_def set_update_memI valid_insert_both_member_options_pres valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low mi n); mi \<noteq> ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low ma n) \<or> low ma n = low mi n

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
by (metis "5.hyps"(7) "7" False \<open>high (max ma mi) n = i\<close> \<open>i < 2 ^ m\<close> \<open>vebt_member (treeList ! i) (low ma n)\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = VEBT_Insert.vebt_insert (treeList ! i) (low mi n)\<close> \<open>invar_vebt (treeList ! i) n\<close> highlowprop max.absorb1 member_bound valid_insert_both_member_options_pres)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high mi n \<noteq> high ma n

goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "?nextTreeList ! i = treeList ! i"
[PROOF STATE]
proof (prove)
using this:
high mi n \<noteq> high ma n

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
by (metis "5.hyps"(7) \<open>high (max ma mi) n = i\<close> max.commute max_def nth_list_update_neq)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. high mi n \<noteq> high ma n \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
proof(cases "mi < ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
mi < ma

goal (2 subgoals):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
 2. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi < ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi < ma

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
by (metis "5.hyps"(7) "7" False \<open>high (max ma mi) n = i\<close> \<open>i < 2 ^ m\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i\<close> max.commute max_def)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> mi < ma

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "mi \<ge> ma "
[PROOF STATE]
proof (prove)
using this:
\<not> mi < ma

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

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "mi = ma"
[PROOF STATE]
proof (prove)
using this:
ma \<le> mi

goal (1 subgoal):
 1. mi = ma
[PROOF STEP]
by (simp add: "6" eq_iff)
[PROOF STATE]
proof (state)
this:
mi = ma

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
hence "\<not>both_member_options (treeList ! i) (low (max ma mi) n)"
[PROOF STATE]
proof (prove)
using this:
mi = ma

goal (1 subgoal):
 1. \<not> both_member_options (treeList ! i) (low (max ma mi) n)
[PROOF STEP]
using 5  "2" \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
mi = ma
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
length treeList = 2 ^ m
i < 2 ^ m

goal (1 subgoal):
 1. \<not> both_member_options (treeList ! i) (low (max ma mi) n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (treeList ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. \<lbrakk>treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i; \<not> mi < ma\<rbrakk> \<Longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> both_member_options (treeList ! i) (low (max ma mi) n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> both_member_options (treeList ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)
[PROOF STEP]
by (metis "11" "2" \<open>high (max ma mi) n = i\<close> \<open>mi = ma\<close> \<open>treeList[high mi n := VEBT_Insert.vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i\<close> highlowprop max.idem nth_list_update_eq set_update_memI valid_insert_both_member_options_add)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)

goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show "(\<forall>y. high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show "high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
assume bb:"high y n = i \<and> both_member_options (?nextTreeList ! i) (low y n)"
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n)

goal (1 subgoal):
 1. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
show " x < y \<and> y \<le> max ma mi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof(cases "i = high mi n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = high mi n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence cc:" i = high mi n"
[PROOF STATE]
proof (prove)
using this:
i = high mi n

goal (1 subgoal):
 1. i = high mi n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = high mi n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence aa:"?nextTreeList ! i = vebt_insert (treeList ! i) (low mi n)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
using concat_inth[of "take (high x n) treeList" "vebt_insert (treeList ! i) (low x n)" "drop (high x n + 1) treeList"]
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
(take (high x n) treeList @ [vebt_insert (treeList ! i) (low x n)] @ drop (high x n + 1) treeList) ! length (take (high x n) treeList) = vebt_insert (treeList ! i) (low x n)

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)
[PROOF STEP]
by (simp add: cc highlowprop)
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "invar_vebt (?nextTreeList ! i) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = vebt_insert (treeList ! i) (low mi n)

goal (1 subgoal):
 1. invar_vebt (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) n
[PROOF STEP]
by (simp add: "2" "5.IH"(1) \<open>i < 2 ^ m\<close> highlowprop)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n) \<or> (low y n) = (low mi n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n
[PROOF STEP]
by (metis \<open>invar_vebt (treeList ! i) n\<close> aa bb both_member_options_equiv_member highlowprop member_bound post_member_pre_member)
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n

goal (2 subgoals):
 1. i = high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
proof(cases "low y n = low mi n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low mi n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "high mi n = high y n \<and> low y n = low mi n"
[PROOF STATE]
proof (prove)
using this:
low y n = low mi n

goal (1 subgoal):
 1. high mi n = high y n \<and> low y n = low mi n
[PROOF STEP]
by (simp add: bb cc)
[PROOF STATE]
proof (state)
this:
high mi n = high y n \<and> low y n = low mi n

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "mi = y"
[PROOF STATE]
proof (prove)
using this:
high mi n = high y n \<and> low y n = low mi n

goal (1 subgoal):
 1. mi = y
[PROOF STEP]
by (metis bit_split_inv)
[PROOF STATE]
proof (state)
this:
mi = y

goal (2 subgoals):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n = low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
 2. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi = y

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
using abcdef
[PROOF STATE]
proof (prove)
using this:
mi = y
x < mi

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low mi n

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "vebt_member (treeList ! i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low mi n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
using \<open>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n\<close>
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low mi n
vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n

goal (1 subgoal):
 1. vebt_member (treeList ! i) (low y n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5 inthall
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
\<lbrakk>\<And>x. x \<in> set ?xs \<Longrightarrow> ?P x; ?n < length ?xs\<rbrakk> \<Longrightarrow> ?P (?xs ! ?n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
by (metis "2" \<open>i < 2 ^ m\<close> min_Null_member not_min_Null_member)
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. \<lbrakk>vebt_member (treeList ! i) (low y n) \<or> low y n = low mi n; low y n \<noteq> low mi n\<rbrakk> \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
using "7"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
by (metis \<open>i < 2 ^ m\<close> \<open>vebt_member (treeList ! i) (low y n)\<close> \<open>invar_vebt (treeList ! i) n\<close> abcdef bb both_member_options_equiv_member max.absorb1 max.strict_order_iff max_less_iff_conj)
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> high mi n

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "invar_vebt (treeList ! i ) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! i) n
[PROOF STEP]
by (metis "0" "2" \<open>i < 2 ^ m\<close> in_set_member inthall)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! i) n

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
have "length ?nextTreeList = 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
using "2" highlowprop
[PROOF STATE]
proof (prove)
using this:
length treeList = 2 ^ m
high mi n < 2 ^ m \<and> low mi n < 2 ^ n

goal (1 subgoal):
 1. length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence aa:"?nextTreeList ! i = (treeList ! i)"
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m
i \<noteq> high mi n

goal (1 subgoal):
 1. treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "both_member_options (treeList ! i) (low y n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i = treeList ! i
high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! i) (low y n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
hence "mi \<noteq> ma "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using 5 "2" \<open>i < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! i) (low y n)
mi = ma \<longrightarrow> (\<forall>t\<in>set treeList. \<nexists>y. both_member_options t y)
length treeList = 2 ^ m
i < 2 ^ m

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

goal (1 subgoal):
 1. i \<noteq> high mi n \<Longrightarrow> x < y \<and> y \<le> max ma mi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mi \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
using 7
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
mi \<noteq> ma \<longrightarrow> (\<forall>i<2 ^ m. (high ma n = i \<longrightarrow> both_member_options (treeList ! i) (low ma n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList ! i) (low y n) \<longrightarrow> mi < y \<and> y \<le> ma))

goal (1 subgoal):
 1. x < y \<and> y \<le> max ma mi
[PROOF STEP]
by (metis \<open>both_member_options (treeList ! i) (low y n)\<close> \<open>i < 2 ^ m\<close> abcdef bb max.absorb1 max.strict_order_iff max_less_iff_conj)
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i < 2 ^ m \<longrightarrow> (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> mi \<and> x \<noteq> ma; \<not> mi < x\<rbrakk> \<Longrightarrow> invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
using invar_vebt.intros(5)[of ?nextTreeList n ?nextSummary m deg x "max ma mi"]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>y. high y n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low y n) \<longrightarrow> x < y \<and> y \<le> max ma mi))
\<lbrakk>\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). invar_vebt t n; invar_vebt (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) m; length (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) = 2 ^ m; m = Suc n; deg = n + m; \<forall>i<2 ^ m. (\<exists>x. both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) x) = both_member_options (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary) i; x = max ma mi \<longrightarrow> (\<forall>t\<in>set (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]). \<nexists>x. both_member_options t x); x \<le> max ma mi; max ma mi < 2 ^ deg; x \<noteq> max ma mi \<longrightarrow> (\<forall>i<2 ^ m. (high (max ma mi) n = i \<longrightarrow> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low (max ma mi) n)) \<and> (\<forall>x. high x n = i \<and> both_member_options (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)] ! i) (low x n) \<longrightarrow> x < x \<and> x \<le> max ma mi))\<rbrakk> \<Longrightarrow> invar_vebt (Node (Some (x, max ma mi)) deg (treeList[high mi n := vebt_insert (treeList ! high mi n) (low mi n)]) (if minNull (treeList ! high mi n) then vebt_insert summary (high mi n) else summary)) deg

goal (1 subgoal):
 1. invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg
[PROOF STEP]
by (smt (z3) "10" "11" "12" "13" "14" "15" "2" "3" "5.hyps"(7) "8" length_list_update max.absorb2 max.orderE)
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invar_vebt (vebt_insert (Node (Some (mi, ma)) deg treeList summary) x) deg

goal:
No subgoals!
[PROOF STEP]
qed