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

goal (5 subgoals):
 1. \<And>a b x y. both_member_options (vebt_delete (Leaf a b) x) y = (x \<noteq> y \<and> both_member_options (Leaf a b) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 5. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(both_member_options (vebt_delete (Leaf a b) x) y) \<Longrightarrow> (x \<noteq> y \<and> both_member_options (Leaf a b) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (vebt_delete (Leaf a b) x) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Leaf a b) y
[PROOF STEP]
by (metis One_nat_def both_member_options_def vebt_buildup.cases vebt_delete.simps(1) vebt_delete.simps(2) vebt_delete.simps(3) membermima.simps(1) naive_member.simps(1))
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Leaf a b) x) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Leaf a b) y

goal (5 subgoals):
 1. \<And>a b x y. both_member_options (vebt_delete (Leaf a b) x) y = (x \<noteq> y \<and> both_member_options (Leaf a b) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 5. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Leaf a b) x) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Leaf a b) y

goal (5 subgoals):
 1. \<And>a b x y. both_member_options (vebt_delete (Leaf a b) x) y = (x \<noteq> y \<and> both_member_options (Leaf a b) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 5. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(x \<noteq> y \<and> both_member_options (Leaf a b) y) \<Longrightarrow>(both_member_options (vebt_delete (Leaf a b) x) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Leaf a b) y \<Longrightarrow> both_member_options (vebt_delete (Leaf a b) x) y
[PROOF STEP]
by (metis One_nat_def both_member_options_def vebt_buildup.cases vebt_delete.simps(1) vebt_delete.simps(2) vebt_delete.simps(3) membermima.simps(1) naive_member.simps(1))
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Leaf a b) y \<Longrightarrow> both_member_options (vebt_delete (Leaf a b) x) y

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

goal (1 subgoal):
 1. both_member_options (vebt_delete (Leaf a b) x) y = (x \<noteq> y \<and> both_member_options (Leaf a b) y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Leaf a b) x) y = (x \<noteq> y \<and> both_member_options (Leaf a b) y)

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

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

goal (1 subgoal):
 1. 2 \<le> deg
[PROOF STEP]
by (metis Suc_leI deg_not_0 dual_order.strict_trans2 less_add_same_cancel1 numerals(2))
[PROOF STATE]
proof (state)
this:
2 \<le> deg

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence " (vebt_delete (Node None deg treeList summary) x) = (Node None deg treeList summary)"
[PROOF STATE]
proof (prove)
using this:
2 \<le> deg

goal (1 subgoal):
 1. vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "\<not>vebt_member (Node None deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> vebt_member (Node None deg treeList summary) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<not>both_member_options (Node None deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
using invar_vebt.intros(2)[of treeList n summary m deg] 2
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y
\<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; 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\<rbrakk> \<Longrightarrow> invar_vebt (Node None deg treeList summary) deg
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
by (metis valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (Node None deg treeList summary) y

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (Node None deg treeList summary) y

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<not>both_member_options (vebt_delete (Node None deg treeList summary) x) y"
[PROOF STATE]
proof (prove)
using this:
\<not> both_member_options (Node None deg treeList summary) y

goal (1 subgoal):
 1. \<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y

goal (4 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 4. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary
\<not> vebt_member (Node None deg treeList summary) y
\<not> both_member_options (Node None deg treeList summary) y
\<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary
\<not> vebt_member (Node None deg treeList summary) y
\<not> both_member_options (Node None deg treeList summary) y
\<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)

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

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

goal (1 subgoal):
 1. 2 \<le> deg
[PROOF STEP]
by (metis One_nat_def add_mono le_add1 numeral_2_eq_2 plus_1_eq_Suc set_n_deg_not_0)
[PROOF STATE]
proof (state)
this:
2 \<le> deg

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence " (vebt_delete (Node None deg treeList summary) x) = (Node None deg treeList summary)"
[PROOF STATE]
proof (prove)
using this:
2 \<le> deg

goal (1 subgoal):
 1. vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "\<not>vebt_member (Node None deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> vebt_member (Node None deg treeList summary) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<not>both_member_options (Node None deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
using invar_vebt.intros(3)[of treeList n summary m deg] 3
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y
\<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n; 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\<rbrakk> \<Longrightarrow> invar_vebt (Node None deg treeList summary) deg
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
by (metis valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (Node None deg treeList summary) y

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (Node None deg treeList summary) y

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<not>both_member_options (vebt_delete (Node None deg treeList summary) x) y"
[PROOF STATE]
proof (prove)
using this:
\<not> both_member_options (Node None deg treeList summary) y

goal (1 subgoal):
 1. \<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y

goal (3 subgoals):
 1. \<And>treeList n summary m deg x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 3. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary
\<not> vebt_member (Node None deg treeList summary) y
\<not> both_member_options (Node None deg treeList summary) y
\<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node None deg treeList summary) x = Node None deg treeList summary
\<not> vebt_member (Node None deg treeList summary) y
\<not> both_member_options (Node None deg treeList summary) y
\<not> both_member_options (vebt_delete (Node None deg treeList summary) x) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node None deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node None deg treeList summary) y)

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case (4 treeList n summary m deg mi ma)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence tvalid: "invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

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

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

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "mi \<le> ma" and "deg div 2 = n" and "ma \<le> 2^deg"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. mi \<le> ma &&& deg div 2 = n &&& ma \<le> 2 ^ deg
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. mi \<le> ma &&& deg div 2 = n &&& ma \<le> 2 ^ deg
[PROOF STEP]
by  (auto simp add: "4.hyps"(3) "4.hyps"(4))
[PROOF STATE]
proof (state)
this:
mi \<le> ma
deg div 2 = n
ma \<le> 2 ^ deg

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence dp:"deg \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
mi \<le> ma
deg div 2 = n
ma \<le> 2 ^ deg

goal (1 subgoal):
 1. 2 \<le> deg
[PROOF STEP]
using "4.hyps"(1) "4.hyps"(3) deg_not_0 div_greater_zero_iff
[PROOF STATE]
proof (prove)
using this:
mi \<le> ma
deg div 2 = n
ma \<le> 2 ^ deg
invar_vebt summary m
m = n
invar_vebt ?t ?n \<Longrightarrow> 0 < ?n
(0 < ?m div ?n) = (?n \<le> ?m \<and> 0 < ?n)

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

goal (2 subgoals):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<le> deg
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
2 \<le> deg

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

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

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
using delt_out_of_range[of x mi ma deg treeList summary]  \<open>2 \<le> deg\<close>
[PROOF STATE]
proof (prove)
using this:
x < mi \<or> ma < x
\<lbrakk>x < mi \<or> ma < x; 2 \<le> deg\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
2 \<le> deg

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

goal (2 subgoals):
 1. \<lbrakk>2 \<le> deg; x < mi \<or> ma < x\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>2 \<le> deg; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by (metis "4.hyps"(7) True tvalid leD member_inv not_less_iff_gr_or_eq valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

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

goal (1 subgoal):
 1. \<lbrakk>2 \<le> deg; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "mi \<le> x \<and> x \<le> ma"
[PROOF STATE]
proof (prove)
using this:
\<not> (x < mi \<or> ma < x)

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

goal (1 subgoal):
 1. \<lbrakk>2 \<le> deg; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "x < 2^deg"
[PROOF STATE]
proof (prove)
using this:
mi \<le> x \<and> x \<le> ma

goal (1 subgoal):
 1. x < 2 ^ deg
[PROOF STEP]
using "4.hyps"(8) order.strict_trans1
[PROOF STATE]
proof (prove)
using this:
mi \<le> x \<and> x \<le> ma
ma < 2 ^ deg
\<lbrakk>?a \<le> ?b; ?b < ?c\<rbrakk> \<Longrightarrow> ?a < ?c

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

goal (1 subgoal):
 1. \<lbrakk>2 \<le> deg; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ deg
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ deg

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

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

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary
[PROOF STEP]
using del_single_cont[of x mi ma deg treeList summary] \<open>2 \<le> deg\<close>
[PROOF STATE]
proof (prove)
using this:
x = mi \<and> x = ma
\<lbrakk>x = mi \<and> x = ma; 2 \<le> deg\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary
2 \<le> deg

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

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary

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

goal (1 subgoal):
 1. invar_vebt (Node None deg treeList summary) deg
[PROOF STEP]
using "4"(4) "4.IH"(1) "4.hyps"(1) "4.hyps"(3) "4.hyps"(4) True mi_eq_ma_no_ch tvalid invar_vebt.intros(2)
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary
length treeList = 2 ^ m
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
invar_vebt summary m
m = n
deg = n + m
x = mi \<and> x = ma
\<lbrakk>invar_vebt (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?deg; ?mi = ?ma\<rbrakk> \<Longrightarrow> (\<forall>t\<in>set ?treeList. \<nexists>x. both_member_options t x) \<and> (\<nexists>x. both_member_options ?summary x)
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<lbrakk>\<forall>t\<in>set ?treeList. invar_vebt t ?n; 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\<rbrakk> \<Longrightarrow> invar_vebt (Node None ?deg ?treeList ?summary) ?deg

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

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (Node None deg treeList summary) deg

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

goal (1 subgoal):
 1. \<not> vebt_member (Node None deg treeList summary) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<not>both_member_options (Node None deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
using calculation(2) valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y
invar_vebt (Node None deg treeList summary) deg
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (Node None deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> both_member_options (Node None deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by (metis True calculation(1) member_inv not_less_iff_gr_or_eq tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

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

goal (1 subgoal):
 1. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence mimapr:"mi < ma"
[PROOF STATE]
proof (prove)
using this:
\<not> (x = mi \<and> x = ma)

goal (1 subgoal):
 1. mi < ma
[PROOF STEP]
by (metis "4.hyps"(7) \<open>mi \<le> x \<and> x \<le> ma\<close> le_antisym nat_less_le)
[PROOF STATE]
proof (state)
this:
mi < ma

goal (1 subgoal):
 1. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[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 (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
proof(cases "x \<noteq> mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<noteq> mi

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

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

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

goal (1 subgoal):
 1. high x n < length treeList
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
high x n < length treeList

goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newnode = "vebt_delete (treeList ! ?h) ?l"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newlist = "treeList[?h:= ?newnode]"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "length treeList = length ?newlist"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence hprolist: "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
by (meson \<open>high x n < length treeList\<close> nth_list_update_eq)
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have nothprolist: "i \<noteq> ?h \<and> i < 2^m \<Longrightarrow> ?newlist ! i = treeList ! i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i

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

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
proof(cases "minNull ?newnode")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (vebt_delete (treeList ! high x n) (low x n))

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?sn = "vebt_delete summary ?h"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma= "(if x  = ma then (let maxs = vebt_maxt ?sn in  (if maxs = None
                                                                         then mi
                                                                         else 2^(deg div 2) * the maxs
                                                                               + the (vebt_maxt (?newlist ! the maxs))
                                                                       )
                                                                   )
                                                              else ma)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (mi, ?newma))  deg ?newlist ?sn)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x =  ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
[PROOF STEP]
using del_x_not_mi_new_node_nil[of mi x ma deg ?h ?l ?newnode treeList ?sn summary ?newlist]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mi < x \<and> x \<le> ma; mi \<noteq> ma; 2 \<le> deg; high x (deg div 2) = high x n; low x (deg div 2) = low x n; vebt_delete (treeList ! high x n) (low x n) = vebt_delete (treeList ! high x n) (low x n); minNull (vebt_delete (treeList ! high x n) (low x n)); vebt_delete summary (high x n) = vebt_delete summary (high x n); treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] = treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
[PROOF STEP]
by (metis True \<open>2 \<le> deg\<close> \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>mi < ma\<close> \<open>mi \<le> x \<and> x \<le> ma\<close> \<open>x \<noteq> mi\<close> less_not_refl3 order.not_eq_order_implies_strict)
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options (?delsimp) y \<Longrightarrow> (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "both_member_options (?delsimp) y"
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = mi \<or> y = ?newma \<or>
                (both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
using both_member_options_from_complete_tree_to_child[of deg mi ?newma ?newlist ?sn y] dp
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
\<lbrakk>1 \<le> deg; both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<or> y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)
2 \<le> deg

goal (1 subgoal):
 1. y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D both_member_options_def membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (meson \<open>x \<noteq> mi\<close> both_member_options_equiv_member vebt_mint.simps(3) mint_member tvalid)
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "x =  ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = ma

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
let ?maxs = "vebt_maxt ?sn"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "?newma = (if ?maxs = None then mi
                                else 2 ^ (deg div 2) * the ?maxs +   the (vebt_maxt
                   ((treeList[(high x n):= vebt_delete (treeList !  (high  x n)) (low x n)]) !
                    the ?maxs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
x = ma

goal (1 subgoal):
 1. (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?maxs = None ")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high x n)) = None

goal (2 subgoals):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_maxt (vebt_delete summary (high x n)) = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high x n)) = None

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using \<open>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList [high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))\<close> \<open>y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList [high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)\<close> calculation(2)
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high x n)) = None
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None
[PROOF STEP]
obtain maxs where "Some maxs = ?maxs"
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None

goal (1 subgoal):
 1. (\<And>maxs. Some maxs = vebt_maxt (vebt_delete summary (high x n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Some maxs = vebt_maxt (vebt_delete summary (high x n))

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options ?sn maxs"
[PROOF STATE]
proof (prove)
using this:
Some maxs = vebt_maxt (vebt_delete summary (high x n))

goal (1 subgoal):
 1. both_member_options (vebt_delete summary (high x n)) maxs
[PROOF STEP]
by (simp add: maxbmo)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete summary (high x n)) maxs

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options summary maxs \<and> maxs \<noteq> ?h"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high x n)) maxs

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high x n
[PROOF STEP]
using "4.IH"(2)
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high x n)) maxs
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high x n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary maxs \<and> maxs \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! the ?maxs = treeList ! maxs"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary maxs \<and> maxs \<noteq> high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))) = treeList ! maxs
[PROOF STEP]
by (metis "4.hyps"(1) \<open>Some maxs = vebt_maxt (vebt_delete summary (high x n))\<close> option.sel member_bound nothprolist valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))) = treeList ! maxs

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "maxs < 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maxs < 2 ^ m
[PROOF STEP]
using "4.hyps"(1) \<open>both_member_options summary maxs \<and> maxs \<noteq> high x n\<close> member_bound valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
both_member_options summary maxs \<and> maxs \<noteq> high x n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "the (vebt_maxt  (?newlist ! the ?maxs)) = the (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
maxs < 2 ^ m

goal (1 subgoal):
 1. the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = the (vebt_maxt (treeList ! maxs))
[PROOF STEP]
by (simp add: \<open>treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))) = treeList ! maxs\<close>)
[PROOF STATE]
proof (state)
this:
the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = the (vebt_maxt (treeList ! maxs))

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "\<exists> z. both_member_options(treeList ! maxs) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. both_member_options (treeList ! maxs) z
[PROOF STEP]
by (simp add: "4.hyps"(5) \<open>both_member_options summary maxs \<and> maxs \<noteq> high x n\<close> \<open>maxs < 2 ^ m\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! maxs) z

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! maxs) z

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! maxs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
by (metis \<open>maxs < 2 ^ m\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n
[PROOF STEP]
obtain maxi where "Some maxi  = (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList ! maxs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis empty_Collect_eq maxt_corr_help_empty not_None_eq set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
by (metis \<open>invar_vebt (treeList ! maxs) n\<close> maxt_member member_bound)
[PROOF STATE]
proof (state)
this:
maxi < 2 ^ n

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! maxs) maxi"
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
using \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> maxbmo
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n
Some maxi = vebt_maxt (treeList ! maxs)
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "2 ^ (deg div 2) * the ?maxs +  the
                   (vebt_maxt (?newlist !  the ?maxs)) = 2^n * maxs + maxi "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi
[PROOF STEP]
by (metis \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> \<open>Some maxs = vebt_maxt (vebt_delete summary (high x n))\<close> \<open>deg div 2 = n\<close> \<open>the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = the (vebt_maxt (treeList ! maxs))\<close> option.sel)
[PROOF STATE]
proof (state)
this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y =  2^n * maxs + maxi"
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
using False True \<open>y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList [high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)\<close>
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None
x = ma
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "4.hyps"(2) Suc_1 \<open>both_member_options (treeList ! maxs) maxi\<close> \<open>deg div 2 = n\<close> \<open>maxi < 2 ^ n\<close> \<open>maxs < 2 ^ m\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp high_inv low_inv mult.commute plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by (metis \<open>both_member_options summary maxs \<and> maxs \<noteq> high x n\<close> \<open>maxi < 2 ^ n\<close> \<open>y = 2 ^ n * maxs + maxi\<close> high_inv mult.commute)
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

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

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma = ma"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> ma

goal (1 subgoal):
 1. (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
using False \<open>y = ?newma\<close>
[PROOF STATE]
proof (prove)
using this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma
x \<noteq> ma
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis False \<open>y =?newma\<close> both_member_options_equiv_member vebt_maxt.simps(3) maxt_member tvalid)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "(both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assm:"both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "(high  y (deg div 2)) = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y (deg div 2) = high x n

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options ?newnode (low y (deg div 2)) "
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high x n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
[PROOF STEP]
by (metis assm)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "invar_vebt (treeList ! (high y (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))

goal (1 subgoal):
 1. invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
by (metis "4.IH"(1) True \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y (deg div 2)) n

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
have "both_member_options (treeList ! ?h) (low y (deg div 2)) \<and> (low y (deg div 2)) \<noteq> (low x (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
invar_vebt (treeList ! high y (deg div 2)) n

goal (1 subgoal):
 1. both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)
[PROOF STEP]
by (metis "4.IH"(1) \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 True \<open>high x n < length treeList\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y (deg div 2) \<noteq> high x n

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) \<noteq> high x n

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
using \<open>deg div 2 = n\<close>
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) \<noteq> high x n
deg div 2 = n

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

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "(?newlist ! (high  y (deg div 2))) = treeList ! (high y (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using nothprolist
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using "4.hyps"(2) False \<open>length treeList = length ?newlist\<close> assm
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i
length treeList = 2 ^ m
high y (deg div 2) \<noteq> high x n
length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

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

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
using assm
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

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

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

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>length treeList = length ?newlist\<close> assm both_member_options_from_chilf_to_complete_tree dp numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have " (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y) \<Longrightarrow> both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
assume "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence aa:"x \<noteq> y" and bb:"y = mi \<or> y = ma \<or> (both_member_options (treeList ! (high y n)) (low y n) \<and> high y n < length treeList)"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y &&& y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> \<open>x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
x \<noteq> y
y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
show "both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "y = mi \<Longrightarrow>both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by (metis Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4))
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "y = ma \<Longrightarrow> both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
using aa maxbmo vebt_maxt.simps(3)
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x
vebt_maxt (Node (Some (?mi, ?ma)) ?ux ?uy ?uz) = Some ?ma

goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "both_member_options (treeList ! (high y n)) (low y n) \<Longrightarrow>both_member_options (?delsimp) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
assume assmy: "both_member_options (treeList ! (high y n)) (low y n)"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
show "both_member_options (?delsimp) y "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "?newlist ! (high y n) = ?newnode"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y n = high x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence 0:"invar_vebt (treeList !(high y n)) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high y n) n
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. invar_vebt (treeList ! high y n) n
[PROOF STEP]
by (metis True \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have 1:"low y n \<noteq> low x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low y n \<noteq> low x n
[PROOF STEP]
by (metis True aa bit_split_inv)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have 11:" (treeList !(high y n)) \<in> set treeList"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList ! high y n \<in> set treeList
[PROOF STEP]
by (metis True \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
treeList ! high y n \<in> set treeList

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
high y n = high x n
invar_vebt (treeList ! high y n) n
low y n \<noteq> low x n
treeList ! high y n \<in> set treeList
[PROOF STEP]
have "  (\<forall> xa. both_member_options ?newnode xa =
                         ((low x n) \<noteq> xa \<and> both_member_options (treeList ! ?h) xa))"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n
invar_vebt (treeList ! high y n) n
low y n \<noteq> low x n
treeList ! high y n \<in> set treeList

goal (1 subgoal):
 1. \<forall>xaa. both_member_options (vebt_delete (treeList ! high x n) (low x n)) xaa = (low x n \<noteq> xaa \<and> both_member_options (treeList ! high x n) xaa)
[PROOF STEP]
by (simp add: "4.IH"(1))
[PROOF STATE]
proof (state)
this:
\<forall>xaa. both_member_options (vebt_delete (treeList ! high x n) (low x n)) xaa = (low x n \<noteq> xaa \<and> both_member_options (treeList ! high x n) xaa)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "((low x n) \<noteq> xa \<and> both_member_options (treeList ! ?h) xa) \<Longrightarrow>  both_member_options ?newnode xa" for xa
[PROOF STATE]
proof (prove)
using this:
\<forall>xaa. both_member_options (vebt_delete (treeList ! high x n) (low x n)) xaa = (low x n \<noteq> xaa \<and> both_member_options (treeList ! high x n) xaa)

goal (1 subgoal):
 1. low x n \<noteq> xa \<and> both_member_options (treeList ! high x n) xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) xa
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "((low x n) \<noteq> (low y n) \<and> both_member_options (treeList ! ?h) (low y n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low x n \<noteq> low y n \<and> both_member_options (treeList ! high x n) (low y n)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n

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

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa
low x n \<noteq> low y n \<and> both_member_options (treeList ! high x n) (low y n)
[PROOF STEP]
have "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa
low x n \<noteq> low y n \<and> both_member_options (treeList ! high x n) (low y n)

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by (metis One_nat_def Suc_leD True \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>length treeList = length ?newlist\<close> both_member_options_from_chilf_to_complete_tree dp hprolist numerals(2))
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "both_member_options (?newlist !(high y n)) (low y n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> aa add_leD1 bb both_member_options_def both_member_options_from_chilf_to_complete_tree dp membermima.simps(4) plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence notemp:"\<exists> z. both_member_options ?newnode z"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))

goal (1 subgoal):
 1. \<exists>z. both_member_options (vebt_delete (treeList ! high x n) (low x n)) z
[PROOF STEP]
using not_min_Null_member
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y

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

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma = "(if x = ma then
                                                    ?h * 2^(deg div 2) + the( vebt_maxt (?newlist ! ?h))
                                                            else ma)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (mi, ?newma))  deg ?newlist summary)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
[PROOF STEP]
using del_x_not_mi_newnode_not_nil[of mi x ma deg ?h ?l ?newnode treeList ?newlist summary] False xmi mimapr
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mi < x \<and> x \<le> ma; mi \<noteq> ma; 2 \<le> deg; high x (deg div 2) = high x n; low x (deg div 2) = low x n; vebt_delete (treeList ! high x n) (low x n) = vebt_delete (treeList ! high x n) (low x n); \<not> minNull (vebt_delete (treeList ! high x n) (low x n)); treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] = treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))
x \<noteq> mi
mi < ma

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
[PROOF STEP]
using \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>mi \<le> x \<and> x \<le> ma\<close> dp nat_less_le plus_1_eq_Suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mi < x \<and> x \<le> ma; mi \<noteq> ma; 2 \<le> deg; high x (deg div 2) = high x n; low x (deg div 2) = low x n; vebt_delete (treeList ! high x n) (low x n) = vebt_delete (treeList ! high x n) (low x n); \<not> minNull (vebt_delete (treeList ! high x n) (low x n)); treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] = treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))
x \<noteq> mi
mi < ma
deg div 2 = n
high x n < length treeList
mi \<le> x \<and> x \<le> ma
2 \<le> deg
(?m < ?n) = (?m \<le> ?n \<and> ?m \<noteq> ?n)
(+) 1 = Suc

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options ?delsimp y
                      \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume ssms: "both_member_options ?delsimp y "
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aaaa: "y = mi \<or> y = ?newma \<or> (both_member_options (?newlist ! (high y n)) (low y n) \<and> high y n < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<and> high y n < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D \<open>deg div 2 = n\<close> both_member_options_def dp membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<and> high y n < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show " x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow>?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4) xmi)
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have " y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)

goal (1 subgoal):
 1. y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "x = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = ma

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma =?h * 2 ^ (deg div 2) +the(vebt_maxt(?newlist ! ?h))"
[PROOF STATE]
proof (prove)
using this:
x = ma

goal (1 subgoal):
 1. (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) = high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) = high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n))

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

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

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
obtain maxi where maxidef:"Some maxi = vebt_maxt(?newlist ! ?h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis False hprolist vebt_maxt.elims minNull.simps(1) minNull.simps(4))
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have aa:"invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x n) n
[PROOF STEP]
by (metis "4.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ab:"maxi \<noteq> ?l \<and> both_member_options ?newnode maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n

goal (1 subgoal):
 1. maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi
[PROOF STEP]
by (metis "4.IH"(1) \<open>high x n < length treeList\<close> hprolist inthall maxbmo maxidef member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high x n) n
maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi
[PROOF STEP]
have ac:"maxi \<noteq> ?l \<and> both_member_options (treeList ! ?h)  maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n
maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi

goal (1 subgoal):
 1. maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi
[PROOF STEP]
by (metis "4.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ad:"maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
using \<open>invar_vebt (treeList ! high x n) n\<close> member_bound valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi
invar_vebt (treeList ! high x n) n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
maxi < 2 ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 \<open>(if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) = high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n))\<close> \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)\<close> ac add_leD1 both_member_options_from_chilf_to_complete_tree dp option.sel high_inv low_inv maxidef plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

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

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> ma

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (simp add: \<open>y = ?newma\<close> maxbmo)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "both_member_options (?newlist ! (high y n)) (low y n) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assmy:"both_member_options (?newlist ! (high y n)) (low y n)"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = ?newnode"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y n = high x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x n) n
[PROOF STEP]
by (metis "4.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l \<and> both_member_options (treeList ! ?h ) (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n

goal (1 subgoal):
 1. low y n \<noteq> low x n \<and> both_member_options (treeList ! high x n) (low y n)
[PROOF STEP]
by (metis "4.IH"(1) True \<open>high x n < length treeList\<close> assmy hprolist inthall member_def)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n \<and> both_member_options (treeList ! high x n) (low y n)

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

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 True \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = treeList !(high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis False Suc_1 \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> aaaa add_leD1 both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) dp plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using aaaa
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = mi \<or> y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<and> high y n < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)\<Longrightarrow>
                                both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
assume assm: "x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence abcv:"y = mi \<or> y = ma \<or> ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
thus " both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by (metis Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4))
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
have " y = ma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
using assm maxbmo vebt_maxt.simps(3)
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x
vebt_maxt (Node (Some (?mi, ?ma)) ?ux ?uy ?uz) = Some ?ma

goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
have " both_member_options (treeList ! (high y n)) (low y n) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
assume myass: "both_member_options (treeList ! (high y n)) (low y n) "
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n

goal (1 subgoal):
 1. low y n \<noteq> low x n
[PROOF STEP]
by (metis assm bit_split_inv)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence pp:"?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high x n) n
[PROOF STEP]
by (metis "4.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)
[PROOF STEP]
by (metis "4.IH"(1) True \<open>high x n < length treeList\<close> \<open>low y n \<noteq> low x n\<close> in_set_member inthall myass)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD True \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>length treeList = length ?newlist\<close> both_member_options_from_chilf_to_complete_tree dp numerals(2) pp)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence pp:"?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
[PROOF STEP]
using nothprolist
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> \<open>length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])\<close> add_leD1 assm both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) member_inv myass plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by (metis Suc_1 Suc_leD \<open>deg div 2 = n\<close> assm both_member_options_from_complete_tree_to_child calculation(1) calculation(2) dp)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

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

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

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

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options summary (high ma n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options summary (high ma n)
[PROOF STEP]
by (metis "4"(10) "4"(11) "4"(7) "4.hyps"(4) Euclidean_Division.div_eq_0_iff Suc_leI Suc_le_D div_exp_eq dual_order.irrefl high_def mimapr nat.simps(3))
[PROOF STATE]
proof (state)
this:
both_member_options summary (high ma n)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "vebt_member summary (high ma n)"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high ma n)

goal (1 subgoal):
 1. vebt_member summary (high ma n)
[PROOF STEP]
using "4.hyps"(1) valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high ma n)
invar_vebt summary m
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
obtain summin where "Some summin = vebt_mint summary"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>summin. Some summin = vebt_mint summary \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis "4.hyps"(1) \<open>vebt_member summary (high ma n)\<close> empty_Collect_eq mint_corr_help_empty not_None_eq set_vebt'_def)
[PROOF STATE]
proof (state)
this:
Some summin = vebt_mint summary

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<exists> z . both_member_options (treeList ! summin) z"
[PROOF STATE]
proof (prove)
using this:
Some summin = vebt_mint summary

goal (1 subgoal):
 1. \<exists>z. both_member_options (treeList ! summin) z
[PROOF STEP]
by (metis "4.hyps"(1) "4.hyps"(5) both_member_options_equiv_member member_bound mint_member)
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! summin) z

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! summin) z

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "invar_vebt (treeList ! summin) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! summin) n
[PROOF STEP]
by (metis "4"(4) "4.IH"(1) "4.hyps"(1) \<open>Some summin = vebt_mint summary\<close> member_bound mint_member nth_mem)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! summin) n

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. both_member_options (treeList ! summin) z
invar_vebt (treeList ! summin) n
[PROOF STEP]
obtain lx where "Some lx = vebt_mint (treeList ! summin)"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. both_member_options (treeList ! summin) z
invar_vebt (treeList ! summin) n

goal (1 subgoal):
 1. (\<And>lx. Some lx = vebt_mint (treeList ! summin) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis empty_Collect_eq mint_corr_help_empty not_None_eq set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
Some lx = vebt_mint (treeList ! summin)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?xn = "summin*2^n + lx"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "?xn =  (if x = mi
                             then the (vebt_mint summary) * 2^(deg div 2)
                                      + the (vebt_mint (treeList ! the (vebt_mint summary)))
                             else x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)
[PROOF STEP]
by (metis False \<open>Some lx = vebt_mint (treeList ! summin)\<close> \<open>Some summin = vebt_mint summary\<close> \<open>deg div 2 = n\<close> option.sel)
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_member (treeList ! summin) lx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (treeList ! summin) lx
[PROOF STEP]
using \<open>Some lx = vebt_mint (treeList ! summin)\<close> \<open>invar_vebt (treeList ! summin) n\<close> mint_member
[PROOF STATE]
proof (prove)
using this:
Some lx = vebt_mint (treeList ! summin)
invar_vebt (treeList ! summin) n
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?maxi\<rbrakk> \<Longrightarrow> vebt_member ?t ?maxi

goal (1 subgoal):
 1. vebt_member (treeList ! summin) lx
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! summin) lx

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! summin) lx

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "summin < 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin < 2 ^ m
[PROOF STEP]
by (metis "4.hyps"(1) \<open>Some summin = vebt_mint summary\<close> member_bound mint_member)
[PROOF STATE]
proof (state)
this:
summin < 2 ^ m

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! summin) lx
summin < 2 ^ m
[PROOF STEP]
have xnin: "both_member_options (Node (Some (mi, ma)) deg treeList summary) ?xn"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! summin) lx
summin < 2 ^ m

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
[PROOF STEP]
by (metis "4.hyps"(2) Suc_1 \<open>deg div 2 = n\<close> \<open>invar_vebt (treeList ! summin) n\<close> add_leD1 both_member_options_equiv_member both_member_options_from_chilf_to_complete_tree dp high_inv low_inv member_bound plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?h ="high ?xn n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?l = "low ?xn n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "?xn < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx < 2 ^ deg
[PROOF STEP]
by (smt (verit, ccfv_SIG) "4.hyps"(1) "4.hyps"(4) Euclidean_Division.div_eq_0_iff \<open>Some lx = vebt_mint (treeList ! summin)\<close> \<open>Some summin = vebt_mint summary\<close> \<open>invar_vebt (treeList ! summin) n\<close> div_exp_eq high_def high_inv le_0_eq member_bound mint_member not_numeral_le_zero power_not_zero)
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx < 2 ^ deg

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "?h < length treeList"
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx < 2 ^ deg

goal (1 subgoal):
 1. high (summin * 2 ^ n + lx) n < length treeList
[PROOF STEP]
using "4.hyps"(2) "4.hyps"(3) "4.hyps"(4) \<open>invar_vebt (treeList ! summin) n\<close> deg_not_0 exp_split_high_low(1)
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx < 2 ^ deg
length treeList = 2 ^ m
m = n
deg = n + m
invar_vebt (treeList ! summin) n
invar_vebt ?t ?n \<Longrightarrow> 0 < ?n
\<lbrakk>?x < 2 ^ (?n + ?m); 0 < ?n; 0 < ?m\<rbrakk> \<Longrightarrow> high ?x ?n < 2 ^ ?m

goal (1 subgoal):
 1. high (summin * 2 ^ n + lx) n < length treeList
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
high (summin * 2 ^ n + lx) n < length treeList

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newnode = "vebt_delete (treeList ! ?h) ?l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newlist = "treeList[?h:= ?newnode]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "length treeList = length ?newlist"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence hprolist: "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by (meson \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> nth_list_update)
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have nothprolist: "i \<noteq> ?h \<and> i < 2^m \<Longrightarrow> ?newlist ! i = treeList ! i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high (summin * 2 ^ n + lx) n \<and> i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! i = treeList ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have firstsimp: "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x =(
                          let newnode = vebt_delete (treeList ! ?h) ?l;
                              newlist = (take ?h treeList @ [ newnode]@drop (?h+1) treeList)in
                             if minNull newnode
                             then(
                                let sn = vebt_delete summary ?h in
                               (Node (Some (?xn, if ?xn  = ma then (let maxs = vebt_maxt sn in
                                                                      (if maxs = None
                                                                         then ?xn
                                                                         else 2^(deg div 2) * the maxs
                                                                               + the (vebt_maxt (newlist ! the maxs))
                                                                       )
                                                                   )
                                                              else ma))
                                      deg newlist sn)
                             )else
                               (Node (Some (?xn, (if ?xn = ma then
                                                    ?h * 2^(deg div 2) + the( vebt_maxt (newlist ! ?h))
                                                            else ma)))
                                 deg newlist summary ))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = take (high (summin * 2 ^ n + lx) n) treeList @ [newnode] @ drop (high (summin * 2 ^ n + lx) n + 1) treeList in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)
[PROOF STEP]
using del_x_mi[of x mi ma deg ?xn ?h summary treeList ?l]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = mi \<and> x < ma; mi \<noteq> ma; 2 \<le> deg; high (summin * 2 ^ n + lx) (deg div 2) = high (summin * 2 ^ n + lx) n; summin * 2 ^ n + lx = the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))); low (summin * 2 ^ n + lx) (deg div 2) = low (summin * 2 ^ n + lx) n; high (summin * 2 ^ n + lx) (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = treeList[high (summin * 2 ^ n + lx) n := newnode] in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = take (high (summin * 2 ^ n + lx) n) treeList @ [newnode] @ drop (high (summin * 2 ^ n + lx) n + 1) treeList in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)
[PROOF STEP]
by (smt (z3) \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)\<close> \<open>x = mi\<close> add.commute append_Cons append_Nil dp mimapr nat_less_le plus_1_eq_Suc upd_conv_take_nth_drop)
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = take (high (summin * 2 ^ n + lx) n) treeList @ [newnode] @ drop (high (summin * 2 ^ n + lx) n + 1) treeList in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have minxnrel: "?xn \<noteq> mi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> mi
[PROOF STEP]
by (metis "4.hyps"(2) "4.hyps"(9) \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>vebt_member (treeList ! summin) lx\<close> \<open>invar_vebt (treeList ! summin) n\<close> both_member_options_equiv_member high_inv less_not_refl low_inv member_bound mimapr)
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx \<noteq> mi

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summin * 2 ^ n + lx \<noteq> mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx \<noteq> mi

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
proof(cases "minNull ?newnode")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?sn = "vebt_delete summary ?h"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma= "(if ?xn= ma then (let maxs = vebt_maxt ?sn in
                                                                      (if maxs = None
                                                                         then ?xn
                                                                         else 2^(deg div 2) * the maxs
                                                                               + the (vebt_maxt (?newlist ! the maxs))
                                                                       )
                                                                   )
                                                              else ma)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (?xn, ?newma))  deg ?newlist ?sn)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x =  ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
[PROOF STEP]
using del_x_mi_lets_in_minNull[of x mi ma deg ?xn ?h summary treeList ?l ?newnode ?newlist ?sn] False True \<open>deg div 2 = n\<close> \<open>?h < length treeList\<close> \<open>summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)\<close> dp less_not_refl3 mimapr
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = mi \<and> x < ma; mi \<noteq> ma; 2 \<le> deg; high (summin * 2 ^ n + lx) (deg div 2) = high (summin * 2 ^ n + lx) n; summin * 2 ^ n + lx = the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))); low (summin * 2 ^ n + lx) (deg div 2) = low (summin * 2 ^ n + lx) n; high (summin * 2 ^ n + lx) (deg div 2) < length treeList; vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n) = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)); vebt_delete summary (high (summin * 2 ^ n + lx) n) = vebt_delete summary (high (summin * 2 ^ n + lx) n)\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
\<not> x \<noteq> mi
minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))
deg div 2 = n
high (summin * 2 ^ n + lx) n < length treeList
summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)
2 \<le> deg
?s < ?t \<Longrightarrow> ?s \<noteq> ?t
mi < ma

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options (?delsimp) y \<Longrightarrow> (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "both_member_options (?delsimp) y"
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = ?xn \<or> y = ?newma \<or>
                (both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
using both_member_options_from_complete_tree_to_child[of deg mi ?newma ?newlist ?sn y] dp
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
\<lbrakk>1 \<le> deg; both_member_options (Node (Some (mi, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y\<rbrakk> \<Longrightarrow> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<or> y = mi \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)
2 \<le> deg

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D both_member_options_def membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?xn \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "4.hyps"(9) False \<open>vebt_member (treeList ! summin) lx\<close> \<open>summin < 2 ^ m\<close> \<open>invar_vebt (treeList ! summin) n\<close> both_member_options_equiv_member high_inv less_not_refl low_inv member_bound mimapr xnin)
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume asmt: "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?xn =  ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = ma

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
let ?maxs = "vebt_maxt ?sn"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have newmaext:"?newma = (if ?maxs = None then ?xn
                                else 2 ^ (deg div 2) * the ?maxs +   the (vebt_maxt
                  ( ?newlist ! the ?maxs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx = ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?maxs = None ")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aa:"?newma = ?xn"
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
[PROOF STEP]
using newmaext
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence bb: "?newma \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
[PROOF STEP]
using False minxnrel
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
\<not> x \<noteq> mi
summin * 2 ^ n + lx \<noteq> mi

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) ?xn"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
[PROOF STEP]
using xnin newmaext minxnrel asmt
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
summin * 2 ^ n + lx \<noteq> mi
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "?xn = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx = y
[PROOF STEP]
using aa asmt
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. summin * 2 ^ n + lx = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = y

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
summin * 2 ^ n + lx = y
[PROOF STEP]
have "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
summin * 2 ^ n + lx = y

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

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using \<open>summin * 2 ^ n + lx = y\<close> \<open>y = ?xn \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y\<close>
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
summin * 2 ^ n + lx = y
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None
[PROOF STEP]
obtain maxs where "Some maxs = ?maxs"
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None

goal (1 subgoal):
 1. (\<And>maxs. Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options ?sn maxs"
[PROOF STATE]
proof (prove)
using this:
Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs
[PROOF STEP]
by (simp add: maxbmo)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options summary maxs \<and> maxs \<noteq> ?h"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
[PROOF STEP]
using "4.IH"(2)
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! the ?maxs = treeList ! maxs"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) = treeList ! maxs
[PROOF STEP]
by (metis "4.hyps"(1) \<open>Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))\<close> option.sel member_bound nothprolist valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) = treeList ! maxs

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "maxs < 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maxs < 2 ^ m
[PROOF STEP]
using "4.hyps"(1) \<open>both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n\<close> member_bound valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "the (vebt_maxt  (?newlist ! the ?maxs)) = the (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
maxs < 2 ^ m

goal (1 subgoal):
 1. the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = the (vebt_maxt (treeList ! maxs))
[PROOF STEP]
using \<open>?newlist ! the (vebt_maxt ?sn) = treeList ! maxs\<close>
[PROOF STATE]
proof (prove)
using this:
maxs < 2 ^ m
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) = treeList ! maxs

goal (1 subgoal):
 1. the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = the (vebt_maxt (treeList ! maxs))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = the (vebt_maxt (treeList ! maxs))

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "\<exists> z. both_member_options(treeList ! maxs) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. both_member_options (treeList ! maxs) z
[PROOF STEP]
using "4.hyps"(5) \<open>both_member_options summary maxs \<and> maxs \<noteq>?h\<close> \<open>maxs < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>i<2 ^ m. (\<exists>x. both_member_options (treeList ! i) x) = both_member_options summary i
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
maxs < 2 ^ m

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

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! maxs) z

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! maxs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
by (metis \<open>maxs < 2 ^ m\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n
[PROOF STEP]
obtain maxi where "Some maxi  = (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList ! maxs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis empty_Collect_eq maxt_corr_help_empty not_None_eq set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
by (metis \<open>invar_vebt (treeList ! maxs) n\<close> maxt_member member_bound)
[PROOF STATE]
proof (state)
this:
maxi < 2 ^ n

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! maxs) maxi"
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
using \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> maxbmo
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n
Some maxi = vebt_maxt (treeList ! maxs)
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "2 ^ (deg div 2) * the ?maxs +  the
                   (vebt_maxt (?newlist !  the ?maxs)) = 2^n * maxs + maxi "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi
[PROOF STEP]
by (metis \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> \<open>Some maxs = vebt_maxt ?sn\<close> \<open>deg div 2 = n\<close> \<open>the (vebt_maxt (?newlist ! the (vebt_maxt ?sn))) = the (vebt_maxt (treeList ! maxs))\<close> option.sel)
[PROOF STATE]
proof (state)
this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma =  2^n * maxs + maxi"
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi
[PROOF STEP]
using False True
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None
summin * 2 ^ n + lx = ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y =   2^n * maxs + maxi"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
using asmt
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "4.hyps"(2) Suc_1 \<open>both_member_options (treeList ! maxs) maxi\<close> \<open>deg div 2 = n\<close> \<open>maxi < 2 ^ n\<close> \<open>maxs < 2 ^ m\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp high_inv low_inv mult.commute plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by (metis "4.hyps"(9) True \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> \<open>maxi < 2 ^ n\<close> \<open>maxs < 2 ^ m\<close> \<open>x = mi\<close> \<open>y = 2 ^ n * maxs + maxi\<close> high_inv less_not_refl low_inv maxbmo minxnrel mult.commute)
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma = ma"
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "mi \<noteq> ma"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using mimapr
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma
mi < ma

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

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
using False \<open>y = ?newma\<close> \<open>x = mi\<close>
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
summin * 2 ^ n + lx \<noteq> ma
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)
x = mi

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis False \<open>y =?newma\<close> both_member_options_equiv_member vebt_maxt.simps(3) maxt_member tvalid)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "(both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assm:"both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "(high  y (deg div 2)) = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y (deg div 2) = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence 000:"both_member_options ?newnode (low y (deg div 2)) "
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))
[PROOF STEP]
by (metis assm)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))

goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence 001:"invar_vebt (treeList ! (high y (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))

goal (1 subgoal):
 1. invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
using True \<open>vebt_member (treeList ! summin) lx\<close> \<open>invar_vebt (treeList ! summin) n\<close> high_inv member_bound
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))
high y (deg div 2) = high (summin * 2 ^ n + lx) n
vebt_member (treeList ! summin) lx
invar_vebt (treeList ! summin) n
?x < 2 ^ ?n \<Longrightarrow> high (?y * 2 ^ ?n + ?x) ?n = ?y
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y (deg div 2)) n

goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high y (deg div 2)) n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "low y n = ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = ?xn"
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
by (metis "000" "4.IH"(1) \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using calculation(2)
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! ?h) (low y (deg div 2)) \<and> (low y (deg div 2)) \<noteq> (low ?xn (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)
[PROOF STEP]
using  "4.IH"(1) \<open>deg div 2 = n\<close> \<open>high ?xn n < length treeList\<close> inthall member_def
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
deg div 2 = n
high (summin * 2 ^ n + lx) n < length treeList
\<lbrakk>\<And>x. x \<in> set ?xs \<Longrightarrow> ?P x; ?n < length ?xs\<rbrakk> \<Longrightarrow> ?P (?xs ! ?n)
List.member ?xs ?x = (?x \<in> set ?xs)

goal (1 subgoal):
 1. both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)
[PROOF STEP]
by (metis "000")
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "4.hyps"(2) "4.hyps"(9) Suc_1 Suc_leD True \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> \<open>x = mi\<close> assm both_member_options_from_chilf_to_complete_tree dp less_not_refl mimapr)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
by (metis "4.hyps"(2) "4.hyps"(9) \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> \<open>x = mi\<close> assm less_not_refl mimapr nothprolist)
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "(?newlist ! (high  y (deg div 2))) = treeList ! (high y (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using nothprolist
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using "4.hyps"(2) False \<open>length treeList = length ?newlist\<close> assm
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i
length treeList = 2 ^ m
high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! (high y (deg div 2)) ) (low y (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
using assm
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>length treeList = length ?newlist\<close> assm both_member_options_from_chilf_to_complete_tree dp numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)\<Longrightarrow>
                                both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
assume assm: "x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence abcv:"y = mi \<or> y = ma \<or> ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
thus " both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
using False assm
[PROOF STATE]
proof (prove)
using this:
\<not> x \<noteq> mi
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
have " y = ma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (smt (z3) Suc_le_D both_member_options_def dp membermima.simps(4) nat_1_add_1 plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
have " both_member_options (treeList ! (high y n)) (low y n) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
assume myass: "both_member_options (treeList ! (high y n)) (low y n) "
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "high y n = ?h"
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. high y n = high (summin * 2 ^ n + lx) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high y n = high (summin * 2 ^ n + lx) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof(cases "low y n = ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "y = ?xn"
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
by (metis \<open>high y n = high (summin * 2 ^ n + lx) n\<close> bit_split_inv)
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx

goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (metis Suc_le_D both_member_options_def dp membermima.simps(4) nat_1_add_1 plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "low y n \<noteq> ?l"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n
[PROOF STEP]
by (metis assm bit_split_inv)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence pp:"?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
using \<open>vebt_member (treeList ! summin) lx\<close> \<open>invar_vebt (treeList ! summin) n\<close> high_inv member_bound
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
vebt_member (treeList ! summin) lx
invar_vebt (treeList ! summin) n
?x < 2 ^ ?n \<Longrightarrow> high (?y * 2 ^ ?n + ?x) ?n = ?y
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
using "4.IH"(1) False True \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> myass
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
low y n \<noteq> low (summin * 2 ^ n + lx) n
high y n = high (summin * 2 ^ n + lx) n
high (summin * 2 ^ n + lx) n < length treeList
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (metis True \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>length treeList = length ?newlist\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp nat_1_add_1 pp)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence pp:"?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
using nothprolist abcv
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
by (metis "4.hyps"(1) "4.hyps"(3) "4.hyps"(4) assm deg_not_0 exp_split_high_low(1) member_bound tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> abcv both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) dp numerals(2))
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
using abcv calculation(1) calculation(2)
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence notemp:"\<exists> z. both_member_options ?newnode z"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. \<exists>z. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) z
[PROOF STEP]
using not_min_Null_member
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y

goal (1 subgoal):
 1. \<exists>z. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) z

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma = "(if ?xn = ma then
                                                    ?h * 2^(deg div 2) + the( vebt_maxt (?newlist ! ?h))
                                                            else ma)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (?xn, ?newma))  deg ?newlist summary)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
[PROOF STEP]
using del_x_mi_lets_in_not_minNull[of x mi ma deg ?xn ?h summary treeList ?l ?newnode ?newlist]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = mi \<and> x < ma; mi \<noteq> ma; 2 \<le> deg; high (summin * 2 ^ n + lx) (deg div 2) = high (summin * 2 ^ n + lx) n; summin * 2 ^ n + lx = the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))); low (summin * 2 ^ n + lx) (deg div 2) = low (summin * 2 ^ n + lx) n; high (summin * 2 ^ n + lx) (deg div 2) < length treeList; vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n) = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
[PROOF STEP]
by (metis "4.hyps"(3) "4.hyps"(4) False \<open>Some lx = vebt_mint (treeList ! summin)\<close> \<open>Some summin = vebt_mint summary\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>x = mi\<close> add_self_div_2 dp option.sel less_not_refl mimapr)
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options ?delsimp y
                      \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume ssms: "both_member_options ?delsimp y "
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aaaa: "y = ?xn \<or> y = ?newma \<or> (both_member_options (?newlist ! (high y n)) (low y n) \<and> high y n < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D \<open>deg div 2 = n\<close> both_member_options_def dp membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show " x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?xn \<Longrightarrow>?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using \<open>x = mi\<close> minxnrel xnin
[PROOF STATE]
proof (prove)
using this:
x = mi
summin * 2 ^ n + lx \<noteq> mi
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have " y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)

goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?xn = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = ma

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aaa:"?newma =?h * 2 ^ (deg div 2) +the(vebt_maxt(?newlist ! ?h))"
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx = ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) = high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) = high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
obtain maxi where maxidef:"Some maxi = vebt_maxt(?newlist ! ?h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis False hprolist vebt_maxt.elims minNull.simps(1) minNull.simps(4))
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have aa:"invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by (metis "4.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ab:"maxi \<noteq> ?l \<and> both_member_options ?newnode maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi
[PROOF STEP]
by (metis "4.IH"(1) \<open>high ?xn n < length treeList\<close> hprolist inthall maxbmo maxidef member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi
[PROOF STEP]
have ac:"maxi \<noteq> ?l \<and> both_member_options (treeList ! ?h)  maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi

goal (1 subgoal):
 1. maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi
[PROOF STEP]
by (metis "4.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ad:"maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
by (meson aa member_bound valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
maxi < 2 ^ n

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
maxi < 2 ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using  Suc_1 aaa \<open>y = ?newma\<close> ac add_leD1
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n
Suc 1 = 2
(if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) = high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n))
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi
?m + ?k \<le> ?n \<Longrightarrow> ?m \<le> ?n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "4.hyps"(2) "4.hyps"(9) Suc_leD \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>x = mi\<close> both_member_options_from_chilf_to_complete_tree dp option.sel high_inv less_not_refl low_inv maxidef mimapr)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summin * 2 ^ n + lx \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis \<open>mi \<le> x \<and> x \<le> ma\<close> \<open>x = mi\<close> \<open>y = ?newma\<close> both_member_options_equiv_member leD vebt_maxt.simps(3) maxt_member mimapr tvalid)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "(both_member_options (?newlist ! (high y n)) (low y n)\<and> high y n < length ?newlist) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assmy:"(both_member_options (?newlist ! (high y n)) (low y n)\<and> high y n < length ?newlist)"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = ?newnode"
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by (metis "4.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "low y n= ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = ?xn"
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
using "4.IH"(1) \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>treeList [high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)\<close> assmy
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
high (summin * 2 ^ n + lx) n < length treeList
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx

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

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using calculation(1)
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l \<and> both_member_options (treeList ! ?h ) (low y n)"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)
[PROOF STEP]
by (metis "4.IH"(1) "4.hyps"(2) \<open>?newlist ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)\<close> \<open>vebt_member (treeList ! summin) lx\<close> \<open>summin < 2 ^ m\<close> high_inv inthall member_bound member_def)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "4.hyps"(2) "4.hyps"(9) Suc_1 Suc_leD True \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>mi \<le> x \<and> x \<le> ma\<close> \<open>x = mi\<close> both_member_options_from_chilf_to_complete_tree dp leD mimapr)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = treeList !(high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
by (smt (z3) "4.hyps"(1) "4.hyps"(2) "4.hyps"(3) "4.hyps"(4) "4.hyps"(8) \<open>length treeList = length ?newlist\<close> \<open>ma \<le> 2 ^ deg\<close> aaaa calculation(2) deg_not_0 exp_split_high_low(1) less_le_trans member_inv mimapr nothprolist tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList !(high y n)) (low y n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
by (metis "4.hyps"(1) "4.hyps"(4) "4.hyps"(9) \<open>invar_vebt (treeList ! summin) n\<close> \<open>x < 2 ^ deg\<close> \<open>x = mi\<close> calculation deg_not_0 exp_split_high_low(1) mimapr not_less_iff_gr_or_eq)
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "high y n < length ?newlist"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "high y n < length treeList"
[PROOF STATE]
proof (prove)
using this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. high y n < length treeList
[PROOF STEP]
using \<open>length treeList = length ?newlist\<close>
[PROOF STATE]
proof (prove)
using this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. high y n < length treeList
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
high y n < length treeList

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n)
x \<noteq> y
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
high y n < length treeList
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)
x \<noteq> y
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
high y n < length treeList

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>deg div 2 = n\<close> both_member_options_from_chilf_to_complete_tree dp numerals(2))
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using aaaa
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)\<Longrightarrow>
                                both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
assume assm: "x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence abcv:"y = mi \<or> y = ma \<or> ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
thus " both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
using \<open>x = mi\<close> assm
[PROOF STATE]
proof (prove)
using this:
x = mi
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have " y = ma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4))
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have " ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))
                                  \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
assume myass: "(  high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n)) "
[PROOF STATE]
proof (state)
this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high y n = high (summin * 2 ^ n + lx) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof(cases "low y n = ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low y n = low (summin * 2 ^ n + lx) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D \<open>deg div 2 = n\<close> \<open>length treeList = length (treeList [high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])\<close> add_leD1 bit_split_inv both_member_options_def both_member_options_from_chilf_to_complete_tree dp membermima.simps(4) myass nth_list_update_neq plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence pp:"?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by (metis "4.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
by (metis "4.IH"(1) True \<open>high ?xn n < length treeList\<close> \<open>low y n \<noteq> low ?xn n\<close> in_set_member inthall myass)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD True \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>length treeList = length ?newlist\<close> both_member_options_from_chilf_to_complete_tree dp numerals(2) pp)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have pp:"?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
using nothprolist[of "high y n"] False
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n \<and> high y n < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
by (metis "4.hyps"(1) "4.hyps"(3) "4.hyps"(4) assm deg_not_0 exp_split_high_low(1) member_bound tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> abcv both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) dp numerals(2))
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
using abcv calculation(1) calculation(2)
[PROOF STATE]
proof (prove)
using this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case (5 treeList n summary m deg mi ma)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence tvalid: "invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

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

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

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "mi \<le> ma" and "deg div 2 = n" and "ma \<le> 2^deg"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg

goal (1 subgoal):
 1. mi \<le> ma &&& deg div 2 = n &&& ma \<le> 2 ^ deg
[PROOF STEP]
using 5
[PROOF STATE]
proof (prove)
using this:
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. mi \<le> ma &&& deg div 2 = n &&& ma \<le> 2 ^ deg
[PROOF STEP]
by  (auto simp add: "5.hyps"(3) "5.hyps"(4))
[PROOF STATE]
proof (state)
this:
mi \<le> ma
deg div 2 = n
ma \<le> 2 ^ deg

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence dp:"deg \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
mi \<le> ma
deg div 2 = n
ma \<le> 2 ^ deg

goal (1 subgoal):
 1. 2 \<le> deg
[PROOF STEP]
by (meson vebt_maxt.simps(3) maxt_member member_inv tvalid)
[PROOF STATE]
proof (state)
this:
2 \<le> deg

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence nmpr:"n\<ge> 1 \<and> m = Suc n"
[PROOF STATE]
proof (prove)
using this:
2 \<le> deg

goal (1 subgoal):
 1. 1 \<le> n \<and> m = Suc n
[PROOF STEP]
using "5.hyps"(3) \<open>deg div 2 = n\<close>
[PROOF STATE]
proof (prove)
using this:
2 \<le> deg
m = Suc n
deg div 2 = n

goal (1 subgoal):
 1. 1 \<le> n \<and> m = Suc n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 \<le> n \<and> m = Suc n

goal (1 subgoal):
 1. \<And>treeList n summary m deg mi ma x y. \<lbrakk>\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa)); invar_vebt summary m; \<And>x y. both_member_options (vebt_delete summary x) y = (x \<noteq> y \<and> both_member_options summary y); 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> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n \<and> m = Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
1 \<le> n \<and> m = Suc n

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
proof(cases "x <mi \<or> x > ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>1 \<le> n \<and> m = Suc n; x < mi \<or> ma < x\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>1 \<le> n \<and> m = Suc n; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < mi \<or> ma < x

goal (2 subgoals):
 1. \<lbrakk>1 \<le> n \<and> m = Suc n; x < mi \<or> ma < x\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>1 \<le> n \<and> m = Suc n; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (Node (Some (mi, ma)) deg treeList summary)"
[PROOF STATE]
proof (prove)
using this:
x < mi \<or> ma < x

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
using delt_out_of_range[of x mi ma deg treeList summary]  \<open>2 \<le> deg\<close>
[PROOF STATE]
proof (prove)
using this:
x < mi \<or> ma < x
\<lbrakk>x < mi \<or> ma < x; 2 \<le> deg\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
2 \<le> deg

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

goal (2 subgoals):
 1. \<lbrakk>1 \<le> n \<and> m = Suc n; x < mi \<or> ma < x\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>1 \<le> n \<and> m = Suc n; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, ma)) deg treeList summary

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by (metis "5.hyps"(7) True tvalid leD member_inv not_less_iff_gr_or_eq valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal (1 subgoal):
 1. \<lbrakk>1 \<le> n \<and> m = Suc n; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> n \<and> m = Suc n; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (x < mi \<or> ma < x)

goal (1 subgoal):
 1. \<lbrakk>1 \<le> n \<and> m = Suc n; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "mi \<le> x \<and> x \<le> ma"
[PROOF STATE]
proof (prove)
using this:
\<not> (x < mi \<or> ma < x)

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

goal (1 subgoal):
 1. \<lbrakk>1 \<le> n \<and> m = Suc n; \<not> (x < mi \<or> ma < x)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence xdegrel:"x < 2^deg"
[PROOF STATE]
proof (prove)
using this:
mi \<le> x \<and> x \<le> ma

goal (1 subgoal):
 1. x < 2 ^ deg
[PROOF STEP]
using "5.hyps"(8) order.strict_trans1
[PROOF STATE]
proof (prove)
using this:
mi \<le> x \<and> x \<le> ma
ma < 2 ^ deg
\<lbrakk>?a \<le> ?b; ?b < ?c\<rbrakk> \<Longrightarrow> ?a < ?c

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

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

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

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

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary
[PROOF STEP]
using del_single_cont[of x mi ma deg treeList summary] \<open>2 \<le> deg\<close>
[PROOF STATE]
proof (prove)
using this:
x = mi \<and> x = ma
\<lbrakk>x = mi \<and> x = ma; 2 \<le> deg\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary
2 \<le> deg

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

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary

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

goal (1 subgoal):
 1. invar_vebt (Node None deg treeList summary) deg
[PROOF STEP]
using "5"(4) "5.IH"(1) "5.hyps"(1) "5.hyps"(3) "5.hyps"(4) True mi_eq_ma_no_ch
          tvalid invar_vebt.intros(3)
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node None deg treeList summary
length treeList = 2 ^ m
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
invar_vebt summary m
m = Suc n
deg = n + m
x = mi \<and> x = ma
\<lbrakk>invar_vebt (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?deg; ?mi = ?ma\<rbrakk> \<Longrightarrow> (\<forall>t\<in>set ?treeList. \<nexists>x. both_member_options t x) \<and> (\<nexists>x. both_member_options ?summary x)
invar_vebt (Node (Some (mi, ma)) deg treeList summary) deg
\<lbrakk>\<forall>t\<in>set ?treeList. invar_vebt t ?n; 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\<rbrakk> \<Longrightarrow> invar_vebt (Node None ?deg ?treeList ?summary) ?deg

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

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (Node None deg treeList summary) deg

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

goal (1 subgoal):
 1. \<not> vebt_member (Node None deg treeList summary) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> vebt_member (Node None deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<not>both_member_options (Node None deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
using calculation(2) valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
\<not> vebt_member (Node None deg treeList summary) y
invar_vebt (Node None deg treeList summary) deg
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

goal (1 subgoal):
 1. \<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> both_member_options (Node None deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>x < 2 ^ deg; x = mi \<and> x = ma\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> both_member_options (Node None deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> both_member_options (Node None deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by (metis True calculation(1) member_inv not_less_iff_gr_or_eq tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

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

goal (1 subgoal):
 1. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence mimapr:"mi < ma"
[PROOF STATE]
proof (prove)
using this:
\<not> (x = mi \<and> x = ma)

goal (1 subgoal):
 1. mi < ma
[PROOF STEP]
by (metis "5.hyps"(7) \<open>mi \<le> x \<and> x \<le> ma\<close> le_antisym nat_less_le)
[PROOF STATE]
proof (state)
this:
mi < ma

goal (1 subgoal):
 1. \<lbrakk>x < 2 ^ deg; \<not> (x = mi \<and> x = ma)\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[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 (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
proof(cases "x \<noteq> mi")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<noteq> mi

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

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

goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?h ="high x n"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?l = "low x n"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "?h < length treeList"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high x n < length treeList
[PROOF STEP]
using xdegrel 5
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ deg
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. high x n < length treeList
[PROOF STEP]
by (metis \<open>deg div 2 = n\<close> deg_not_0 div_greater_zero_iff dp exp_split_high_low(1) zero_less_numeral)
[PROOF STATE]
proof (state)
this:
high x n < length treeList

goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newnode = "vebt_delete (treeList ! ?h) ?l"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newlist = "treeList[?h:=?newnode]"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "length treeList = length ?newlist"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence hprolist: "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
by (meson \<open>high x n < length treeList\<close> nth_list_update_eq)
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. \<lbrakk>mi < ma; x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have nothprolist: "i \<noteq> ?h \<and> i < 2^m \<Longrightarrow> ?newlist ! i = treeList ! i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i

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

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
proof(cases "minNull ?newnode")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (vebt_delete (treeList ! high x n) (low x n))

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?sn = "vebt_delete summary ?h"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma= "(if x  = ma then (let maxs = vebt_maxt ?sn in
                                                                      (if maxs = None
                                                                         then mi
                                                                         else 2^(deg div 2) * the maxs
                                                                               + the (vebt_maxt (?newlist ! the maxs))
                                                                       )
                                                                   )
                                                              else ma)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (mi, ?newma))  deg ?newlist ?sn)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x =  ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
[PROOF STEP]
using del_x_not_mi_new_node_nil[of mi x ma deg ?h ?l ?newnode treeList ?sn summary ?newlist]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mi < x \<and> x \<le> ma; mi \<noteq> ma; 2 \<le> deg; high x (deg div 2) = high x n; low x (deg div 2) = low x n; vebt_delete (treeList ! high x n) (low x n) = vebt_delete (treeList ! high x n) (low x n); minNull (vebt_delete (treeList ! high x n) (low x n)); vebt_delete summary (high x n) = vebt_delete summary (high x n); treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] = treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
[PROOF STEP]
by (metis True \<open>2 \<le> deg\<close> \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>mi < ma\<close> \<open>mi \<le> x \<and> x \<le> ma\<close> \<open>x \<noteq> mi\<close> less_not_refl3 order.not_eq_order_implies_strict)
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options (?delsimp) y \<Longrightarrow> (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "both_member_options (?delsimp) y"
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = mi \<or> y = ?newma \<or>
                (both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
using both_member_options_from_complete_tree_to_child[of deg mi ?newma ?newlist ?sn y] dp
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
\<lbrakk>1 \<le> deg; both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y\<rbrakk> \<Longrightarrow> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<or> y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)
2 \<le> deg

goal (1 subgoal):
 1. y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D both_member_options_def membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (meson \<open>x \<noteq> mi\<close> both_member_options_equiv_member vebt_mint.simps(3) mint_member tvalid)
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "x =  ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = ma

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
let ?maxs = "vebt_maxt ?sn"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have newmapropy:"?newma = (if ?maxs = None then mi
                                else 2 ^ (deg div 2) * the ?maxs +   the (vebt_maxt
                   (?newlist !
                    the ?maxs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
x = ma

goal (1 subgoal):
 1. (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?maxs = None ")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high x n)) = None

goal (2 subgoals):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_maxt (vebt_delete summary (high x n)) = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high x n)) = None

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using \<open>y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList [high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)\<close> calculation(2) newmapropy
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high x n)) = None
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None
[PROOF STEP]
obtain maxs where "Some maxs = ?maxs"
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None

goal (1 subgoal):
 1. (\<And>maxs. Some maxs = vebt_maxt (vebt_delete summary (high x n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Some maxs = vebt_maxt (vebt_delete summary (high x n))

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options ?sn maxs"
[PROOF STATE]
proof (prove)
using this:
Some maxs = vebt_maxt (vebt_delete summary (high x n))

goal (1 subgoal):
 1. both_member_options (vebt_delete summary (high x n)) maxs
[PROOF STEP]
by (simp add: maxbmo)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete summary (high x n)) maxs

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options summary maxs \<and> maxs \<noteq> ?h"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high x n)) maxs

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high x n
[PROOF STEP]
using "5.IH"(2)
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high x n)) maxs
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high x n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary maxs \<and> maxs \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! the ?maxs = treeList ! maxs"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary maxs \<and> maxs \<noteq> high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))) = treeList ! maxs
[PROOF STEP]
by (metis "5.hyps"(1) \<open>Some maxs = vebt_maxt (vebt_delete summary (high x n))\<close> option.sel member_bound nothprolist valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))) = treeList ! maxs

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "maxs < 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maxs < 2 ^ m
[PROOF STEP]
using "5.hyps"(1) \<open>both_member_options summary maxs \<and> maxs \<noteq> high x n\<close> member_bound valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
both_member_options summary maxs \<and> maxs \<noteq> high x n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "the (vebt_maxt  (?newlist ! the ?maxs)) = the (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
maxs < 2 ^ m

goal (1 subgoal):
 1. the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = the (vebt_maxt (treeList ! maxs))
[PROOF STEP]
by (metis \<open>Some maxs = vebt_maxt (vebt_delete summary (high x n))\<close> \<open>both_member_options summary maxs \<and> maxs \<noteq> high x n\<close> option.sel nth_list_update_neq)
[PROOF STATE]
proof (state)
this:
the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = the (vebt_maxt (treeList ! maxs))

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "\<exists> z. both_member_options(treeList ! maxs) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. both_member_options (treeList ! maxs) z
[PROOF STEP]
by (simp add: "5.hyps"(5) \<open>both_member_options summary maxs \<and> maxs \<noteq> high x n\<close> \<open>maxs < 2 ^ m\<close>)
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! maxs) z

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! maxs) z

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! maxs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
using 5
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
by (metis \<open>maxs < 2 ^ m\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n
[PROOF STEP]
obtain maxi where "Some maxi  = (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList ! maxs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis empty_Collect_eq maxt_corr_help_empty not_None_eq set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
by (metis \<open>invar_vebt (treeList ! maxs) n\<close> maxt_member member_bound)
[PROOF STATE]
proof (state)
this:
maxi < 2 ^ n

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! maxs) maxi"
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
using \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> maxbmo
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n
Some maxi = vebt_maxt (treeList ! maxs)
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "2 ^ (deg div 2) * the ?maxs +  the
                   (vebt_maxt (?newlist !  the ?maxs)) = 2^n * maxs + maxi "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi
[PROOF STEP]
by (metis \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> \<open>Some maxs = vebt_maxt (vebt_delete summary (high x n))\<close> \<open>deg div 2 = n\<close> \<open>the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = the (vebt_maxt (treeList ! maxs))\<close> option.sel)
[PROOF STATE]
proof (state)
this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y =  2^n * maxs + maxi"
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
using False \<open>y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList [high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)\<close> newmapropy
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))) = 2 ^ n * maxs + maxi
vebt_maxt (vebt_delete summary (high x n)) \<noteq> None
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n))))))

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "5.hyps"(2) Suc_1 \<open>both_member_options (treeList ! maxs) maxi\<close> \<open>deg div 2 = n\<close> \<open>maxi < 2 ^ n\<close> \<open>maxs < 2 ^ m\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp high_inv low_inv mult.commute plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by (metis \<open>both_member_options summary maxs \<and> maxs \<noteq> high x n\<close> \<open>maxi < 2 ^ n\<close> \<open>y = 2 ^ n * maxs + maxi\<close> high_inv mult.commute)
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. \<lbrakk>(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high x n)) = None then mi else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high x n))) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the (vebt_maxt (vebt_delete summary (high x n)))))); vebt_maxt (vebt_delete summary (high x n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

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

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma = ma"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> ma

goal (1 subgoal):
 1. (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
using False \<open>y = ?newma\<close>
[PROOF STATE]
proof (prove)
using this:
(if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) = ma
x \<noteq> ma
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis False \<open>y =?newma\<close> both_member_options_equiv_member vebt_maxt.simps(3) maxt_member tvalid)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "(both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assm:"both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "(high  y (deg div 2)) = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y (deg div 2) = high x n

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options ?newnode (low y (deg div 2)) "
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high x n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
[PROOF STEP]
by (metis assm)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "invar_vebt (treeList ! (high y (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))

goal (1 subgoal):
 1. invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
by (metis "5.IH"(1) True \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y (deg div 2)) n

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
have "both_member_options (treeList ! ?h) (low y (deg div 2)) \<and> (low y (deg div 2)) \<noteq> (low x (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y (deg div 2))
invar_vebt (treeList ! high y (deg div 2)) n

goal (1 subgoal):
 1. both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)
[PROOF STEP]
by (metis "5.IH"(1) \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)

goal (2 subgoals):
 1. high y (deg div 2) = high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high x n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low x (deg div 2)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 True \<open>high x n < length treeList\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y (deg div 2) \<noteq> high x n

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) \<noteq> high x n

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
using \<open>deg div 2 = n\<close>
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) \<noteq> high x n
deg div 2 = n

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

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "(?newlist ! (high  y (deg div 2))) = treeList ! (high y (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using nothprolist
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using "5.hyps"(2) False \<open>length treeList = length ?newlist\<close> assm
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i
length treeList = 2 ^ m
high y (deg div 2) \<noteq> high x n
length treeList = length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

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

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
using assm
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

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

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

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>length treeList = length ?newlist\<close> assm both_member_options_from_chilf_to_complete_tree dp numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high x n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have " (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y) \<Longrightarrow> both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
assume "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence aa:"x \<noteq> y" and bb:"y = mi \<or> y = ma \<or> (both_member_options (treeList ! (high y n)) (low y n) \<and> high y n < length treeList)"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y &&& y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> \<open>x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
x \<noteq> y
y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
show "both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "y = mi \<Longrightarrow>both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by (metis Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4))
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "y = ma \<Longrightarrow> both_member_options (?delsimp) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
using aa maxbmo vebt_maxt.simps(3)
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x
vebt_maxt (Node (Some (?mi, ?ma)) ?ux ?uy ?uz) = Some ?ma

goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "both_member_options (treeList ! (high y n)) (low y n) \<Longrightarrow>both_member_options (?delsimp) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
assume assmy: "both_member_options (treeList ! (high y n)) (low y n)"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
show "both_member_options (?delsimp) y "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "?newlist ! (high y n) = ?newnode"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y n = high x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence 0:"invar_vebt (treeList !(high y n)) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high y n) n
[PROOF STEP]
using 5
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. invar_vebt (treeList ! high y n) n
[PROOF STEP]
by (metis True \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have 1:"low y n \<noteq> low x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low y n \<noteq> low x n
[PROOF STEP]
by (metis True aa bit_split_inv)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have 11:" (treeList !(high y n)) \<in> set treeList"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList ! high y n \<in> set treeList
[PROOF STEP]
by (metis True \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
treeList ! high y n \<in> set treeList

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
high y n = high x n
invar_vebt (treeList ! high y n) n
low y n \<noteq> low x n
treeList ! high y n \<in> set treeList
[PROOF STEP]
have "  (\<forall> xa. both_member_options ?newnode xa =
                         ((low x n) \<noteq> xa \<and> both_member_options (treeList ! ?h) xa))"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n
invar_vebt (treeList ! high y n) n
low y n \<noteq> low x n
treeList ! high y n \<in> set treeList

goal (1 subgoal):
 1. \<forall>xaa. both_member_options (vebt_delete (treeList ! high x n) (low x n)) xaa = (low x n \<noteq> xaa \<and> both_member_options (treeList ! high x n) xaa)
[PROOF STEP]
by (simp add: "5.IH"(1))
[PROOF STATE]
proof (state)
this:
\<forall>xaa. both_member_options (vebt_delete (treeList ! high x n) (low x n)) xaa = (low x n \<noteq> xaa \<and> both_member_options (treeList ! high x n) xaa)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "((low x n) \<noteq> xa \<and> both_member_options (treeList ! ?h) xa) \<Longrightarrow>  both_member_options ?newnode xa" for xa
[PROOF STATE]
proof (prove)
using this:
\<forall>xaa. both_member_options (vebt_delete (treeList ! high x n) (low x n)) xaa = (low x n \<noteq> xaa \<and> both_member_options (treeList ! high x n) xaa)

goal (1 subgoal):
 1. low x n \<noteq> xa \<and> both_member_options (treeList ! high x n) xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) xa
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
have "((low x n) \<noteq> (low y n) \<and> both_member_options (treeList ! ?h) (low y n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low x n \<noteq> low y n \<and> both_member_options (treeList ! high x n) (low y n)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n

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

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa
low x n \<noteq> low y n \<and> both_member_options (treeList ! high x n) (low y n)
[PROOF STEP]
have "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
low x n \<noteq> ?xa \<and> both_member_options (treeList ! high x n) ?xa \<Longrightarrow> both_member_options (vebt_delete (treeList ! high x n) (low x n)) ?xa
low x n \<noteq> low y n \<and> both_member_options (treeList ! high x n) (low y n)

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by (metis One_nat_def Suc_leD True \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>length treeList = length ?newlist\<close> both_member_options_from_chilf_to_complete_tree dp hprolist numerals(2))
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
hence "both_member_options (?newlist !(high y n)) (low y n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> aa add_leD1 bb both_member_options_def both_member_options_from_chilf_to_complete_tree dp membermima.simps(4) plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
y = mi \<or> y = ma \<or> both_member_options (treeList ! high y n) (low y n) \<and> high y n < length treeList

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))
both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then let maxs = vebt_maxt (vebt_delete summary (high x n)) in if maxs = None then mi else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! the maxs)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) (vebt_delete summary (high x n))) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence notemp:"\<exists> z. both_member_options ?newnode z"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))

goal (1 subgoal):
 1. \<exists>z. both_member_options (vebt_delete (treeList ! high x n) (low x n)) z
[PROOF STEP]
using not_min_Null_member
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y

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

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma = "(if x = ma then
                                                    ?h * 2^(deg div 2) + the( vebt_maxt (?newlist ! ?h))
                                                            else ma)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (mi, ?newma))  deg ?newlist summary)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
[PROOF STEP]
using del_x_not_mi_newnode_not_nil[of mi x ma deg ?h ?l ?newnode treeList ?newlist summary] False xmi mimapr
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mi < x \<and> x \<le> ma; mi \<noteq> ma; 2 \<le> deg; high x (deg div 2) = high x n; low x (deg div 2) = low x n; vebt_delete (treeList ! high x n) (low x n) = vebt_delete (treeList ! high x n) (low x n); \<not> minNull (vebt_delete (treeList ! high x n) (low x n)); treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] = treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))
x \<noteq> mi
mi < ma

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
[PROOF STEP]
using \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>mi \<le> x \<and> x \<le> ma\<close> dp nat_less_le plus_1_eq_Suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mi < x \<and> x \<le> ma; mi \<noteq> ma; 2 \<le> deg; high x (deg div 2) = high x n; low x (deg div 2) = low x n; vebt_delete (treeList ! high x n) (low x n) = vebt_delete (treeList ! high x n) (low x n); \<not> minNull (vebt_delete (treeList ! high x n) (low x n)); treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] = treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]; high x (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
\<not> minNull (vebt_delete (treeList ! high x n) (low x n))
x \<noteq> mi
mi < ma
deg div 2 = n
high x n < length treeList
mi \<le> x \<and> x \<le> ma
2 \<le> deg
(?m < ?n) = (?m \<le> ?n \<and> ?m \<noteq> ?n)
(+) 1 = Suc

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options ?delsimp y
                      \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume ssms: "both_member_options ?delsimp y "
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aaaa: "y = mi \<or> y = ?newma \<or> (both_member_options (?newlist ! (high y n)) (low y n) \<and> high y n < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<and> high y n < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D \<open>deg div 2 = n\<close> both_member_options_def dp membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<and> high y n < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show " x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow>?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4) xmi)
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have " y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)

goal (1 subgoal):
 1. y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "x = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = ma

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma =?h * 2 ^ (deg div 2) +the(vebt_maxt(?newlist ! ?h))"
[PROOF STATE]
proof (prove)
using this:
x = ma

goal (1 subgoal):
 1. (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) = high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) = high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n))

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

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

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
obtain maxi where maxidef:"Some maxi = vebt_maxt(?newlist ! ?h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis False hprolist vebt_maxt.elims minNull.simps(1) minNull.simps(4))
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have aa:"invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x n) n
[PROOF STEP]
by (metis "5.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ab:"maxi \<noteq> ?l \<and> both_member_options ?newnode maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n

goal (1 subgoal):
 1. maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi
[PROOF STEP]
by (metis "5.IH"(1) \<open>high x n < length treeList\<close> hprolist inthall maxbmo maxidef member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high x n) n
maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi
[PROOF STEP]
have ac:"maxi \<noteq> ?l \<and> both_member_options (treeList ! ?h)  maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n
maxi \<noteq> low x n \<and> both_member_options (vebt_delete (treeList ! high x n) (low x n)) maxi

goal (1 subgoal):
 1. maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi
[PROOF STEP]
by (metis "5.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ad:"maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
using \<open>invar_vebt (treeList ! high x n) n\<close> member_bound valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
maxi \<noteq> low x n \<and> both_member_options (treeList ! high x n) maxi
invar_vebt (treeList ! high x n) n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (2 subgoals):
 1. x = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
maxi < 2 ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 \<open>(if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) = high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n))\<close> \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)\<close> ac add_leD1 both_member_options_from_chilf_to_complete_tree dp option.sel high_inv low_inv maxidef plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

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

goal (1 subgoal):
 1. x \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> ma

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (simp add: \<open>y = ?newma\<close> maxbmo)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "both_member_options (?newlist ! (high y n)) (low y n) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assmy:"both_member_options (?newlist ! (high y n)) (low y n)"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = ?newnode"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y n = high x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = vebt_delete (treeList ! high x n) (low x n)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high x n) n
[PROOF STEP]
by (metis "5.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l \<and> both_member_options (treeList ! ?h ) (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n

goal (1 subgoal):
 1. low y n \<noteq> low x n \<and> both_member_options (treeList ! high x n) (low y n)
[PROOF STEP]
by (metis "5.IH"(1) True \<open>high x n < length treeList\<close> assmy hprolist inthall member_def)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n \<and> both_member_options (treeList ! high x n) (low y n)

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

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis Suc_1 True \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = treeList !(high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis False Suc_1 \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> aaaa add_leD1 both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) dp plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using aaaa
[PROOF STATE]
proof (prove)
using this:
y = mi \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = mi \<or> y = (if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma) \<or> both_member_options (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n) (low y n) \<and> high y n < length (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)])

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)\<Longrightarrow>
                                both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
assume assm: "x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence abcv:"y = mi \<or> y = ma \<or> ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
thus " both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by (metis Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4))
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
have " y = ma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
using assm maxbmo vebt_maxt.simps(3)
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x
vebt_maxt (Node (Some (?mi, ?ma)) ?ux ?uy ?uz) = Some ?ma

goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
have " both_member_options (treeList ! (high y n)) (low y n) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
assume myass: "both_member_options (treeList ! (high y n)) (low y n) "
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l"
[PROOF STATE]
proof (prove)
using this:
high y n = high x n

goal (1 subgoal):
 1. low y n \<noteq> low x n
[PROOF STEP]
by (metis assm bit_split_inv)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low x n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence pp:"?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low x n
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

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

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n = vebt_delete (treeList ! high x n) (low x n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high x n) n
[PROOF STEP]
by (metis "5.IH"(1) \<open>high x n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high x n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high x n) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)
[PROOF STEP]
by (metis "5.IH"(1) True \<open>high x n < length treeList\<close> \<open>low y n \<noteq> low x n\<close> in_set_member inthall myass)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high x n) (low x n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD True \<open>deg div 2 = n\<close> \<open>high x n < length treeList\<close> \<open>length treeList = length ?newlist\<close> both_member_options_from_chilf_to_complete_tree dp numerals(2) pp)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
hence pp:"?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n

goal (1 subgoal):
 1. treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
[PROOF STEP]
using nothprolist abcv
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high x n
?i \<noteq> high x n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! ?i = treeList ! ?i
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high x n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> abcv both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) dp numerals(2))
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
using abcv calculation(1) calculation(2)
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
y = mi \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
y = ma \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<noteq> high x n \<and> i < 2 ^ m \<Longrightarrow> treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! i = treeList ! i; \<not> minNull (vebt_delete (treeList ! high x n) (low x n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary
both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (mi, if x = ma then high x n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)] ! high x n)) else ma)) deg (treeList[high x n := vebt_delete (treeList ! high x n) (low x n)]) summary) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

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

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

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

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options summary (high ma n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options summary (high ma n)
[PROOF STEP]
by (metis "5"(10) "5"(11) "5"(7) "5.hyps"(4) Euclidean_Division.div_eq_0_iff Suc_leI Suc_le_D div_exp_eq dual_order.irrefl high_def mimapr nat.simps(3))
[PROOF STATE]
proof (state)
this:
both_member_options summary (high ma n)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "vebt_member summary (high ma n)"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high ma n)

goal (1 subgoal):
 1. vebt_member summary (high ma n)
[PROOF STEP]
using "5.hyps"(1) valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
both_member_options summary (high ma n)
invar_vebt summary m
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
obtain summin where "Some summin = vebt_mint summary"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>summin. Some summin = vebt_mint summary \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis "5.hyps"(1) \<open>vebt_member summary (high ma n)\<close> empty_Collect_eq mint_corr_help_empty not_None_eq set_vebt'_def)
[PROOF STATE]
proof (state)
this:
Some summin = vebt_mint summary

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "\<exists> z . both_member_options (treeList ! summin) z"
[PROOF STATE]
proof (prove)
using this:
Some summin = vebt_mint summary

goal (1 subgoal):
 1. \<exists>z. both_member_options (treeList ! summin) z
[PROOF STEP]
by (metis "5.hyps"(1) "5.hyps"(5) both_member_options_equiv_member member_bound mint_member)
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! summin) z

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! summin) z

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "invar_vebt (treeList ! summin) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! summin) n
[PROOF STEP]
by (metis "5.IH"(1) "5.hyps"(1) "5.hyps"(2) \<open>Some summin = vebt_mint summary\<close> member_bound mint_member nth_mem)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! summin) n

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. both_member_options (treeList ! summin) z
invar_vebt (treeList ! summin) n
[PROOF STEP]
obtain lx where "Some lx = vebt_mint (treeList ! summin)"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. both_member_options (treeList ! summin) z
invar_vebt (treeList ! summin) n

goal (1 subgoal):
 1. (\<And>lx. Some lx = vebt_mint (treeList ! summin) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis empty_Collect_eq mint_corr_help_empty not_None_eq set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
Some lx = vebt_mint (treeList ! summin)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?xn = "summin*2^n + lx"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "?xn =  (if x = mi
                             then the (vebt_mint summary) * 2^(deg div 2)
                                      + the (vebt_mint (treeList ! the (vebt_mint summary)))
                             else x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)
[PROOF STEP]
by (metis False \<open>Some lx = vebt_mint (treeList ! summin)\<close> \<open>Some summin = vebt_mint summary\<close> \<open>deg div 2 = n\<close> option.sel)
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_member (treeList ! summin) lx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_member (treeList ! summin) lx
[PROOF STEP]
using \<open>Some lx = vebt_mint (treeList ! summin)\<close> \<open>invar_vebt (treeList ! summin) n\<close> mint_member
[PROOF STATE]
proof (prove)
using this:
Some lx = vebt_mint (treeList ! summin)
invar_vebt (treeList ! summin) n
\<lbrakk>invar_vebt ?t ?n; vebt_mint ?t = Some ?maxi\<rbrakk> \<Longrightarrow> vebt_member ?t ?maxi

goal (1 subgoal):
 1. vebt_member (treeList ! summin) lx
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! summin) lx

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_member (treeList ! summin) lx

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "summin < 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin < 2 ^ m
[PROOF STEP]
by (metis "5.hyps"(1) \<open>Some summin = vebt_mint summary\<close> member_bound mint_member)
[PROOF STATE]
proof (state)
this:
summin < 2 ^ m

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_member (treeList ! summin) lx
summin < 2 ^ m
[PROOF STEP]
have xnin: "both_member_options (Node (Some (mi, ma)) deg treeList summary) ?xn"
[PROOF STATE]
proof (prove)
using this:
vebt_member (treeList ! summin) lx
summin < 2 ^ m

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
[PROOF STEP]
by (metis "5.hyps"(2) Suc_1 \<open>deg div 2 = n\<close> \<open>invar_vebt (treeList ! summin) n\<close> add_leD1 both_member_options_equiv_member both_member_options_from_chilf_to_complete_tree dp high_inv low_inv member_bound plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?h ="high ?xn n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?l = "low ?xn n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "?xn < 2^deg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx < 2 ^ deg
[PROOF STEP]
by (smt (verit, ccfv_SIG) "5.hyps"(1) "5.hyps"(4) Euclidean_Division.div_eq_0_iff \<open>Some lx = vebt_mint (treeList ! summin)\<close> \<open>Some summin = vebt_mint summary\<close> \<open>invar_vebt (treeList ! summin) n\<close> div_exp_eq high_def high_inv le_0_eq member_bound mint_member not_numeral_le_zero power_not_zero)
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx < 2 ^ deg

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence "?h < length treeList"
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx < 2 ^ deg

goal (1 subgoal):
 1. high (summin * 2 ^ n + lx) n < length treeList
[PROOF STEP]
using "5.hyps"(2) \<open>vebt_member (treeList ! summin) lx\<close> \<open>summin < 2 ^ m\<close> \<open>invar_vebt (treeList ! summin) n\<close> high_inv member_bound
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx < 2 ^ deg
length treeList = 2 ^ m
vebt_member (treeList ! summin) lx
summin < 2 ^ m
invar_vebt (treeList ! summin) n
?x < 2 ^ ?n \<Longrightarrow> high (?y * 2 ^ ?n + ?x) ?n = ?y
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. high (summin * 2 ^ n + lx) n < length treeList
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
high (summin * 2 ^ n + lx) n < length treeList

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newnode = "vebt_delete (treeList ! ?h) ?l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newlist = "treeList[?h:= ?newnode]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "length treeList = length ?newlist"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence hprolist: "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by (meson \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> nth_list_update)
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have nothprolist: "i \<noteq> ?h \<and> i < 2^m \<Longrightarrow> ?newlist ! i = treeList ! i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> high (summin * 2 ^ n + lx) n \<and> i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! i = treeList ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have firstsimp: "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x =(
                          let newnode = vebt_delete (treeList ! ?h) ?l;
                              newlist = treeList[?h:= ?newnode] in
                             if minNull newnode
                             then(
                                let sn = vebt_delete summary ?h in
                               (Node (Some (?xn, if ?xn  = ma then (let maxs = vebt_maxt sn in
                                                                      (if maxs = None
                                                                         then ?xn
                                                                         else 2^(deg div 2) * the maxs
                                                                               + the (vebt_maxt (newlist ! the maxs))
                                                                       )
                                                                   )
                                                              else ma))
                                      deg newlist sn)
                             )else
                               (Node (Some (?xn, (if ?xn = ma then
                                                    ?h * 2^(deg div 2) + the( vebt_maxt (newlist ! ?h))
                                                            else ma)))
                                 deg newlist summary ))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)
[PROOF STEP]
using del_x_mi[of x mi ma deg ?xn ?h summary treeList ?l]
            \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close>
            \<open>summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) +
              the (vebt_mint (treeList ! the (vebt_mint summary))) else x)\<close> \<open>x = mi\<close> dp mimapr nat_less_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = mi \<and> x < ma; mi \<noteq> ma; 2 \<le> deg; high (summin * 2 ^ n + lx) (deg div 2) = high (summin * 2 ^ n + lx) n; summin * 2 ^ n + lx = the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))); low (summin * 2 ^ n + lx) (deg div 2) = low (summin * 2 ^ n + lx) n; high (summin * 2 ^ n + lx) (deg div 2) < length treeList\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = treeList[high (summin * 2 ^ n + lx) n := newnode] in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)
deg div 2 = n
high (summin * 2 ^ n + lx) n < length treeList
summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)
x = mi
2 \<le> deg
mi < ma
(?m < ?n) = (?m \<le> ?n \<and> ?m \<noteq> ?n)

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)
[PROOF STEP]
by smt
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = (let newnode = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); newlist = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] in if minNull newnode then let sn = vebt_delete summary (high (summin * 2 ^ n + lx) n) in Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt sn in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (newlist ! the maxs)) else ma)) deg newlist sn else Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (newlist ! high (summin * 2 ^ n + lx) n)) else ma)) deg newlist summary)

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have minxnrel: "?xn \<noteq> mi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> mi
[PROOF STEP]
by (metis "5.hyps"(2) "5.hyps"(9) \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>vebt_member (treeList ! summin) lx\<close> \<open>invar_vebt (treeList ! summin) n\<close> both_member_options_equiv_member high_inv less_not_refl low_inv member_bound mimapr)
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx \<noteq> mi

goal (1 subgoal):
 1. \<lbrakk>mi < ma; \<not> x \<noteq> mi\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summin * 2 ^ n + lx \<noteq> mi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx \<noteq> mi

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
proof(cases "minNull ?newnode")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?sn = "vebt_delete summary ?h"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma= "(if ?xn= ma then (let maxs = vebt_maxt ?sn in
                                                                      (if maxs = None
                                                                         then ?xn
                                                                         else 2^(deg div 2) * the maxs
                                                                               + the (vebt_maxt (?newlist ! the maxs))
                                                                       )
                                                                   )
                                                              else ma)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (?xn, ?newma))  deg ?newlist ?sn)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x =  ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
[PROOF STEP]
using del_x_mi_lets_in_minNull[of x mi ma deg ?xn ?h summary treeList ?l ?newnode ?newlist ?sn] False True \<open>deg div 2 = n\<close> \<open>?h < length treeList\<close> \<open>summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)\<close> dp less_not_refl3 mimapr
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = mi \<and> x < ma; mi \<noteq> ma; 2 \<le> deg; high (summin * 2 ^ n + lx) (deg div 2) = high (summin * 2 ^ n + lx) n; summin * 2 ^ n + lx = the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))); low (summin * 2 ^ n + lx) (deg div 2) = low (summin * 2 ^ n + lx) n; high (summin * 2 ^ n + lx) (deg div 2) < length treeList; vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n) = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)); vebt_delete summary (high (summin * 2 ^ n + lx) n) = vebt_delete summary (high (summin * 2 ^ n + lx) n)\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
\<not> x \<noteq> mi
minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))
deg div 2 = n
high (summin * 2 ^ n + lx) n < length treeList
summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)
2 \<le> deg
?s < ?t \<Longrightarrow> ?s \<noteq> ?t
mi < ma

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options (?delsimp) y \<Longrightarrow> (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "both_member_options (?delsimp) y"
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = ?xn \<or> y = ?newma \<or>
                (both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
using both_member_options_from_complete_tree_to_child[of deg mi ?newma ?newlist ?sn y] dp
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
\<lbrakk>1 \<le> deg; both_member_options (Node (Some (mi, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y\<rbrakk> \<Longrightarrow> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<or> y = mi \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)
2 \<le> deg

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D both_member_options_def membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?xn \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "5.hyps"(9) False \<open>vebt_member (treeList ! summin) lx\<close> \<open>summin < 2 ^ m\<close> \<open>invar_vebt (treeList ! summin) n\<close> both_member_options_equiv_member high_inv less_not_refl low_inv member_bound mimapr xnin)
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume asmt: "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?xn =  ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = ma

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
let ?maxs = "vebt_maxt ?sn"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have newmaext:"?newma = (if ?maxs = None then ?xn
                                else 2 ^ (deg div 2) * the ?maxs +   the (vebt_maxt
                  ( ?newlist ! the ?maxs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx = ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?maxs = None ")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aa:"?newma = ?xn"
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
[PROOF STEP]
using newmaext
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence bb: "?newma \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
[PROOF STEP]
using False minxnrel
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
\<not> x \<noteq> mi
summin * 2 ^ n + lx \<noteq> mi

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) ?xn"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
[PROOF STEP]
using xnin newmaext minxnrel asmt
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))))
summin * 2 ^ n + lx \<noteq> mi
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "?xn = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summin * 2 ^ n + lx = y
[PROOF STEP]
using aa asmt
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = summin * 2 ^ n + lx
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. summin * 2 ^ n + lx = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = y

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
summin * 2 ^ n + lx = y
[PROOF STEP]
have "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)
summin * 2 ^ n + lx = y

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

goal (2 subgoals):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using bb
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using \<open>summin * 2 ^ n + lx = y\<close> \<open>y = ?xn \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y\<close>
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<noteq> x
summin * 2 ^ n + lx = y
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None
[PROOF STEP]
obtain maxs where "Some maxs = ?maxs"
[PROOF STATE]
proof (prove)
using this:
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None

goal (1 subgoal):
 1. (\<And>maxs. Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options ?sn maxs"
[PROOF STATE]
proof (prove)
using this:
Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs
[PROOF STEP]
by (simp add: maxbmo)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options summary maxs \<and> maxs \<noteq> ?h"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
[PROOF STEP]
using "5.IH"(2)
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete summary (high (summin * 2 ^ n + lx) n)) maxs
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)

goal (1 subgoal):
 1. both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! the ?maxs = treeList ! maxs"
[PROOF STATE]
proof (prove)
using this:
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) = treeList ! maxs
[PROOF STEP]
by (metis "5.hyps"(1) \<open>Some maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))\<close> option.sel member_bound nothprolist valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) = treeList ! maxs

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "maxs < 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maxs < 2 ^ m
[PROOF STEP]
using "5.hyps"(1) \<open>both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n\<close> member_bound valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
invar_vebt summary m
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "the (vebt_maxt  (?newlist ! the ?maxs)) = the (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
maxs < 2 ^ m

goal (1 subgoal):
 1. the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = the (vebt_maxt (treeList ! maxs))
[PROOF STEP]
using \<open>?newlist ! the (vebt_maxt ?sn) = treeList ! maxs\<close>
[PROOF STATE]
proof (prove)
using this:
maxs < 2 ^ m
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) = treeList ! maxs

goal (1 subgoal):
 1. the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = the (vebt_maxt (treeList ! maxs))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = the (vebt_maxt (treeList ! maxs))

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "\<exists> z. both_member_options(treeList ! maxs) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. both_member_options (treeList ! maxs) z
[PROOF STEP]
using "5.hyps"(5) \<open>both_member_options summary maxs \<and> maxs \<noteq>?h\<close> \<open>maxs < 2 ^ m\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>i<2 ^ m. (\<exists>x. both_member_options (treeList ! i) x) = both_member_options summary i
both_member_options summary maxs \<and> maxs \<noteq> high (summin * 2 ^ n + lx) n
maxs < 2 ^ m

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

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (treeList ! maxs) z

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! maxs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
using 5
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
both_member_options (vebt_delete summary ?x) ?y = (?x \<noteq> ?y \<and> both_member_options summary ?y)
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))

goal (1 subgoal):
 1. invar_vebt (treeList ! maxs) n
[PROOF STEP]
by (metis \<open>maxs < 2 ^ m\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n
[PROOF STEP]
obtain maxi where "Some maxi  = (vebt_maxt (treeList ! maxs))"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. both_member_options (treeList ! maxs) z
invar_vebt (treeList ! maxs) n

goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList ! maxs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis empty_Collect_eq maxt_corr_help_empty not_None_eq set_vebt'_def valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
Some maxi = vebt_maxt (treeList ! maxs)

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
by (metis \<open>invar_vebt (treeList ! maxs) n\<close> maxt_member member_bound)
[PROOF STATE]
proof (state)
this:
maxi < 2 ^ n

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! maxs) maxi"
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
using \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> maxbmo
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n
Some maxi = vebt_maxt (treeList ! maxs)
vebt_maxt ?t = Some ?x \<Longrightarrow> both_member_options ?t ?x

goal (1 subgoal):
 1. both_member_options (treeList ! maxs) maxi
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "2 ^ (deg div 2) * the ?maxs +  the
                   (vebt_maxt (?newlist !  the ?maxs)) = 2^n * maxs + maxi "
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! maxs) maxi

goal (1 subgoal):
 1. 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi
[PROOF STEP]
by (metis \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> \<open>Some maxs = vebt_maxt ?sn\<close> \<open>deg div 2 = n\<close> \<open>the (vebt_maxt (?newlist ! the (vebt_maxt ?sn))) = the (vebt_maxt (treeList ! maxs))\<close> option.sel)
[PROOF STATE]
proof (state)
this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma =  2^n * maxs + maxi"
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi
[PROOF STEP]
using False True
[PROOF STATE]
proof (prove)
using this:
2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))))) = 2 ^ n * maxs + maxi
vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None
summin * 2 ^ n + lx = ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y =   2^n * maxs + maxi"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
using asmt
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = 2 ^ n * maxs + maxi
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)

goal (1 subgoal):
 1. y = 2 ^ n * maxs + maxi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
y = 2 ^ n * maxs + maxi

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "5.hyps"(2) Suc_1 \<open>both_member_options (treeList ! maxs) maxi\<close> \<open>deg div 2 = n\<close> \<open>maxi < 2 ^ n\<close> \<open>maxs < 2 ^ m\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp high_inv low_inv mult.commute plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by (metis "5.hyps"(9) True \<open>Some maxi = vebt_maxt (treeList ! maxs)\<close> \<open>maxi < 2 ^ n\<close> \<open>maxs < 2 ^ m\<close> \<open>x = mi\<close> \<open>y = 2 ^ n * maxs + maxi\<close> high_inv less_not_refl low_inv maxbmo minxnrel mult.commute)
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. \<lbrakk>(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = (if vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n))) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the (vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)))))); vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) \<noteq> None\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newma = ma"
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "mi \<noteq> ma"
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma

goal (1 subgoal):
 1. mi \<noteq> ma
[PROOF STEP]
using mimapr
[PROOF STATE]
proof (prove)
using this:
(if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) = ma
mi < ma

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

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mi \<noteq> ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
using False \<open>y = ?newma\<close> \<open>x = mi\<close>
[PROOF STATE]
proof (prove)
using this:
mi \<noteq> ma
summin * 2 ^ n + lx \<noteq> ma
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)
x = mi

goal (1 subgoal):
 1. y \<noteq> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<noteq> x

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> x

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis False \<open>y =?newma\<close> both_member_options_equiv_member vebt_maxt.simps(3) maxt_member tvalid)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "(both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assm:"both_member_options (?newlist ! (high  y (deg div 2))) (low y (deg div 2)) \<and> (high y (deg div 2)) < length ?newlist"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "(high  y (deg div 2)) = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y (deg div 2) = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence 000:"both_member_options ?newnode (low y (deg div 2)) "
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) = high (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))
[PROOF STEP]
by (metis assm)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))

goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence 001:"invar_vebt (treeList ! (high y (deg div 2))) n"
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))

goal (1 subgoal):
 1. invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
using True \<open>vebt_member (treeList ! summin) lx\<close> \<open>invar_vebt (treeList ! summin) n\<close> high_inv member_bound
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y (deg div 2))
high y (deg div 2) = high (summin * 2 ^ n + lx) n
vebt_member (treeList ! summin) lx
invar_vebt (treeList ! summin) n
?x < 2 ^ ?n \<Longrightarrow> high (?y * 2 ^ ?n + ?x) ?n = ?y
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high y (deg div 2)) n

goal (2 subgoals):
 1. high y (deg div 2) = high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high y (deg div 2)) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high y (deg div 2)) n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "low y n = ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = ?xn"
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
by (metis "000" "5.IH"(1) \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using calculation(2)
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! ?h) (low y (deg div 2)) \<and> (low y (deg div 2)) \<noteq> (low ?xn (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)
[PROOF STEP]
using  "5.IH"(1) \<open>deg div 2 = n\<close> \<open>high ?xn n < length treeList\<close> inthall member_def
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
deg div 2 = n
high (summin * 2 ^ n + lx) n < length treeList
\<lbrakk>\<And>x. x \<in> set ?xs \<Longrightarrow> ?P x; ?n < length ?xs\<rbrakk> \<Longrightarrow> ?P (?xs ! ?n)
List.member ?xs ?x = (?x \<in> set ?xs)

goal (1 subgoal):
 1. both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)
[PROOF STEP]
by (metis "000")
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high y (deg div 2)) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y (deg div 2)) \<and> low y (deg div 2) \<noteq> low (summin * 2 ^ n + lx) (deg div 2)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "5.hyps"(2) "5.hyps"(9) Suc_1 Suc_leD True \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> \<open>x = mi\<close> assm both_member_options_from_chilf_to_complete_tree dp less_not_refl mimapr)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
by (metis "5.hyps"(2) "5.hyps"(9) \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> \<open>x = mi\<close> assm less_not_refl mimapr nothprolist)
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "(?newlist ! (high  y (deg div 2))) = treeList ! (high y (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using nothprolist
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
using "5.hyps"(2) False \<open>length treeList = length ?newlist\<close> assm
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i
length treeList = 2 ^ m
high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList ! (high y (deg div 2)) ) (low y (deg div 2))"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
using assm
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))

goal (1 subgoal):
 1. both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>length treeList = length ?newlist\<close> assm both_member_options_from_chilf_to_complete_tree dp numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. high y (deg div 2) \<noteq> high (summin * 2 ^ n + lx) n \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2) = treeList ! high y (deg div 2)
both_member_options (treeList ! high y (deg div 2)) (low y (deg div 2))
both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y (deg div 2)) (low y (deg div 2)) \<and> high y (deg div 2) < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)\<Longrightarrow>
                                both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
assume assm: "x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence abcv:"y = mi \<or> y = ma \<or> ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
thus " both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
using False assm
[PROOF STATE]
proof (prove)
using this:
\<not> x \<noteq> mi
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
have " y = ma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (smt (z3) Suc_le_D both_member_options_def dp membermima.simps(4) nat_1_add_1 plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
have " both_member_options (treeList ! (high y n)) (low y n) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
assume myass: "both_member_options (treeList ! (high y n)) (low y n) "
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "high y n = ?h"
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. high y n = high (summin * 2 ^ n + lx) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high y n = high (summin * 2 ^ n + lx) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
proof(cases "low y n = ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "y = ?xn"
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
by (metis \<open>high y n = high (summin * 2 ^ n + lx) n\<close> bit_split_inv)
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx

goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (metis Suc_le_D both_member_options_def dp membermima.simps(4) nat_1_add_1 plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "low y n \<noteq> ?l"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n
[PROOF STEP]
by (metis assm bit_split_inv)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence pp:"?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
using \<open>vebt_member (treeList ! summin) lx\<close> \<open>invar_vebt (treeList ! summin) n\<close> high_inv member_bound
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
vebt_member (treeList ! summin) lx
invar_vebt (treeList ! summin) n
?x < 2 ^ ?n \<Longrightarrow> high (?y * 2 ^ ?n + ?x) ?n = ?y
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
using "5.IH"(1) False True \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> myass
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
low y n \<noteq> low (summin * 2 ^ n + lx) n
high y n = high (summin * 2 ^ n + lx) n
high (summin * 2 ^ n + lx) n < length treeList
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (metis True \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>length treeList = length ?newlist\<close> add_leD1 both_member_options_from_chilf_to_complete_tree dp nat_1_add_1 pp)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
hence pp:"?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
using nothprolist abcv
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> abcv both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) dp numerals(2))
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
using abcv calculation(1) calculation(2)
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (2 subgoals):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
 2. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then let maxs = vebt_maxt (vebt_delete summary (high (summin * 2 ^ n + lx) n)) in if maxs = None then summin * 2 ^ n + lx else 2 ^ (deg div 2) * the maxs + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! the maxs)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) (vebt_delete summary (high (summin * 2 ^ n + lx) n))) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
hence notemp:"\<exists> z. both_member_options ?newnode z"
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))

goal (1 subgoal):
 1. \<exists>z. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) z
[PROOF STEP]
using not_min_Null_member
[PROOF STATE]
proof (prove)
using this:
\<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))
\<not> minNull ?t \<Longrightarrow> \<exists>y. both_member_options ?t y

goal (1 subgoal):
 1. \<exists>z. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) z

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?newma = "(if ?xn = ma then
                                                    ?h * 2^(deg div 2) + the( vebt_maxt (?newlist ! ?h))
                                                            else ma)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
let ?delsimp =" (Node (Some (?xn, ?newma))  deg ?newlist summary)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = ?delsimp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
[PROOF STEP]
using del_x_mi_lets_in_not_minNull[of x mi ma deg ?xn ?h summary treeList ?l ?newnode ?newlist]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = mi \<and> x < ma; mi \<noteq> ma; 2 \<le> deg; high (summin * 2 ^ n + lx) (deg div 2) = high (summin * 2 ^ n + lx) n; summin * 2 ^ n + lx = the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))); low (summin * 2 ^ n + lx) (deg div 2) = low (summin * 2 ^ n + lx) n; high (summin * 2 ^ n + lx) (deg div 2) < length treeList; vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n) = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
[PROOF STEP]
using False \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)\<close> \<open>x = mi\<close> dp mimapr nat_less_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = mi \<and> x < ma; mi \<noteq> ma; 2 \<le> deg; high (summin * 2 ^ n + lx) (deg div 2) = high (summin * 2 ^ n + lx) n; summin * 2 ^ n + lx = the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))); low (summin * 2 ^ n + lx) (deg div 2) = low (summin * 2 ^ n + lx) n; high (summin * 2 ^ n + lx) (deg div 2) < length treeList; vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n) = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n); treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] = treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
\<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))
deg div 2 = n
high (summin * 2 ^ n + lx) n < length treeList
summin * 2 ^ n + lx = (if x = mi then the (vebt_mint summary) * 2 ^ (deg div 2) + the (vebt_mint (treeList ! the (vebt_mint summary))) else x)
x = mi
2 \<le> deg
mi < ma
(?m < ?n) = (?m \<le> ?n \<and> ?m \<noteq> ?n)

goal (1 subgoal):
 1. vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "both_member_options ?delsimp y
                      \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume ssms: "both_member_options ?delsimp y "
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aaaa: "y = ?xn \<or> y = ?newma \<or> (both_member_options (?newlist ! (high y n)) (low y n) \<and> high y n < length ?newlist)"
[PROOF STATE]
proof (prove)
using this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D \<open>deg div 2 = n\<close> both_member_options_def dp membermima.simps(4) naive_member.simps(3))
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show " x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "y = ?xn \<Longrightarrow>?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using \<open>x = mi\<close> minxnrel xnin
[PROOF STATE]
proof (prove)
using this:
x = mi
summin * 2 ^ n + lx \<noteq> mi
both_member_options (Node (Some (mi, ma)) deg treeList summary) (summin * 2 ^ n + lx)

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have " y = ?newma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume "y = ?newma"
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)

goal (1 subgoal):
 1. y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "?xn = ma")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx = ma

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence aaa:"?newma =?h * 2 ^ (deg div 2) +the(vebt_maxt(?newlist ! ?h))"
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx = ma

goal (1 subgoal):
 1. (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) = high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) = high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n))

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
obtain maxi where maxidef:"Some maxi = vebt_maxt(?newlist ! ?h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>maxi. Some maxi = vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis False hprolist vebt_maxt.elims minNull.simps(1) minNull.simps(4))
[PROOF STATE]
proof (state)
this:
Some maxi = vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have aa:"invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by (metis "5.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ab:"maxi \<noteq> ?l \<and> both_member_options ?newnode maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi
[PROOF STEP]
by (metis "5.IH"(1) \<open>high ?xn n < length treeList\<close> hprolist inthall maxbmo maxidef member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi
[PROOF STEP]
have ac:"maxi \<noteq> ?l \<and> both_member_options (treeList ! ?h)  maxi"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) maxi

goal (1 subgoal):
 1. maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi
[PROOF STEP]
by (metis "5.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence ad:"maxi < 2^n"
[PROOF STATE]
proof (prove)
using this:
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi

goal (1 subgoal):
 1. maxi < 2 ^ n
[PROOF STEP]
using \<open>invar_vebt (treeList ! high ?xn n) n\<close> member_bound valid_member_both_member_options
[PROOF STATE]
proof (prove)
using this:
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n
\<lbrakk>invar_vebt ?t ?n; both_member_options ?t ?x\<rbrakk> \<Longrightarrow> vebt_member ?t ?x

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

goal (2 subgoals):
 1. summin * 2 ^ n + lx = ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
maxi < 2 ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using  Suc_1 aaa \<open>y = ?newma\<close> ac add_leD1
                      both_member_options_from_chilf_to_complete_tree dp option.sel high_inv low_inv maxidef plus_1_eq_Suc
[PROOF STATE]
proof (prove)
using this:
maxi < 2 ^ n
Suc 1 = 2
(if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) = high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n))
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)
maxi \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) maxi
?m + ?k \<le> ?n \<Longrightarrow> ?m \<le> ?n
\<lbrakk>high ?x (?deg div 2) < length ?treeList; 1 \<le> ?deg; both_member_options (?treeList ! high ?x (?deg div 2)) (low ?x (?deg div 2))\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?x
2 \<le> deg
the (Some ?x2.0) = ?x2.0
?x < 2 ^ ?n \<Longrightarrow> high (?y * 2 ^ ?n + ?x) ?n = ?y
?x < 2 ^ ?n \<Longrightarrow> low (?y * 2 ^ ?n + ?x) ?n = ?x
Some maxi = vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)
(+) 1 = Suc

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis (no_types, lifting) True \<open>Some lx = vebt_mint (treeList ! summin)\<close>
                        \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close>
                        \<open>vebt_member (treeList ! summin) lx\<close> \<open>invar_vebt (treeList ! summin) n\<close>
                        \<open>x = mi\<close> leD member_bound mimapr mint_corr_help nat_add_left_cancel_le
                        valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. summin * 2 ^ n + lx \<noteq> ma \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summin * 2 ^ n + lx \<noteq> ma
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summin * 2 ^ n + lx \<noteq> ma

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis \<open>mi \<le> x \<and> x \<le> ma\<close> \<open>x = mi\<close> \<open>y = ?newma\<close> both_member_options_equiv_member leD vebt_maxt.simps(3) maxt_member mimapr tvalid)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "(both_member_options (?newlist ! (high y n)) (low y n)\<and> high y n < length ?newlist) \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
assume assmy:"(both_member_options (?newlist ! (high y n)) (low y n)\<and> high y n < length ?newlist)"
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = ?newnode"
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by (metis "5.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (2 subgoals):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
proof(cases "low y n= ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
 2. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "y = ?xn"
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
using "5.IH"(1) \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>treeList [high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)\<close> assmy
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n
\<forall>t\<in>set treeList. invar_vebt t n \<and> (\<forall>x xa. both_member_options (vebt_delete t x) xa = (x \<noteq> xa \<and> both_member_options t xa))
high (summin * 2 ^ n + lx) n < length treeList
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. y = summin * 2 ^ n + lx
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
y = summin * 2 ^ n + lx

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

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using calculation(1)
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l \<and> both_member_options (treeList ! ?h ) (low y n)"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)
[PROOF STEP]
by (metis "5.IH"(1) "5.hyps"(2) \<open>?newlist ! high y n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)\<close> \<open>vebt_member (treeList ! summin) lx\<close> \<open>summin < 2 ^ m\<close> high_inv inthall member_bound member_def)
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n \<and> both_member_options (treeList ! high (summin * 2 ^ n + lx) n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis "5.hyps"(2) "5.hyps"(9) Suc_1 Suc_leD True \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>mi \<le> x \<and> x \<le> ma\<close> \<open>x = mi\<close> both_member_options_from_chilf_to_complete_tree dp leD mimapr)
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "?newlist ! (high y n) = treeList !(high y n)"
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
using "5.hyps"(2) \<open>length treeList = length ?newlist\<close> assmy nothprolist
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n
length treeList = 2 ^ m
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
?i \<noteq> high (summin * 2 ^ n + lx) n \<and> ?i < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! ?i = treeList ! ?i

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "both_member_options (treeList !(high y n)) (low y n)"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

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

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
by (metis "5.hyps"(1) "5.hyps"(4) "5.hyps"(9) \<open>invar_vebt (treeList ! summin) n\<close> \<open>x < 2 ^ deg\<close> \<open>x = mi\<close> calculation deg_not_0 exp_split_high_low(1) mimapr not_less_iff_gr_or_eq)
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
have "high y n < length ?newlist"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
using assmy
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
hence "high y n < length treeList"
[PROOF STATE]
proof (prove)
using this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. high y n < length treeList
[PROOF STEP]
using \<open>length treeList = length ?newlist\<close>
[PROOF STATE]
proof (prove)
using this:
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
length treeList = length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. high y n < length treeList
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
high y n < length treeList

goal (1 subgoal):
 1. \<lbrakk>both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
both_member_options (treeList ! high y n) (low y n)
x \<noteq> y
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
high y n < length treeList
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (treeList ! high y n) (low y n)
x \<noteq> y
high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])
high y n < length treeList

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>deg div 2 = n\<close> both_member_options_from_chilf_to_complete_tree dp numerals(2))
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
using aaaa
[PROOF STATE]
proof (prove)
using this:
y = summin * 2 ^ n + lx \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
y = summin * 2 ^ n + lx \<or> y = (if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma) \<or> both_member_options (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n) (low y n) \<and> high y n < length (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
have "(x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)\<Longrightarrow>
                                both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
assume assm: "x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence abcv:"y = mi \<or> y = ma \<or> ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
[PROOF STEP]
by (metis Suc_1 \<open>deg div 2 = n\<close> add_leD1 both_member_options_from_complete_tree_to_child member_inv plus_1_eq_Suc tvalid valid_member_both_member_options)
[PROOF STATE]
proof (state)
this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
thus " both_member_options ?delsimp y"
[PROOF STATE]
proof (prove)
using this:
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have "y = mi \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
using \<open>x = mi\<close> assm
[PROOF STATE]
proof (prove)
using this:
x = mi
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y

goal (1 subgoal):
 1. y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have " y = ma \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (smt (z3) Suc_1 Suc_le_D both_member_options_def dp membermima.simps(4))
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have " ( high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n))
                                  \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
assume myass: "(  high y n < length treeList \<and> both_member_options (treeList ! (high y n)) (low y n)) "
[PROOF STATE]
proof (state)
this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof(cases "high y n = ?h")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
high y n = high (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n = high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high y n = high (summin * 2 ^ n + lx) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n = high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
proof(cases "low y n = ?l")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
low y n = low (summin * 2 ^ n + lx) n

goal (2 subgoals):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n = low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
 2. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
low y n = low (summin * 2 ^ n + lx) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
low y n = low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (smt (z3) "5.hyps"(3) "5.hyps"(4) Suc_1 \<open>deg div 2 = n\<close> \<open>length treeList = length (treeList [high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)])\<close> add_Suc_right add_leD1 bit_split_inv both_member_options_def both_member_options_from_chilf_to_complete_tree dp membermima.simps(4) myass nth_list_update_neq plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence "low y n \<noteq> ?l"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. low y n \<noteq> low (summin * 2 ^ n + lx) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence pp:"?newlist ! ?h = ?newnode"
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
using hprolist
[PROOF STATE]
proof (prove)
using this:
low y n \<noteq> low (summin * 2 ^ n + lx) n
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence "invar_vebt (treeList ! ?h) n"
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n = vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)

goal (1 subgoal):
 1. invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n
[PROOF STEP]
by (metis "5.IH"(1) \<open>high ?xn n < length treeList\<close> inthall member_def)
[PROOF STATE]
proof (state)
this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
hence "both_member_options ?newnode (low y n)"
[PROOF STATE]
proof (prove)
using this:
invar_vebt (treeList ! high (summin * 2 ^ n + lx) n) n

goal (1 subgoal):
 1. both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
by (metis "5.IH"(1) True \<open>high ?xn n < length treeList\<close> \<open>low y n \<noteq> low ?xn n\<close> in_set_member inthall myass)
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. \<lbrakk>high y n = high (summin * 2 ^ n + lx) n; low y n \<noteq> low (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
both_member_options (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)) (low y n)

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD True \<open>deg div 2 = n\<close> \<open>high (summin * 2 ^ n + lx) n < length treeList\<close> \<open>length treeList = length ?newlist\<close> both_member_options_from_chilf_to_complete_tree dp numerals(2) pp)
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
high y n \<noteq> high (summin * 2 ^ n + lx) n

goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
have pp:"?newlist ! (high y n) = treeList ! (high y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
using nothprolist[of "high y n"] False "5.hyps"(2) myass
[PROOF STATE]
proof (prove)
using this:
high y n \<noteq> high (summin * 2 ^ n + lx) n \<and> high y n < 2 ^ m \<Longrightarrow> treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
high y n \<noteq> high (summin * 2 ^ n + lx) n
length treeList = 2 ^ m
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)

goal (1 subgoal):
 1. treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. \<lbrakk>high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n); high y n \<noteq> high (summin * 2 ^ n + lx) n\<rbrakk> \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high y n = treeList ! high y n

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by (metis One_nat_def Suc_leD \<open>deg div 2 = n\<close> \<open>length treeList = length ?newlist\<close> abcv both_member_options_from_chilf_to_complete_tree calculation(1) calculation(2) dp numerals(2))
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
using abcv calculation(1) calculation(2)
[PROOF STATE]
proof (prove)
using this:
high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n) \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
y = mi \<or> y = ma \<or> high y n < length treeList \<and> both_member_options (treeList ! high y n) (low y n)
y = mi \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
y = ma \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. \<lbrakk>summin * 2 ^ n + lx \<noteq> mi; \<not> minNull (vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n))\<rbrakk> \<Longrightarrow> both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vebt_delete (Node (Some (mi, ma)) deg treeList summary) x = Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary
both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y \<Longrightarrow> x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y
x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y \<Longrightarrow> both_member_options (Node (Some (summin * 2 ^ n + lx, if summin * 2 ^ n + lx = ma then high (summin * 2 ^ n + lx) n * 2 ^ (deg div 2) + the (vebt_maxt (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)] ! high (summin * 2 ^ n + lx) n)) else ma)) deg (treeList[high (summin * 2 ^ n + lx) n := vebt_delete (treeList ! high (summin * 2 ^ n + lx) n) (low (summin * 2 ^ n + lx) n)]) summary) y

goal (1 subgoal):
 1. both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
both_member_options (vebt_delete (Node (Some (mi, ma)) deg treeList summary) x) y = (x \<noteq> y \<and> both_member_options (Node (Some (mi, ma)) deg treeList summary) y)

goal:
No subgoals!
[PROOF STEP]
qed