[STATEMENT]
lemma A_splay_ub: "\<lbrakk> bst t; Node l x r : subtrees t \<rbrakk>
  \<Longrightarrow> A_splay x t \<le> 3 * (\<phi> t - \<phi>(Node l x r)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bst t; \<langle>l, x, r\<rangle> \<in> subtrees t\<rbrakk> \<Longrightarrow> A_splay x t \<le> 3 * (\<phi> t - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
proof(induction x t rule: splay.induct)
[PROOF STATE]
proof (state)
goal (14 subgoals):
 1. \<And>x. \<lbrakk>bst \<langle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<rangle> \<le> 3 * (\<phi> \<langle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x AB CD. \<lbrakk>bst \<langle>AB, x, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, x, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, x, CD\<rangle> \<le> 3 * (\<phi> \<langle>AB, x, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 14 subgoals...
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
bst \<langle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<rangle>

goal (14 subgoals):
 1. \<And>x. \<lbrakk>bst \<langle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<rangle> \<le> 3 * (\<phi> \<langle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x AB CD. \<lbrakk>bst \<langle>AB, x, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, x, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, x, CD\<rangle> \<le> 3 * (\<phi> \<langle>AB, x, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 14 subgoals...
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
bst \<langle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<rangle>

goal (1 subgoal):
 1. A_splay x_ \<langle>\<rangle> \<le> 3 * (\<phi> \<langle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>\<rangle> \<le> 3 * (\<phi> \<langle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (13 subgoals):
 1. \<And>x AB CD. \<lbrakk>bst \<langle>AB, x, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, x, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, x, CD\<rangle> \<le> 3 * (\<phi> \<langle>AB, x, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 13 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (13 subgoals):
 1. \<And>x AB CD. \<lbrakk>bst \<langle>AB, x, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, x, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, x, CD\<rangle> \<le> 3 * (\<phi> \<langle>AB, x, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 13 subgoals...
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
bst \<langle>AB_, x_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, x_, CD_\<rangle>

goal (13 subgoals):
 1. \<And>x AB CD. \<lbrakk>bst \<langle>AB, x, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, x, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, x, CD\<rangle> \<le> 3 * (\<phi> \<langle>AB, x, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 13 subgoals...
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
bst \<langle>AB_, x_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, x_, CD_\<rangle>

goal (1 subgoal):
 1. A_splay x_ \<langle>AB_, x_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>AB_, x_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
by (auto simp: A_splay_def)
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>AB_, x_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>AB_, x_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (12 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 12 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (12 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 12 subgoals...
[PROOF STEP]
case 4
[PROOF STATE]
proof (state)
this:
x_ < b_
bst \<langle>\<langle>\<rangle>, b_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b_, CD_\<rangle>

goal (12 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 12 subgoals...
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
x_ < b_
bst \<langle>\<langle>\<rangle>, b_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b_, CD_\<rangle>

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

goal (12 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x b CD. \<lbrakk>x < b; bst \<langle>\<langle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 12 subgoals...
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. A_splay x_ \<langle>\<langle>\<rangle>, b_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>\<langle>\<rangle>, b_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<rangle>, b_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (11 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 11 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (11 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 11 subgoals...
[PROOF STEP]
case 5
[PROOF STATE]
proof (state)
this:
x_ < a_
x_ < b_
bst \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle>

goal (11 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 11 subgoals...
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
x_ < a_
x_ < b_
bst \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle>

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

goal (11 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b B CD. \<lbrakk>x < a; x < b; bst \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
A total of 11 subgoals...
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. A_splay x_ \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>\<langle>\<rangle>, a_, B_\<rangle>, b_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (10 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case 7
[PROOF STATE]
proof (state)
this:
a_ < x_
x_ < b_
bst \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle>

goal (10 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
a_ < x_
x_ < b_
bst \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle>

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

goal (10 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b A CD. \<lbrakk>a < x; x < b; bst \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, \<langle>\<rangle>\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 10. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. A_splay x_ \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A_, a_, \<langle>\<rangle>\<rangle>, b_, CD_\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (9 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case 10
[PROOF STATE]
proof (state)
this:
b_ < x_
bst \<langle>AB_, b_, \<langle>\<rangle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, b_, \<langle>\<rangle>\<rangle>

goal (9 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
b_ < x_
bst \<langle>AB_, b_, \<langle>\<rangle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, b_, \<langle>\<rangle>\<rangle>

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

goal (9 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x AB. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 9. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. A_splay x_ \<langle>AB_, b_, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB_, b_, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>AB_, b_, \<langle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB_, b_, \<langle>\<rangle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (8 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case 12
[PROOF STATE]
proof (state)
this:
b_ < x_
x_ < c_
bst \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle>

goal (8 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
b_ < x_
x_ < c_
bst \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle>

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

goal (8 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB D. \<lbrakk>b < x; x < c; bst \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>\<langle>\<rangle>, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 8. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. A_splay x_ \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB_, b_, \<langle>\<langle>\<rangle>, c_, D_\<rangle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (7 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case 13
[PROOF STATE]
proof (state)
this:
b_ < x_
c_ < x_
bst \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle>

goal (7 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
b_ < x_
c_ < x_
bst \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle>
\<langle>l, x_, r\<rangle> \<in> subtrees \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle>

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

goal (7 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>b x c AB C. \<lbrakk>b < x; c < x; bst \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 7. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. A_splay x_ \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A_splay x_ \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB_, b_, \<langle>C_, c_, \<langle>\<rangle>\<rangle>\<rangle> - \<phi> \<langle>l, x_, r\<rangle>) + 1

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case (3 x b A B CD)
[PROOF STATE]
proof (state)
this:
x < b
bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
(* A readable proof *)
[PROOF STATE]
proof (state)
this:
x < b
bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?t = "\<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>"
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?t' = "\<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle>"
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have *: "l = A \<and> r = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = A \<and> r = B
[PROOF STEP]
using "3.prems"
[PROOF STATE]
proof (prove)
using this:
bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>

goal (1 subgoal):
 1. l = A \<and> r = B
[PROOF STEP]
by(fastforce dest: in_set_tree_if)
[PROOF STATE]
proof (state)
this:
l = A \<and> r = B

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "A_splay x ?t = 1 + \<Phi> ?t' - \<Phi> ?t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> = 1 + \<Phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>
[PROOF STEP]
using "3.hyps"
[PROOF STATE]
proof (prove)
using this:
x < b

goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> = 1 + \<Phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>
[PROOF STEP]
by (simp add: A_splay_def)
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> = 1 + \<Phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> = 1 + \<Phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = 1 + \<phi> ?t' + \<phi> \<langle>B, b, CD\<rangle>  - \<phi> ?t - \<phi> \<langle>A, x, B\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + \<Phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> = 1 + \<phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
1 + \<Phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> = 1 + \<phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + \<Phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> = 1 + \<phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = 1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + \<phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> = 1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
1 + \<phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> = 1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + \<phi> \<langle>A, x, \<langle>B, b, CD\<rangle>\<rangle> + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> = 1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le>  1 + \<phi> ?t - \<phi>(Node A x B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> \<le> 1 + \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>
[PROOF STEP]
using log_le_cancel_iff[of 2 "size1(Node B b CD)" "size1 ?t"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < 2; 0 < real (size1 \<langle>B, b, CD\<rangle>); 0 < real (size1 \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>)\<rbrakk> \<Longrightarrow> (\<phi> \<langle>B, b, CD\<rangle> \<le> \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>) = (real (size1 \<langle>B, b, CD\<rangle>) \<le> real (size1 \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>))

goal (1 subgoal):
 1. 1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> \<le> 1 + \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> \<le> 1 + \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + \<phi> \<langle>B, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> \<le> 1 + \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le> 1 + 3 * (\<phi> ?t - \<phi>(Node A x B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> \<le> 1 + 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>)
[PROOF STEP]
using log_le_cancel_iff[of 2 "size1(Node A x B)" "size1 ?t"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < 2; 0 < real (size1 \<langle>A, x, B\<rangle>); 0 < real (size1 \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>)\<rbrakk> \<Longrightarrow> (\<phi> \<langle>A, x, B\<rangle> \<le> \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>) = (real (size1 \<langle>A, x, B\<rangle>) \<le> real (size1 \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>))

goal (1 subgoal):
 1. 1 + \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> \<le> 1 + 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
1 + \<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle> \<le> 1 + 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>)

goal (6 subgoals):
 1. \<And>x b A B CD. \<lbrakk>x < b; bst \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 6. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 1 + 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 1 + 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>)

goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 1 + 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>A, x, B\<rangle>)
l = A \<and> r = B

goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, x, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1

goal (5 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case (9 b x AB C D)
[PROOF STATE]
proof (state)
this:
b < x
bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>

goal (5 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
(* An automatic proof *)
[PROOF STATE]
proof (state)
this:
b < x
bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>

goal (5 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?A = "\<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "x \<notin> set_tree AB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> set_tree AB
[PROOF STEP]
using "9.prems"(1)
[PROOF STATE]
proof (prove)
using this:
bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>

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

goal (5 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x AB C D. \<lbrakk>b < x; bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 5. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
with 9
[PROOF STATE]
proof (chain)
picking this:
b < x
bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
x \<notin> set_tree AB
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
b < x
bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
x \<notin> set_tree AB

goal (1 subgoal):
 1. A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
using
    log_le_cancel_iff[of 2 "size1(Node AB b C)" "size1 ?A"]
    log_le_cancel_iff[of 2 "size1(Node C x D)" "size1 ?A"]
[PROOF STATE]
proof (prove)
using this:
b < x
bst \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>
x \<notin> set_tree AB
\<lbrakk>1 < 2; 0 < real (size1 \<langle>AB, b, C\<rangle>); 0 < real (size1 \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>)\<rbrakk> \<Longrightarrow> (\<phi> \<langle>AB, b, C\<rangle> \<le> \<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>) = (real (size1 \<langle>AB, b, C\<rangle>) \<le> real (size1 \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>))
\<lbrakk>1 < 2; 0 < real (size1 \<langle>C, x, D\<rangle>); 0 < real (size1 \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>)\<rbrakk> \<Longrightarrow> (\<phi> \<langle>C, x, D\<rangle> \<le> \<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>) = (real (size1 \<langle>C, x, D\<rangle>) \<le> real (size1 \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle>))

goal (1 subgoal):
 1. A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
by (auto simp: A_splay_def algebra_simps simp del:log_le_cancel_iff)
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, x, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case (6 x a b A B C)
[PROOF STATE]
proof (state)
this:
x < a
x < b
A \<noteq> \<langle>\<rangle>
\<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence *: "\<langle>l, x, r\<rangle> \<in> subtrees A"
[PROOF STATE]
proof (prove)
using this:
x < a
x < b
A \<noteq> \<langle>\<rangle>
\<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (1 subgoal):
 1. \<langle>l, x, r\<rangle> \<in> subtrees A
[PROOF STEP]
by(fastforce dest: in_set_tree_if)
[PROOF STATE]
proof (state)
this:
\<langle>l, x, r\<rangle> \<in> subtrees A

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
obtain A1 a' A2 where sp: "splay x A = Node A1 a' A2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A1 a' A2. splay x A = \<langle>A1, a', A2\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using splay_not_Leaf[OF \<open>A \<noteq> Leaf\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>l x r. splay ?a A = \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<And>A1 a' A2. splay x A = \<langle>A1, a', A2\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
splay x A = \<langle>A1, a', A2\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?X = "Node l x r"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?AB = "Node A a B"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?ABC = "Node ?AB b C"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?A' = "Node A1 a' A2"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?BC = "Node B b C"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?A2BC = "Node A2 a ?BC"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?A1A2BC = "Node A1 a' ?A2BC"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have 0: "\<phi> ?A1A2BC = \<phi> ?ABC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x A = \<langle>A1, a', A2\<rangle>

goal (1 subgoal):
 1. \<phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
\<phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have 1: "\<Phi> ?A1A2BC - \<Phi> ?ABC = \<Phi> A1 + \<Phi> A2 + \<phi> ?A2BC + \<phi> ?BC - \<Phi> A - \<phi> ?AB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
\<phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (1 subgoal):
 1. \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
\<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "A_splay x ?ABC = T_splay x A + 1 + \<Phi> ?A1A2BC - \<Phi> ?ABC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
using "6.hyps" sp
[PROOF STATE]
proof (prove)
using this:
x < a
x < b
A \<noteq> \<langle>\<rangle>
splay x A = \<langle>A1, a', A2\<rangle>

goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
by(simp add: A_splay_def)
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = T_splay x A + 1 + \<Phi> A1 + \<Phi> A2 + \<phi> ?A2BC + \<phi> ?BC - \<Phi> A - \<phi> ?AB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
\<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>

goal (1 subgoal):
 1. real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (T_splay x A + 1) + \<Phi> \<langle>A1, a', \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x A + 1) + \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle>

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = T_splay x A + \<Phi> ?A' - \<phi> ?A' - \<Phi> A + \<phi> ?A2BC + \<phi> ?BC - \<phi> ?AB + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_splay x A + 1) + \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle> = real (T_splay x A) + \<Phi> \<langle>A1, a', A2\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - \<Phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
real (T_splay x A + 1) + \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle> = real (T_splay x A) + \<Phi> \<langle>A1, a', A2\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - \<Phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (T_splay x A + 1) + \<Phi> A1 + \<Phi> A2 + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<Phi> A - \<phi> \<langle>A, a, B\<rangle> = real (T_splay x A) + \<Phi> \<langle>A1, a', A2\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - \<Phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = A_splay x A + \<phi> ?A2BC + \<phi> ?BC - \<phi> ?AB - \<phi> ?A' + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_splay x A) + \<Phi> \<langle>A1, a', A2\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - \<Phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x A = \<langle>A1, a', A2\<rangle>

goal (1 subgoal):
 1. real (T_splay x A) + \<Phi> \<langle>A1, a', A2\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - \<Phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1
[PROOF STEP]
by(simp add: A_splay_def)
[PROOF STATE]
proof (state)
this:
real (T_splay x A) + \<Phi> \<langle>A1, a', A2\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - \<Phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (T_splay x A) + \<Phi> \<langle>A1, a', A2\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - \<Phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le> 3 * \<phi> A + \<phi> ?A2BC + \<phi> ?BC - \<phi> ?AB - \<phi> ?A' - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1 \<le> 3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
using "6.IH" "6.prems"(1) *
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees A

goal (1 subgoal):
 1. A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1 \<le> 3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1 \<le> 3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A_splay x A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> + 1 \<le> 3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = 2 * \<phi> A + \<phi> ?A2BC + \<phi> ?BC - \<phi> ?AB - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x A = \<langle>A1, a', A2\<rangle>

goal (1 subgoal):
 1. 3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>A1, a', A2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> < \<phi> A + \<phi> ?A2BC + \<phi> ?BC - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
2 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> < \<phi> ?A2BC + 2 * \<phi> ?ABC - 3 * \<phi> ?X + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
using sp ld_ld_1_less[of "size1 A" "size1 ?BC"]
[PROOF STATE]
proof (prove)
using this:
splay x A = \<langle>A1, a', A2\<rangle>
\<lbrakk>0 < real (size1 A); 0 < real (size1 \<langle>B, b, C\<rangle>)\<rbrakk> \<Longrightarrow> 1 + \<phi> A + \<phi> \<langle>B, b, C\<rangle> < 2 * log 2 (real (size1 A) + real (size1 \<langle>B, b, C\<rangle>))

goal (1 subgoal):
 1. \<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
\<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<phi> A + \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + \<phi> \<langle>B, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> < 3 * \<phi> ?ABC - 3 * \<phi> ?X + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1 < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x A = \<langle>A1, a', A2\<rangle>

goal (1 subgoal):
 1. \<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1 < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
\<phi> \<langle>A2, a, \<langle>B, b, C\<rangle>\<rangle> + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1 < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (4 subgoals):
 1. \<And>x a b A B CD. \<lbrakk>x < a; x < b; A \<noteq> \<langle>\<rangle>; \<lbrakk>bst A; \<langle>l, x, r\<rangle> \<in> subtrees A\<rbrakk> \<Longrightarrow> A_splay x A \<le> 3 * (\<phi> A - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 4. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case (8 a x b B A C)
[PROOF STATE]
proof (state)
this:
a < x
x < b
B \<noteq> \<langle>\<rangle>
\<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence *: "\<langle>l, x, r\<rangle> \<in> subtrees B"
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
B \<noteq> \<langle>\<rangle>
\<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (1 subgoal):
 1. \<langle>l, x, r\<rangle> \<in> subtrees B
[PROOF STEP]
by(fastforce dest: in_set_tree_if)
[PROOF STATE]
proof (state)
this:
\<langle>l, x, r\<rangle> \<in> subtrees B

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
obtain B1 b' B2 where sp: "splay x B = Node B1 b' B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B1 b' B2. splay x B = \<langle>B1, b', B2\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using splay_not_Leaf[OF \<open>B \<noteq> Leaf\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>l x r. splay ?a B = \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<And>B1 b' B2. splay x B = \<langle>B1, b', B2\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
splay x B = \<langle>B1, b', B2\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?X = "Node l x r"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?AB = "Node A a B"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?ABC = "Node ?AB b C"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?B' = "Node B1 b' B2"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?AB1 = "Node A a B1"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?B2C = "Node B2 b C"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?AB1B2C = "Node ?AB1 b' ?B2C"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have 0: "\<phi> ?AB1B2C = \<phi> ?ABC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x B = \<langle>B1, b', B2\<rangle>

goal (1 subgoal):
 1. \<phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
\<phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have 1: "\<Phi> ?AB1B2C - \<Phi> ?ABC = \<Phi> B1 + \<Phi> B2 + \<phi> ?AB1 + \<phi> ?B2C - \<Phi> B - \<phi> ?AB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
\<phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> = \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (1 subgoal):
 1. \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
\<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "A_splay x ?ABC = T_splay x B + 1 + \<Phi> ?AB1B2C - \<Phi> ?ABC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
using "8.hyps" sp
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
B \<noteq> \<langle>\<rangle>
splay x B = \<langle>B1, b', B2\<rangle>

goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
[PROOF STEP]
by(simp add: A_splay_def)
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = T_splay x B + 1 + \<Phi> B1 + \<Phi> B2 + \<phi> ?AB1 + \<phi> ?B2C - \<Phi> B - \<phi> ?AB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
\<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>

goal (1 subgoal):
 1. real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (T_splay x B + 1) + \<Phi> \<langle>\<langle>A, a, B1\<rangle>, b', \<langle>B2, b, C\<rangle>\<rangle> - \<Phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> = real (T_splay x B + 1) + \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle>

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = T_splay x B + \<Phi> ?B' - \<phi> ?B' - \<Phi> B + \<phi> ?AB1 + \<phi> ?B2C - \<phi> ?AB + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_splay x B + 1) + \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle> = real (T_splay x B) + \<Phi> \<langle>B1, b', B2\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - \<Phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (T_splay x B + 1) + \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle> = real (T_splay x B) + \<Phi> \<langle>B1, b', B2\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - \<Phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (T_splay x B + 1) + \<Phi> B1 + \<Phi> B2 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<Phi> B - \<phi> \<langle>A, a, B\<rangle> = real (T_splay x B) + \<Phi> \<langle>B1, b', B2\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - \<Phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = A_splay x B + \<phi> ?AB1 + \<phi> ?B2C - \<phi> ?AB - \<phi> ?B' + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (T_splay x B) + \<Phi> \<langle>B1, b', B2\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - \<Phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x B = \<langle>B1, b', B2\<rangle>

goal (1 subgoal):
 1. real (T_splay x B) + \<Phi> \<langle>B1, b', B2\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - \<Phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1
[PROOF STEP]
by (simp add: A_splay_def)
[PROOF STATE]
proof (state)
this:
real (T_splay x B) + \<Phi> \<langle>B1, b', B2\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - \<Phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (T_splay x B) + \<Phi> \<langle>B1, b', B2\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - \<Phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> + 1 = A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le> 3 * \<phi> B + \<phi> ?AB1 + \<phi> ?B2C - \<phi> ?AB - \<phi> ?B' - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1 \<le> 3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
using "8.IH" "8.prems"(1) *
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees B

goal (1 subgoal):
 1. A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1 \<le> 3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1 \<le> 3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A_splay x B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> + 1 \<le> 3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = 2 * \<phi> B + \<phi> ?AB1 + \<phi> ?B2C - \<phi> ?AB - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x B = \<langle>B1, b', B2\<rangle>

goal (1 subgoal):
 1. 3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - \<phi> \<langle>B1, b', B2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> < \<phi> B + \<phi> ?AB1 + \<phi> ?B2C - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
2 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - \<phi> \<langle>A, a, B\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> < \<phi> B + 2 * \<phi> ?ABC - 3 * \<phi> ?X + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> B + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
using sp ld_ld_1_less[of "size1 ?AB1" "size1 ?B2C"]
[PROOF STATE]
proof (prove)
using this:
splay x B = \<langle>B1, b', B2\<rangle>
\<lbrakk>0 < real (size1 \<langle>A, a, B1\<rangle>); 0 < real (size1 \<langle>B2, b, C\<rangle>)\<rbrakk> \<Longrightarrow> 1 + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> < 2 * log 2 (real (size1 \<langle>A, a, B1\<rangle>) + real (size1 \<langle>B2, b, C\<rangle>))

goal (1 subgoal):
 1. \<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> B + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
\<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> B + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<phi> B + \<phi> \<langle>A, a, B1\<rangle> + \<phi> \<langle>B2, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 < \<phi> B + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> < 3 * \<phi> ?ABC - 3 * \<phi> ?X + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> B + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1 < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
\<phi> B + 2 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1 < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (3 subgoals):
 1. \<And>a x b B A CD. \<lbrakk>a < x; x < b; B \<noteq> \<langle>\<rangle>; \<lbrakk>bst B; \<langle>l, x, r\<rangle> \<in> subtrees B\<rbrakk> \<Longrightarrow> A_splay x B \<le> 3 * (\<phi> B - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 3. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> < 3 * \<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (1 subgoal):
 1. A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>A, a, B\<rangle>, b, C\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case (11 b x c C A D)
[PROOF STATE]
proof (state)
this:
b < x
x < c
C \<noteq> \<langle>\<rangle>
\<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle>

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence *: "\<langle>l, x, r\<rangle> \<in> subtrees C"
[PROOF STATE]
proof (prove)
using this:
b < x
x < c
C \<noteq> \<langle>\<rangle>
\<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle>

goal (1 subgoal):
 1. \<langle>l, x, r\<rangle> \<in> subtrees C
[PROOF STEP]
by(fastforce dest: in_set_tree_if)
[PROOF STATE]
proof (state)
this:
\<langle>l, x, r\<rangle> \<in> subtrees C

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
obtain C1 c' C2 where sp: "splay x C = Node C1 c' C2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C1 c' C2. splay x C = \<langle>C1, c', C2\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using splay_not_Leaf[OF \<open>C \<noteq> Leaf\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>l x r. splay ?a C = \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<And>C1 c' C2. splay x C = \<langle>C1, c', C2\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
splay x C = \<langle>C1, c', C2\<rangle>

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?X = "Node l x r"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?CD = "Node C c D"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?ACD = "Node A b ?CD"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?C' = "Node C1 c' C2"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?C2D = "Node C2 c D"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
let ?AC1 = "Node A b C1"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "A_splay x ?ACD = A_splay x C + \<phi> ?C2D + \<phi> ?AC1 - \<phi> ?CD - \<phi> ?C' + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> = A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1
[PROOF STEP]
using "11.hyps" sp
[PROOF STATE]
proof (prove)
using this:
b < x
x < c
C \<noteq> \<langle>\<rangle>
splay x C = \<langle>C1, c', C2\<rangle>

goal (1 subgoal):
 1. A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> = A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1
[PROOF STEP]
by(auto simp: A_splay_def size_if_splay algebra_simps split: tree.split)
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> = A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> = A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le> 3 * \<phi> C + \<phi> ?C2D + \<phi> ?AC1 - \<phi> ?CD - \<phi> ?C' - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1 \<le> 3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
using "11.IH" "11.prems"(1) *
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees C

goal (1 subgoal):
 1. A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1 \<le> 3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1 \<le> 3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A_splay x C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> + 1 \<le> 3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> = 2 * \<phi> C + \<phi> ?C2D + \<phi> ?AC1 - \<phi> ?CD - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
splay x C = \<langle>C1, c', C2\<rangle>

goal (1 subgoal):
 1. 3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp add: size_if_splay)
[PROOF STATE]
proof (state)
this:
3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - \<phi> \<langle>C1, c', C2\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 = 2 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le> \<phi> C + \<phi> ?C2D + \<phi> ?AC1 - 3 * \<phi> ?X + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 \<le> \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
2 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 \<le> \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - \<phi> \<langle>C, c, D\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 \<le> \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le> \<phi> C + 2 * \<phi> ?ACD - 3 * \<phi> ?X + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 \<le> \<phi> C + 2 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
using sp ld_ld_1_less[of "size1 ?C2D" "size1 ?AC1"]
[PROOF STATE]
proof (prove)
using this:
splay x C = \<langle>C1, c', C2\<rangle>
\<lbrakk>0 < real (size1 \<langle>C2, c, D\<rangle>); 0 < real (size1 \<langle>A, b, C1\<rangle>)\<rbrakk> \<Longrightarrow> 1 + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> < 2 * log 2 (real (size1 \<langle>C2, c, D\<rangle>) + real (size1 \<langle>A, b, C1\<rangle>))

goal (1 subgoal):
 1. \<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 \<le> \<phi> C + 2 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
by(simp add: size_if_splay algebra_simps)
[PROOF STATE]
proof (state)
this:
\<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 \<le> \<phi> C + 2 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<phi> C + \<phi> \<langle>C2, c, D\<rangle> + \<phi> \<langle>A, b, C1\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 2 \<le> \<phi> C + 2 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
have "\<dots> \<le> 3 * \<phi> ?ACD - 3 * \<phi> ?X + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> C + 2 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1 \<le> 3 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
\<phi> C + 2 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1 \<le> 3 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (2 subgoals):
 1. \<And>b x c C AB D. \<lbrakk>b < x; x < c; C \<noteq> \<langle>\<rangle>; \<lbrakk>bst C; \<langle>l, x, r\<rangle> \<in> subtrees C\<rbrakk> \<Longrightarrow> A_splay x C \<le> 3 * (\<phi> C - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
 2. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * \<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - 3 * \<phi> \<langle>l, x, r\<rangle> + 1

goal (1 subgoal):
 1. A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>A, b, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1

goal (1 subgoal):
 1. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
case (14 a x b CD A B)
[PROOF STATE]
proof (state)
this:
a < x
b < x
CD \<noteq> \<langle>\<rangle>
\<lbrakk>bst CD; \<langle>l, x, r\<rangle> \<in> subtrees CD\<rbrakk> \<Longrightarrow> A_splay x CD \<le> 3 * (\<phi> CD - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>

goal (1 subgoal):
 1. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence 0: "x \<notin> set_tree B \<and> x \<notin> set_tree A"
[PROOF STATE]
proof (prove)
using this:
a < x
b < x
CD \<noteq> \<langle>\<rangle>
\<lbrakk>bst CD; \<langle>l, x, r\<rangle> \<in> subtrees CD\<rbrakk> \<Longrightarrow> A_splay x CD \<le> 3 * (\<phi> CD - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>

goal (1 subgoal):
 1. x \<notin> set_tree B \<and> x \<notin> set_tree A
[PROOF STEP]
using "14.prems"(1) \<open>b<x\<close>
[PROOF STATE]
proof (prove)
using this:
a < x
b < x
CD \<noteq> \<langle>\<rangle>
\<lbrakk>bst CD; \<langle>l, x, r\<rangle> \<in> subtrees CD\<rbrakk> \<Longrightarrow> A_splay x CD \<le> 3 * (\<phi> CD - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
bst \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
b < x

goal (1 subgoal):
 1. x \<notin> set_tree B \<and> x \<notin> set_tree A
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
x \<notin> set_tree B \<and> x \<notin> set_tree A

goal (1 subgoal):
 1. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
hence 1: "x \<in> set_tree CD"
[PROOF STATE]
proof (prove)
using this:
x \<notin> set_tree B \<and> x \<notin> set_tree A

goal (1 subgoal):
 1. x \<in> set_tree CD
[PROOF STEP]
using "14.prems" \<open>b<x\<close> \<open>a<x\<close>
[PROOF STATE]
proof (prove)
using this:
x \<notin> set_tree B \<and> x \<notin> set_tree A
bst \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
b < x
a < x

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

goal (1 subgoal):
 1. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
obtain C c D where sp: "splay x CD = Node C c D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C c D. splay x CD = \<langle>C, c, D\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using splay_not_Leaf[OF \<open>CD \<noteq> Leaf\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>l x r. splay ?a CD = \<langle>l, x, r\<rangle>

goal (1 subgoal):
 1. (\<And>C c D. splay x CD = \<langle>C, c, D\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
splay x CD = \<langle>C, c, D\<rangle>

goal (1 subgoal):
 1. \<And>a x c D AB C. \<lbrakk>a < x; c < x; D \<noteq> \<langle>\<rangle>; \<lbrakk>bst D; \<langle>l, x, r\<rangle> \<in> subtrees D\<rbrakk> \<Longrightarrow> A_splay x D \<le> 3 * (\<phi> D - \<phi> \<langle>l, x, r\<rangle>) + 1; bst \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>; \<langle>l, x, r\<rangle> \<in> subtrees \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle>\<rbrakk> \<Longrightarrow> A_splay x \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>AB, a, \<langle>C, c, D\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
from zig_zig[of CD x D C l r _ b B a A] 14 sp 0
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>CD \<noteq> \<langle>\<rangle>; real (T_splay x CD) + \<Phi> D + \<Phi> C - \<Phi> CD \<le> 2 * \<phi> CD - 3 * \<phi> \<langle>l, x, r\<rangle> + 1; size CD = size D + size C + 1; \<langle>l, x, r\<rangle> \<in> subtrees CD\<rbrakk> \<Longrightarrow> real (T_splay x CD) + \<Phi> \<langle>D, ?u, \<langle>C, b, \<langle>B, a, A\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>CD, b, B\<rangle>, a, A\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>CD, b, B\<rangle>, a, A\<rangle> - \<phi> \<langle>l, x, r\<rangle>)
a < x
b < x
CD \<noteq> \<langle>\<rangle>
\<lbrakk>bst CD; \<langle>l, x, r\<rangle> \<in> subtrees CD\<rbrakk> \<Longrightarrow> A_splay x CD \<le> 3 * (\<phi> CD - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
splay x CD = \<langle>C, c, D\<rangle>
x \<notin> set_tree B \<and> x \<notin> set_tree A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>CD \<noteq> \<langle>\<rangle>; real (T_splay x CD) + \<Phi> D + \<Phi> C - \<Phi> CD \<le> 2 * \<phi> CD - 3 * \<phi> \<langle>l, x, r\<rangle> + 1; size CD = size D + size C + 1; \<langle>l, x, r\<rangle> \<in> subtrees CD\<rbrakk> \<Longrightarrow> real (T_splay x CD) + \<Phi> \<langle>D, ?u, \<langle>C, b, \<langle>B, a, A\<rangle>\<rangle>\<rangle> - \<Phi> \<langle>\<langle>CD, b, B\<rangle>, a, A\<rangle> \<le> 3 * (\<phi> \<langle>\<langle>CD, b, B\<rangle>, a, A\<rangle> - \<phi> \<langle>l, x, r\<rangle>)
a < x
b < x
CD \<noteq> \<langle>\<rangle>
\<lbrakk>bst CD; \<langle>l, x, r\<rangle> \<in> subtrees CD\<rbrakk> \<Longrightarrow> A_splay x CD \<le> 3 * (\<phi> CD - \<phi> \<langle>l, x, r\<rangle>) + 1
bst \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
\<langle>l, x, r\<rangle> \<in> subtrees \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle>
splay x CD = \<langle>C, c, D\<rangle>
x \<notin> set_tree B \<and> x \<notin> set_tree A

goal (1 subgoal):
 1. A_splay x \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1
[PROOF STEP]
by(auto simp: A_splay_def size_if_splay algebra_simps)
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1

goal:
No subgoals!
[PROOF STEP]
(* The explicit version:
  have "A_splay x ?A = A_splay x ?R + \<phi> ?B' + \<phi> ?A' - \<phi> ?B - \<phi> ?R' + 1"
    using "14.prems" 1 sp
    by(auto simp: A_splay_def size_if_splay algebra_simps split: tree.split)
  also have "\<dots> \<le> 3 * \<phi> ?R + \<phi> ?B' + \<phi> ?A' - \<phi> ?B - \<phi> ?R' - 3 * \<phi> ?X + 2"
    using 14 0 by(auto simp: algebra_simps)
  also have "\<dots> = 2 * \<phi> rb + \<phi> ?B' + \<phi> ?A' - \<phi> ?B - 3 * \<phi> ?X + 2"
    using sp by(simp add: size_if_splay)
  also have "\<dots> \<le> \<phi> ?R + \<phi> ?B' + \<phi> ?A' - 3 * \<phi> ?X + 2" by(simp)
  also have "\<dots> \<le> \<phi> ?B' + 2 * \<phi> ?A - 3 * \<phi> ?X + 1"
    using sp ld_ld_1_less[of "size1 ?R" "size1 ?A'"]
    by(simp add: size_if_splay algebra_simps)
  also have "\<dots> \<le> 3 * \<phi> ?A - 3 * \<phi> ?X + 1"
    using sp by(simp add: size_if_splay)
  finally show ?case by simp
*)
[PROOF STATE]
proof (state)
this:
A_splay x \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle> \<le> 3 * (\<phi> \<langle>A, a, \<langle>B, b, CD\<rangle>\<rangle> - \<phi> \<langle>l, x, r\<rangle>) + 1

goal:
No subgoals!
[PROOF STEP]
qed