[STATEMENT]
lemma integral_minus[simp]: "integral\<^sup>L M (\<lambda>x. - f x) = - integral\<^sup>L M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. - f x = - integral\<^sup>L M f
[PROOF STEP]
by (rule integral_bounded_linear'[OF bounded_linear_minus[OF bounded_linear_ident] bounded_linear_minus[OF bounded_linear_ident]]) simp


[STATEMENT]
theorem avl_delete:
  assumes "avl t"
  shows "avl(delete x t)" and "height t = (height (delete x t)) \<or> height t = height (delete x t) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. avl (AVL_Map.delete x t) &&& height t = height (AVL_Map.delete x t) \<or> height t = height (AVL_Map.delete x t) + 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
avl t

goal (1 subgoal):
 1. avl (AVL_Map.delete x t) &&& height t = height (AVL_Map.delete x t) \<or> height t = height (AVL_Map.delete x t) + 1
[PROOF STEP]
proof (induct t rule: tree2_induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Map.delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) \<or> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) + 1
 3. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> avl (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>)
 4. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) \<or> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) + 1
[PROOF STEP]
case (Node l ab h r)
[PROOF STATE]
proof (state)
this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1

goal (4 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Map.delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) \<or> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) + 1
 3. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> avl (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>)
 4. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) \<or> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) + 1
[PROOF STEP]
obtain a b where [simp]: "ab = (a,b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. ab = (a, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
ab = (a, b)

goal (4 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Map.delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) \<or> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) + 1
 3. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> avl (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>)
 4. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) \<or> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) + 1
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
avl \<langle>l, (ab, h), r\<rangle>

goal (4 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Map.delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) \<or> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) + 1
 3. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> avl (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>)
 4. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) \<or> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
proof(cases "x = a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
 2. x \<noteq> a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = a

goal (2 subgoals):
 1. x = a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
 2. x \<noteq> a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
with Node 1
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x = a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x = a

goal (1 subgoal):
 1. avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
using avl_split_max[of l]
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x = a
\<lbrakk>avl l; l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> avl (fst (split_max l)) \<and> height l \<in> {height (fst (split_max l)), height (fst (split_max l)) + 1}

goal (1 subgoal):
 1. avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
by (auto intro!: avl_balR split: prod.split)
[PROOF STATE]
proof (state)
this:
avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> a

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
proof(cases "x<a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
 2. \<not> x < a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < a

goal (2 subgoals):
 1. x < a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
 2. \<not> x < a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
with Node 1
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x < a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x < a

goal (1 subgoal):
 1. avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
by (auto intro!: avl_balR)
[PROOF STATE]
proof (state)
this:
avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)

goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < a

goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
with Node 1 \<open>x\<noteq>a\<close>
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x \<noteq> a
\<not> x < a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x \<noteq> a
\<not> x < a

goal (1 subgoal):
 1. avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)
[PROOF STEP]
by (auto intro!: avl_balL)
[PROOF STATE]
proof (state)
this:
avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
avl (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>)

goal (3 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Map.delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) \<or> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) + 1
 3. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) \<or> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) + 1
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
avl \<langle>l, (ab, h), r\<rangle>

goal (3 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Map.delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) \<or> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) + 1
 3. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (AVL_Map.delete x x1); avl x1 \<Longrightarrow> height x1 = height (AVL_Map.delete x x1) \<or> height x1 = height (AVL_Map.delete x x1) + 1; avl x3 \<Longrightarrow> avl (AVL_Map.delete x x3); avl x3 \<Longrightarrow> height x3 = height (AVL_Map.delete x x3) \<or> height x3 = height (AVL_Map.delete x x3) + 1; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) \<or> height \<langle>x1, (a, b), x3\<rangle> = height (AVL_Map.delete x \<langle>x1, (a, b), x3\<rangle>) + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
proof(cases "x = a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. x \<noteq> a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = a

goal (2 subgoals):
 1. x = a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. x \<noteq> a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = a

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
using 1 avl_split_max[of l]
[PROOF STATE]
proof (prove)
using this:
x = a
avl \<langle>l, (ab, h), r\<rangle>
\<lbrakk>avl l; l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> avl (fst (split_max l)) \<and> height l \<in> {height (fst (split_max l)), height (fst (split_max l)) + 1}

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
by(auto simp: balR_def max_absorb2 split!: if_splits prod.split tree.split)
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> a

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
proof(cases "x<a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. \<not> x < a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < a

goal (2 subgoals):
 1. x < a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. \<not> x < a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
proof(cases "height r = height (delete x l) + 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height r = height (AVL_Map.delete x l) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. height r \<noteq> height (AVL_Map.delete x l) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
height r \<noteq> height (AVL_Map.delete x l) + 2

goal (2 subgoals):
 1. height r = height (AVL_Map.delete x l) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. height r \<noteq> height (AVL_Map.delete x l) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
with Node 1 \<open>x < a\<close>
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x < a
height r \<noteq> height (AVL_Map.delete x l) + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
x < a
height r \<noteq> height (AVL_Map.delete x l) + 2

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
by(auto simp: balR_def)
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal (1 subgoal):
 1. height r = height (AVL_Map.delete x l) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. height r = height (AVL_Map.delete x l) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
height r = height (AVL_Map.delete x l) + 2

goal (1 subgoal):
 1. height r = height (AVL_Map.delete x l) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
height r = height (AVL_Map.delete x l) + 2

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
using height_balR[OF _ _ True, of ab] 2 Node(1,2) \<open>x < a\<close>
[PROOF STATE]
proof (prove)
using this:
height r = height (AVL_Map.delete x l) + 2
\<lbrakk>avl (AVL_Map.delete x l); avl r\<rbrakk> \<Longrightarrow> height (balR (AVL_Map.delete x l) ab r) \<in> {height (AVL_Map.delete x l) + 2, height (AVL_Map.delete x l) + 3}
avl \<langle>l, (ab, h), r\<rangle>
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
x < a

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
by simp linarith
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < a

goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
proof(cases "height l = height (delete x r) + 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height l = height (AVL_Map.delete x r) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. height l \<noteq> height (AVL_Map.delete x r) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
height l \<noteq> height (AVL_Map.delete x r) + 2

goal (2 subgoals):
 1. height l = height (AVL_Map.delete x r) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
 2. height l \<noteq> height (AVL_Map.delete x r) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
with Node 1 \<open>\<not>x < a\<close> \<open>x \<noteq> a\<close>
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
\<not> x < a
x \<noteq> a
height l \<noteq> height (AVL_Map.delete x r) + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL_Map.delete x l)
avl l \<Longrightarrow> height l = height (AVL_Map.delete x l) \<or> height l = height (AVL_Map.delete x l) + 1
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
avl \<langle>l, (ab, h), r\<rangle>
\<not> x < a
x \<noteq> a
height l \<noteq> height (AVL_Map.delete x r) + 2

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
by(auto simp: balL_def)
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal (1 subgoal):
 1. height l = height (AVL_Map.delete x r) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. height l = height (AVL_Map.delete x r) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
height l = height (AVL_Map.delete x r) + 2

goal (1 subgoal):
 1. height l = height (AVL_Map.delete x r) + 2 \<Longrightarrow> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
height l = height (AVL_Map.delete x r) + 2

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
using height_balL[OF _ _ True, of ab] 2 Node(3,4) \<open>\<not>x < a\<close> \<open>x \<noteq> a\<close>
[PROOF STATE]
proof (prove)
using this:
height l = height (AVL_Map.delete x r) + 2
\<lbrakk>avl l; avl (AVL_Map.delete x r)\<rbrakk> \<Longrightarrow> height (balL l ab (AVL_Map.delete x r)) \<in> {height (AVL_Map.delete x r) + 2, height (AVL_Map.delete x r) + 3}
avl \<langle>l, (ab, h), r\<rangle>
avl r \<Longrightarrow> avl (AVL_Map.delete x r)
avl r \<Longrightarrow> height r = height (AVL_Map.delete x r) \<or> height r = height (AVL_Map.delete x r) + 1
\<not> x < a
x \<noteq> a

goal (1 subgoal):
 1. height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) \<or> height \<langle>l, (ab, h), r\<rangle> = height (AVL_Map.delete x \<langle>l, (ab, h), r\<rangle>) + 1

goal (2 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (AVL_Map.delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) \<or> height \<langle>\<rangle> = height (AVL_Map.delete x \<langle>\<rangle>) + 1
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma (in transitive_action) all_equivalent:
  "\<lbrakk> x \<in> E; y \<in> E \<rbrakk> \<Longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y
[PROOF STEP]
assume "x \<in> E" "y \<in> E"
[PROOF STATE]
proof (state)
this:
x \<in> E
y \<in> E

goal (1 subgoal):
 1. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y
[PROOF STEP]
hence "\<exists> g \<in> carrier G. (\<phi> g) x = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> E
y \<in> E

goal (1 subgoal):
 1. \<exists>g\<in>carrier G. \<phi> g x = y
[PROOF STEP]
using unique_orbit
[PROOF STATE]
proof (prove)
using this:
x \<in> E
y \<in> E
\<lbrakk>?x \<in> E; ?y \<in> E\<rbrakk> \<Longrightarrow> \<exists>g\<in>carrier G. \<phi> g ?x = ?y

goal (1 subgoal):
 1. \<exists>g\<in>carrier G. \<phi> g x = y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g\<in>carrier G. \<phi> g x = y

goal (1 subgoal):
 1. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y
[PROOF STEP]
hence "y \<in> orbit G \<phi> x"
[PROOF STATE]
proof (prove)
using this:
\<exists>g\<in>carrier G. \<phi> g x = y

goal (1 subgoal):
 1. y \<in> orbit G \<phi> x
[PROOF STEP]
using orbit_def
[PROOF STATE]
proof (prove)
using this:
\<exists>g\<in>carrier G. \<phi> g x = y
orbit ?G ?\<phi> ?x = {?\<phi> g ?x |g. g \<in> carrier ?G}

goal (1 subgoal):
 1. y \<in> orbit G \<phi> x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
y \<in> orbit G \<phi> x

goal (1 subgoal):
 1. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y
[PROOF STEP]
thus "x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y"
[PROOF STATE]
proof (prove)
using this:
y \<in> orbit G \<phi> x

goal (1 subgoal):
 1. x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x .=\<^bsub>\<lparr>carrier = E, eq = \<lambda>x y. y \<in> orbit G \<phi> x\<rparr>\<^esub> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Im_Ln_pos_lt_imp: "0 < Im(z) \<Longrightarrow> 0 < Im(Ln z) \<and> Im(Ln z) < pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Im z \<Longrightarrow> 0 < Im (Ln z) \<and> Im (Ln z) < pi
[PROOF STEP]
by (metis Im_Ln_pos_lt not_le order_refl zero_complex.simps(2))


[STATEMENT]
lemma of_bl_append:
  "(of_bl (xs @ ys) :: 'a::len word) = of_bl xs * 2^(length ys) + of_bl ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_bl (xs @ ys) = of_bl xs * 2 ^ length ys + of_bl ys
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs ys. take_bit LENGTH('a) (bl_to_bin (xs @ ys)) = take_bit LENGTH('a) (bl_to_bin xs * 2 ^ length ys + bl_to_bin ys)
[PROOF STEP]
apply (simp add: bl_to_bin_app_cat bin_cat_num)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Times_mset_subset_mset_cancel2: "x \<in># C \<Longrightarrow> (A \<times># C \<subseteq># B \<times># C) = (A \<subseteq># B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in># C \<Longrightarrow> (A \<times># C \<subseteq># B \<times># C) = (A \<subseteq># B)
[PROOF STEP]
by (auto simp: subseteq_mset_def count_Sigma_mset)


[STATEMENT]
lemma independentD_alt:
  "independent B \<Longrightarrow> finite {x. X x \<noteq> 0} \<Longrightarrow> {x. X x \<noteq> 0} \<subseteq> B \<Longrightarrow> (\<Sum>x|X x \<noteq> 0. X x *s x) = 0 \<Longrightarrow> X x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>independent B; finite {x. X x \<noteq> (0::'a)}; {x. X x \<noteq> (0::'a)} \<subseteq> B; (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b)\<rbrakk> \<Longrightarrow> X x = (0::'a)
[PROOF STEP]
unfolding independent_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>X. finite {x. X x \<noteq> (0::'a)} \<longrightarrow> {x. X x \<noteq> (0::'a)} \<subseteq> B \<longrightarrow> (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b) \<longrightarrow> (\<forall>x. X x = (0::'a)); finite {x. X x \<noteq> (0::'a)}; {x. X x \<noteq> (0::'a)} \<subseteq> B; (\<Sum>x | X x \<noteq> (0::'a). X x *s x) = (0::'b)\<rbrakk> \<Longrightarrow> X x = (0::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma heap_ordered_single:
  "heap_ordered t = (\<forall>x \<in> set_mset (tree_to_multiset t). prio t \<le> snd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. heap_ordered t = (\<forall>x\<in>#tree_to_multiset t. prio t \<le> snd x)
[PROOF STEP]
by (cases t) auto


[STATEMENT]
lemma ccInf_less_iff: "countable S \<Longrightarrow> Inf S < a \<longleftrightarrow> (\<exists>x\<in>S. x < a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable S \<Longrightarrow> (Inf S < a) = (\<exists>x\<in>S. x < a)
[PROOF STEP]
unfolding not_le [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable S \<Longrightarrow> (\<not> a \<le> Inf S) = (\<exists>x\<in>S. \<not> a \<le> x)
[PROOF STEP]
by (subst le_ccInf_iff) auto


[STATEMENT]
lemma cblinfun_compose_scaleC_left[simp]:
  fixes A::"'b::complex_normed_vector \<Rightarrow>\<^sub>C\<^sub>L 'c::complex_normed_vector"
    and B::"'a::complex_normed_vector \<Rightarrow>\<^sub>C\<^sub>L 'b"
  shows \<open>(a *\<^sub>C A) o\<^sub>C\<^sub>L B = a *\<^sub>C (A o\<^sub>C\<^sub>L B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *\<^sub>C A o\<^sub>C\<^sub>L B = a *\<^sub>C (A o\<^sub>C\<^sub>L B)
[PROOF STEP]
by (simp add: bounded_cbilinear.scaleC_left bounded_cbilinear_cblinfun_compose)


[STATEMENT]
lemma fps_X_plus_const_power:
  "c \<noteq> 0 \<Longrightarrow> (fps_X + fps_const c) ^ n =
     fps_const (c^n) * fps_compose (fps_binomial (of_nat n)) (fps_const (inverse c) * fps_X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> (fps_X + fps_const c) ^ n = fps_const (c ^ n) * (fps_binomial (of_nat n) oo fps_const (inverse c) * fps_X)
[PROOF STEP]
by (subst fps_binomial_of_nat)
     (simp add: fps_compose_power [symmetric] fps_binomial_of_nat fps_compose_add_distrib
                fps_const_power [symmetric] power_mult_distrib [symmetric]
                algebra_simps inverse_mult_eq_1' del: fps_const_power)


[STATEMENT]
lemma cnj_sin: "cnj(sin z) = sin(cnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (sin z) = sin (cnj z)
[PROOF STEP]
by (simp add: sin_exp_eq exp_cnj field_simps)


[STATEMENT]
lemma help2: assumes "enat p + INV t + 1 \<le> INV s"
     "INV s = enat n"
  shows "INV t < INV s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. INV t < INV s
[PROOF STEP]
using assms le_less_trans not_less_iff_gr_or_eq
[PROOF STATE]
proof (prove)
using this:
enat p + INV t + 1 \<le> INV s
INV s = enat n
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z
(\<not> ?x < ?y) = (?y < ?x \<or> ?x = ?y)

goal (1 subgoal):
 1. INV t < INV s
[PROOF STEP]
by fastforce


[STATEMENT]
lemma is_projection_on_cadjoint:
  fixes M :: \<open>'a::complex_inner set\<close>
  assumes \<open>is_projection_on \<pi> M\<close> and \<open>closed_csubspace M\<close>
  shows \<open>\<pi>\<^sup>\<dagger> = \<pi>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>\<^sup>\<dagger> = \<pi>
[PROOF STEP]
using assms is_projection_on_is_cadjoint cadjoint_eqI is_cadjoint_def
[PROOF STATE]
proof (prove)
using this:
is_projection_on \<pi> M
closed_csubspace M
\<lbrakk>is_projection_on ?\<pi> ?M; closed_csubspace ?M\<rbrakk> \<Longrightarrow> is_cadjoint ?\<pi> ?\<pi>
(\<And>x y. ?F x \<bullet>\<^sub>C y = x \<bullet>\<^sub>C ?G y) \<Longrightarrow> ?G\<^sup>\<dagger> = ?F
is_cadjoint ?F ?G = (\<forall>x y. ?F x \<bullet>\<^sub>C y = x \<bullet>\<^sub>C ?G y)

goal (1 subgoal):
 1. \<pi>\<^sup>\<dagger> = \<pi>
[PROOF STEP]
by blast


[STATEMENT]
lemma Suc_length_conv_snoc: "(Suc n = length xs) = (\<exists>y ys. xs = ys @ [y] \<and> length ys = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc n = length xs) = (\<exists>y ys. xs = ys @ [y] \<and> length ys = n)
[PROOF STEP]
by (cases xs rule: rev_cases) auto


[STATEMENT]
lemma image_set_eqI:
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<in> B"
  assumes "\<And>x. x \<in> B \<Longrightarrow> g x \<in> A \<and> f (g x) = x"
  shows  "f ` A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> f ?x \<in> B
?x \<in> B \<Longrightarrow> g ?x \<in> A \<and> f (g ?x) = ?x

goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
by force


[STATEMENT]
lemma nonzero_abs_inverse:
  "a \<noteq> 0 \<Longrightarrow> \<bar>inverse a\<bar> = inverse \<bar>a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> \<bar>inverse a\<bar> = inverse \<bar>a\<bar>
[PROOF STEP]
by (rule abs_inverse)


[STATEMENT]
lemma spaceN_sum [simp]:
  assumes "\<And>i. i \<in> I \<Longrightarrow> x i \<in> space\<^sub>N N"
  shows "(\<Sum>i\<in>I. x i) \<in> space\<^sub>N N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum x I \<in> space\<^sub>N N
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> x ?i \<in> space\<^sub>N N

goal (1 subgoal):
 1. sum x I \<in> space\<^sub>N N
[PROOF STEP]
by (induction I rule: infinite_finite_induct, auto)


[STATEMENT]
lemma hom_char_matrix: assumes A: "A \<in> carrier_mat n n"
  shows "char_matrix (mat\<^sub>h A) (hom x) = mat\<^sub>h (char_matrix A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_matrix (mat\<^sub>h A) (hom x) = mat\<^sub>h (char_matrix A x)
[PROOF STEP]
unfolding char_matrix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat\<^sub>h A + - hom x \<cdot>\<^sub>m 1\<^sub>m (dim_row (mat\<^sub>h A)) = mat\<^sub>h (A + - x \<cdot>\<^sub>m 1\<^sub>m (dim_row A))
[PROOF STEP]
by (rule eq_matI, insert A, auto simp: hom_minus)


[STATEMENT]
lemma inv_stereographic_circline_stereographic_circline:
  "inv_stereographic_circline \<circ> stereographic_circline = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_stereographic_circline \<circ> stereographic_circline = id
[PROOF STEP]
proof (rule ext, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. inv_stereographic_circline (stereographic_circline x) = x
[PROOF STEP]
fix \<alpha>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. inv_stereographic_circline (stereographic_circline x) = x
[PROOF STEP]
show "inv_stereographic_circline (stereographic_circline \<alpha>) = \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_stereographic_circline (stereographic_circline \<alpha>) = \<alpha>
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha>. \<alpha> \<in> plane_vectors \<Longrightarrow> plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>
[PROOF STEP]
fix \<alpha>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha>. \<alpha> \<in> plane_vectors \<Longrightarrow> plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>
[PROOF STEP]
assume aa: "\<alpha> \<in> plane_vectors"
[PROOF STATE]
proof (state)
this:
\<alpha> \<in> plane_vectors

goal (1 subgoal):
 1. \<And>\<alpha>. \<alpha> \<in> plane_vectors \<Longrightarrow> plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>
[PROOF STEP]
obtain a b c d where AA: "\<alpha> = (a, b, c, d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b c d. \<alpha> = (a, b, c, d) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "\<alpha>") auto
[PROOF STATE]
proof (state)
this:
\<alpha> = (a, b, c, d)

goal (1 subgoal):
 1. \<And>\<alpha>. \<alpha> \<in> plane_vectors \<Longrightarrow> plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>
[PROOF STEP]
thus "plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>"
[PROOF STATE]
proof (prove)
using this:
\<alpha> = (a, b, c, d)

goal (1 subgoal):
 1. plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>
[PROOF STEP]
using AA
[PROOF STATE]
proof (prove)
using this:
\<alpha> = (a, b, c, d)
\<alpha> = (a, b, c, d)

goal (1 subgoal):
 1. plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>
[PROOF STEP]
by simp (rule_tac x=1 in exI, auto simp add: field_simps complex_of_real_def)
[PROOF STATE]
proof (state)
this:
plane_vec_eq_r4 (inv_stereographic_circline_cmat_r4 (stereographic_circline_r4_cmat \<alpha>)) \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inv_stereographic_circline (stereographic_circline \<alpha>) = \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma higher_deriv_transform_within_open:
  fixes z::complex
  assumes "f holomorphic_on S" "g holomorphic_on S" "open S" and z: "z \<in> S"
      and fg: "\<And>w. w \<in> S \<Longrightarrow> f w = g w"
    shows "(deriv ^^ i) f z = (deriv ^^ i) g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ i) f z = (deriv ^^ i) g z
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<in> S

goal (1 subgoal):
 1. (deriv ^^ i) f z = (deriv ^^ i) g z
[PROOF STEP]
by (induction i arbitrary: z)
   (auto simp: fg intro: complex_derivative_transform_within_open holomorphic_higher_deriv assms)


[STATEMENT]
lemma hyp_divide_minus_right [simp]:
  fixes a b :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  shows "a / (-b) = - (a / b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a / - b = - (a / b)
[PROOF STEP]
by (simp add: hyp_divide_inverse hyp_minus_inverse_comm)


[STATEMENT]
lemma mult_lift_imp_distrib: "x * (lift y z) = lift (x*y) (x*z) \<Longrightarrow> x * (y+z) = x*y + x*z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * lift y z = lift (x * y) (x * z) \<Longrightarrow> x * (y + z) = x * y + x * z
[PROOF STEP]
by (simp add: mult_sup_distrib plus_eq_lift)


[STATEMENT]
lemma nth_in [rule_format, simp]:
  "\<forall>i n. length xs = n \<longrightarrow> set xs <= A \<longrightarrow> i < n \<longrightarrow> (xs!i) \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i n. length xs = n \<longrightarrow> set xs \<subseteq> A \<longrightarrow> i < n \<longrightarrow> xs ! i \<in> A
[PROOF STEP]
apply (induct "xs")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>i n. length [] = n \<longrightarrow> set [] \<subseteq> A \<longrightarrow> i < n \<longrightarrow> [] ! i \<in> A
 2. \<And>a xs. \<forall>i n. length xs = n \<longrightarrow> set xs \<subseteq> A \<longrightarrow> i < n \<longrightarrow> xs ! i \<in> A \<Longrightarrow> \<forall>i n. length (a # xs) = n \<longrightarrow> set (a # xs) \<subseteq> A \<longrightarrow> i < n \<longrightarrow> (a # xs) ! i \<in> A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. \<forall>i n. length xs = n \<longrightarrow> set xs \<subseteq> A \<longrightarrow> i < n \<longrightarrow> xs ! i \<in> A \<Longrightarrow> \<forall>i n. length (a # xs) = n \<longrightarrow> set (a # xs) \<subseteq> A \<longrightarrow> i < n \<longrightarrow> (a # xs) ! i \<in> A
[PROOF STEP]
apply (simp add: nth_Cons split: nat.split)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma shift_eq_scons: "u @- v = a ## w \<longleftrightarrow> (u = [] \<and> v = a ## w) \<or> (\<exists> u'. u = a # u' \<and> u' @- v = w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u @- v = a ## w) = (u = [] \<and> v = a ## w \<or> (\<exists>u'. u = a # u' \<and> u' @- v = w))
[PROOF STEP]
by (cases u) (auto)


[STATEMENT]
theorem abs_Hahn_Banach:
  assumes E: "vectorspace E" and FE: "subspace F E"
    and lf: "linearform F f" and sn: "seminorm E p"
  assumes fp: "\<forall>x \<in> F. \<bar>f x\<bar> \<le> p x"
  shows "\<exists>g. linearform E g
    \<and> (\<forall>x \<in> F. g x = f x)
    \<and> (\<forall>x \<in> E. \<bar>g x\<bar> \<le> p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
interpret vectorspace E
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace E
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
interpret subspace F E
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Subspace.subspace F E
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
interpret linearform F f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linearform F f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
interpret seminorm E p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seminorm E p
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
have "\<exists>g. linearform E g \<and> (\<forall>x \<in> F. g x = f x) \<and> (\<forall>x \<in> E. g x \<le> p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. g x \<le> p x)
[PROOF STEP]
using E FE sn lf
[PROOF STATE]
proof (prove)
using this:
vectorspace E
Subspace.subspace F E
seminorm E p
linearform F f

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. g x \<le> p x)
[PROOF STEP]
proof (rule Hahn_Banach)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>F. f x \<le> p x
[PROOF STEP]
show "\<forall>x \<in> F. f x \<le> p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>F. f x \<le> p x
[PROOF STEP]
using FE E sn lf and fp
[PROOF STATE]
proof (prove)
using this:
Subspace.subspace F E
vectorspace E
seminorm E p
linearform F f
\<forall>x\<in>F. \<bar>f x\<bar> \<le> p x

goal (1 subgoal):
 1. \<forall>x\<in>F. f x \<le> p x
[PROOF STEP]
by (rule abs_ineq_iff [THEN iffD1])
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>F. f x \<le> p x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. g x \<le> p x)

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. g x \<le> p x)
[PROOF STEP]
obtain g where lg: "linearform E g" and *: "\<forall>x \<in> F. g x = f x"
      and **: "\<forall>x \<in> E. g x \<le> p x"
[PROOF STATE]
proof (prove)
using this:
\<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. g x \<le> p x)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>linearform E g; \<forall>x\<in>F. g x = f x; \<forall>x\<in>E. g x \<le> p x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
linearform E g
\<forall>x\<in>F. g x = f x
\<forall>x\<in>E. g x \<le> p x

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
have "\<forall>x \<in> E. \<bar>g x\<bar> \<le> p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>E. \<bar>g x\<bar> \<le> p x
[PROOF STEP]
using _ E sn lg **
[PROOF STATE]
proof (prove)
using this:
PROP ?psi \<Longrightarrow> PROP ?psi
vectorspace E
seminorm E p
linearform E g
\<forall>x\<in>E. g x \<le> p x

goal (1 subgoal):
 1. \<forall>x\<in>E. \<bar>g x\<bar> \<le> p x
[PROOF STEP]
proof (rule abs_ineq_iff [THEN iffD2])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Subspace.subspace E E
[PROOF STEP]
show "E \<unlhd> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Subspace.subspace E E
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Subspace.subspace E E

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
with lg *
[PROOF STATE]
proof (chain)
picking this:
linearform E g
\<forall>x\<in>F. g x = f x
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
linearform E g
\<forall>x\<in>F. g x = f x
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g. linearform E g \<and> (\<forall>x\<in>F. g x = f x) \<and> (\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subrobdds_set_idempot [simp] :
  "subrobdds_set (subrobdds_set bs) = subrobdds_set bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subrobdds_set (subrobdds_set bs) = subrobdds_set bs
[PROOF STEP]
unfolding subrobdds_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (subrobdds ` \<Union> (subrobdds ` bs)) = \<Union> (subrobdds ` bs)
[PROOF STEP]
by (auto dest: subrobdds_trans intro: subrobdds_refl)


[STATEMENT]
lemma Stirling_same [simp]: "Stirling n n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stirling n n = 1
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma map_of_prod_1[simp]:
  "i < n \<Longrightarrow>
    map_of (map (\<lambda>i. ((p, i), g i)) [0..<n])
       (p, i) = Some (g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> map_of (map (\<lambda>i. ((p, i), g i)) [0..<n]) (p, i) = Some (g i)
[PROOF STEP]
apply (rule map_of_is_SomeI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i < n \<Longrightarrow> distinct (map fst (map (\<lambda>i. ((p, i), g i)) [0..<n]))
 2. i < n \<Longrightarrow> ((p, i), g i) \<in> set (map (\<lambda>i. ((p, i), g i)) [0..<n])
[PROOF STEP]
apply (clarsimp simp: distinct_map o_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i < n \<Longrightarrow> inj_on (Pair p) {0..<n}
 2. i < n \<Longrightarrow> ((p, i), g i) \<in> set (map (\<lambda>i. ((p, i), g i)) [0..<n])
[PROOF STEP]
apply (meson inj_onI prod.inject)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> ((p, i), g i) \<in> set (map (\<lambda>i. ((p, i), g i)) [0..<n])
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma trancl_Int_mem:
   "(S,T) \<in> (R \<inter> (A \<times> A))\<^sup>+ \<Longrightarrow> (S,T)  \<in> R\<^sup>+ \<inter> A \<times> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S, T) \<in> (Restr R A)\<^sup>+ \<Longrightarrow> (S, T) \<in> Restr (R\<^sup>+) A
[PROOF STEP]
by (rule trancl_Int_subset [THEN subsetD], assumption)


[STATEMENT]
lemma fremove_code [code]:
  "fremove a (fset_of_list A) = fset_of_list (filter (\<lambda>x. x \<noteq> a) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fremove a (fset_of_list A) = fset_of_list (filter (\<lambda>x. x \<noteq> a) A)
[PROOF STEP]
apply (simp add: fremove_def minus_fset_def ffilter_def fset_both_sides Abs_fset_inverse fset_of_list.rep_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set A - {a} = Set.filter (\<lambda>x. x \<noteq> a) (set A)
[PROOF STEP]
by auto


[STATEMENT]
lemma right_unique_mat_rel: "right_unique R \<Longrightarrow> right_unique (mat_rel R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. right_unique R \<Longrightarrow> right_unique (mat_rel R)
[PROOF STEP]
unfolding right_unique_def mat_rel_def mat_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. R x y \<longrightarrow> R x z \<longrightarrow> y = z \<Longrightarrow> \<forall>x y z. dim_row x = dim_row y \<and> dim_col x = dim_col y \<and> (\<forall>i j. i < dim_row y \<longrightarrow> j < dim_col y \<longrightarrow> R (x $$ (i, j)) (y $$ (i, j))) \<longrightarrow> dim_row x = dim_row z \<and> dim_col x = dim_col z \<and> (\<forall>i j. i < dim_row z \<longrightarrow> j < dim_col z \<longrightarrow> R (x $$ (i, j)) (z $$ (i, j))) \<longrightarrow> dim_row y = dim_row z \<and> dim_col y = dim_col z \<and> (\<forall>i j. i < dim_row z \<longrightarrow> j < dim_col z \<longrightarrow> y $$ (i, j) = z $$ (i, j))
[PROOF STEP]
by (auto, blast)


[STATEMENT]
lemma NSLIMSEQ_minus: "X \<longlonglongrightarrow>\<^sub>N\<^sub>S a \<Longrightarrow> (\<lambda>n. - X n) \<longlonglongrightarrow>\<^sub>N\<^sub>S - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<longlonglongrightarrow>\<^sub>N\<^sub>S a \<Longrightarrow> (\<lambda>n. - X n) \<longlonglongrightarrow>\<^sub>N\<^sub>S - a
[PROOF STEP]
by (auto simp add: NSLIMSEQ_def)


[STATEMENT]
lemma Arccos_cos:
    assumes "0 < Re z \<and> Re z < pi \<or>
             Re z = 0 \<and> 0 \<le> Im z \<or>
             Re z = pi \<and> Im z \<le> 0"
      shows "Arccos(cos z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
have *: "((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))) = sin z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)) = sin z
[PROOF STEP]
by (simp add: sin_exp_eq exp_minus field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)) = sin z

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
have "1 - (exp (\<i> * z) + inverse (exp (\<i> * z)))\<^sup>2 / 4 = ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - (exp (\<i> * z) + inverse (exp (\<i> * z)))\<^sup>2 / 4 = ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
1 - (exp (\<i> * z) + inverse (exp (\<i> * z)))\<^sup>2 / 4 = ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 - (exp (\<i> * z) + inverse (exp (\<i> * z)))\<^sup>2 / 4 = ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2
[PROOF STEP]
have "Arccos(cos z) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 +
                           \<i> * csqrt (((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2)))"
[PROOF STATE]
proof (prove)
using this:
1 - (exp (\<i> * z) + inverse (exp (\<i> * z)))\<^sup>2 / 4 = ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2

goal (1 subgoal):
 1. Arccos (cos z) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * csqrt (((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2)))
[PROOF STEP]
by (simp add: cos_exp_eq Arccos_def exp_minus power_divide)
[PROOF STATE]
proof (state)
this:
Arccos (cos z) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * csqrt (((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2)))

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Arccos (cos z) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * csqrt (((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2)))

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
have "\<dots> = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 +
                              \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * csqrt (((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2))) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))))
[PROOF STEP]
apply (subst csqrt_square)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < Re ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))) \<or> Re ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))) = 0 \<and> 0 \<le> Im ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))
 2. - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))))) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))))
[PROOF STEP]
using assms Re_sin_pos [of z] Im_sin_nonneg [of z] Im_sin_nonneg2 [of z]
[PROOF STATE]
proof (prove)
using this:
0 < Re z \<and> Re z < pi \<or> Re z = 0 \<and> 0 \<le> Im z \<or> Re z = pi \<and> Im z \<le> 0
\<lbrakk>0 < Re z; Re z < pi\<rbrakk> \<Longrightarrow> 0 < Re (sin z)
\<lbrakk>Re z = 0; 0 \<le> Im z\<rbrakk> \<Longrightarrow> 0 \<le> Im (sin z)
\<lbrakk>Re z = pi; Im z \<le> 0\<rbrakk> \<Longrightarrow> 0 \<le> Im (sin z)

goal (2 subgoals):
 1. 0 < Re ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))) \<or> Re ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))) = 0 \<and> 0 \<le> Im ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))
 2. - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))))) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))))
[PROOF STEP]
by (auto simp: * Re_sin Im_sin)
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * csqrt (((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2))) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))))

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * csqrt (((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))\<^sup>2))) = - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z)))))

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
have "\<dots> =  - (\<i> * Ln (exp (\<i>*z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))))) = - (\<i> * Ln (exp (\<i> * z)))
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))))) = - (\<i> * Ln (exp (\<i> * z)))

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2 + \<i> * ((\<i> - (exp (\<i> * z))\<^sup>2 * \<i>) / (2 * exp (\<i> * z))))) = - (\<i> * Ln (exp (\<i> * z)))

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
have "\<dots> = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<i> * Ln (exp (\<i> * z))) = z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < Re z \<and> Re z < pi \<or> Re z = 0 \<and> 0 \<le> Im z \<or> Re z = pi \<and> Im z \<le> 0

goal (1 subgoal):
 1. - (\<i> * Ln (exp (\<i> * z))) = z
[PROOF STEP]
by (subst Complex_Transcendental.Ln_exp, auto)
[PROOF STATE]
proof (state)
this:
- (\<i> * Ln (exp (\<i> * z))) = z

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Arccos (cos z) = z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Arccos (cos z) = z

goal (1 subgoal):
 1. Arccos (cos z) = z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Arccos (cos z) = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma canon_ang_eqI:
  assumes "\<exists>k::int. \<alpha>' - \<alpha> = 2 * k * pi" and "- pi < \<alpha>' \<and> \<alpha>' \<le> pi"
  shows "\<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha>'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>' - \<alpha> = 2 * real_of_int x * pi
- pi < \<alpha>' \<and> \<alpha>' \<le> pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha>'
[PROOF STEP]
using canon_ang_eq[of \<alpha>' \<alpha>]
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>' - \<alpha> = 2 * real_of_int x * pi
- pi < \<alpha>' \<and> \<alpha>' \<le> pi
\<exists>x. \<alpha>' - \<alpha> = 2 * real_of_int x * pi \<Longrightarrow> \<downharpoonright>\<alpha>'\<downharpoonleft> = \<downharpoonright>\<alpha>\<downharpoonleft>

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha>'
[PROOF STEP]
using canon_ang_id[of \<alpha>']
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>' - \<alpha> = 2 * real_of_int x * pi
- pi < \<alpha>' \<and> \<alpha>' \<le> pi
\<exists>x. \<alpha>' - \<alpha> = 2 * real_of_int x * pi \<Longrightarrow> \<downharpoonright>\<alpha>'\<downharpoonleft> = \<downharpoonright>\<alpha>\<downharpoonleft>
- pi < \<alpha>' \<and> \<alpha>' \<le> pi \<Longrightarrow> \<downharpoonright>\<alpha>'\<downharpoonleft> = \<alpha>'

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha>'
[PROOF STEP]
by auto


[STATEMENT]
lemma coprime_iff_invertible_nat:
  "coprime a m \<longleftrightarrow> (\<exists>x. [a * x = Suc 0] (mod m))" (is "?P \<longleftrightarrow> ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a m = (\<exists>x. [a * x = Suc 0] (mod m))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. coprime a m \<Longrightarrow> \<exists>x. [a * x = Suc 0] (mod m)
 2. \<exists>x. [a * x = Suc 0] (mod m) \<Longrightarrow> coprime a m
[PROOF STEP]
assume ?P
[PROOF STATE]
proof (state)
this:
coprime a m

goal (2 subgoals):
 1. coprime a m \<Longrightarrow> \<exists>x. [a * x = Suc 0] (mod m)
 2. \<exists>x. [a * x = Suc 0] (mod m) \<Longrightarrow> coprime a m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime a m
[PROOF STEP]
show ?Q
[PROOF STATE]
proof (prove)
using this:
coprime a m

goal (1 subgoal):
 1. \<exists>x. [a * x = Suc 0] (mod m)
[PROOF STEP]
by (auto dest!: cong_solve_coprime_nat)
[PROOF STATE]
proof (state)
this:
\<exists>x. [a * x = Suc 0] (mod m)

goal (1 subgoal):
 1. \<exists>x. [a * x = Suc 0] (mod m) \<Longrightarrow> coprime a m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. [a * x = Suc 0] (mod m) \<Longrightarrow> coprime a m
[PROOF STEP]
assume ?Q
[PROOF STATE]
proof (state)
this:
\<exists>x. [a * x = Suc 0] (mod m)

goal (1 subgoal):
 1. \<exists>x. [a * x = Suc 0] (mod m) \<Longrightarrow> coprime a m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. [a * x = Suc 0] (mod m)
[PROOF STEP]
obtain b where "[a * b = Suc 0] (mod m)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. [a * x = Suc 0] (mod m)

goal (1 subgoal):
 1. (\<And>b. [a * b = Suc 0] (mod m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[a * b = Suc 0] (mod m)

goal (1 subgoal):
 1. \<exists>x. [a * x = Suc 0] (mod m) \<Longrightarrow> coprime a m
[PROOF STEP]
with coprime_mod_left_iff [of m "a * b"]
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> 0 \<Longrightarrow> coprime (a * b mod m) m = coprime (a * b) m
[a * b = Suc 0] (mod m)
[PROOF STEP]
show ?P
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0 \<Longrightarrow> coprime (a * b mod m) m = coprime (a * b) m
[a * b = Suc 0] (mod m)

goal (1 subgoal):
 1. coprime a m
[PROOF STEP]
by (cases "m = 0 \<or> m = 1")
      (unfold cong_def, auto simp add: cong_def)
[PROOF STATE]
proof (state)
this:
coprime a m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma higher_pderiv_monom_eq_zero:
  "m > n + 1 \<Longrightarrow> (pderiv ^^ m) (monom c n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n + 1 < m \<Longrightarrow> (pderiv ^^ m) (Polynomial.monom c n) = 0
[PROOF STEP]
proof (induction m arbitrary: c n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c n. n + 1 < 0 \<Longrightarrow> (pderiv ^^ 0) (Polynomial.monom c n) = 0
 2. \<And>m c n. \<lbrakk>\<And>c n. n + 1 < m \<Longrightarrow> (pderiv ^^ m) (Polynomial.monom c n) = 0; n + 1 < Suc m\<rbrakk> \<Longrightarrow> (pderiv ^^ Suc m) (Polynomial.monom c n) = 0
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
?n + 1 < m \<Longrightarrow> (pderiv ^^ m) (Polynomial.monom ?c ?n) = 0
n + 1 < Suc m

goal (2 subgoals):
 1. \<And>c n. n + 1 < 0 \<Longrightarrow> (pderiv ^^ 0) (Polynomial.monom c n) = 0
 2. \<And>m c n. \<lbrakk>\<And>c n. n + 1 < m \<Longrightarrow> (pderiv ^^ m) (Polynomial.monom c n) = 0; n + 1 < Suc m\<rbrakk> \<Longrightarrow> (pderiv ^^ Suc m) (Polynomial.monom c n) = 0
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?n + 1 < m \<Longrightarrow> (pderiv ^^ m) (Polynomial.monom ?c ?n) = 0
n + 1 < Suc m

goal (1 subgoal):
 1. (pderiv ^^ Suc m) (Polynomial.monom c n) = 0
[PROOF STEP]
by (cases n)
       (simp_all del: funpow.simps add: funpow_Suc_right pderiv_monom pochhammer_rec' Suc.IH)
[PROOF STATE]
proof (state)
this:
(pderiv ^^ Suc m) (Polynomial.monom c n) = 0

goal (1 subgoal):
 1. \<And>c n. n + 1 < 0 \<Longrightarrow> (pderiv ^^ 0) (Polynomial.monom c n) = 0
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma lookup_gcs_fun: "lookup (gcs s (t::'a \<Rightarrow>\<^sub>0 ('b::add_linorder))) = gcs (lookup s) (lookup t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (gcs s t) = gcs (lookup s) (lookup t)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. lookup (gcs s t) x = gcs (lookup s) (lookup t) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. lookup (gcs s t) x = gcs (lookup s) (lookup t) x
[PROOF STEP]
show "lookup (gcs s t) x = gcs (lookup s) (lookup t) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (gcs s t) x = gcs (lookup s) (lookup t) x
[PROOF STEP]
by (simp add: gcs_def lookup_minus lookup_add lookup_lcs_fun)
[PROOF STATE]
proof (state)
this:
lookup (gcs s t) x = gcs (lookup s) (lookup t) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma product_nodes[simp]: "c.nodes (product A B) \<subseteq> a.nodes A \<times> b.nodes B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c.nodes' (product A B) \<subseteq> a.nodes' A \<times> b.nodes' B
[PROOF STEP]
unfolding a.nodes_alt_def b.nodes_alt_def c.nodes_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (c.reachable' (product A B) ` {p. p = initial\<^sub>3 (product A B)}) \<subseteq> \<Union> (a.reachable' A ` {p. p = initial\<^sub>1 A}) \<times> \<Union> (b.reachable' B ` {p. p = initial\<^sub>2 B})
[PROOF STEP]
by auto


[STATEMENT]
lemma closedin_closed: "closedin (top_of_set U) S \<longleftrightarrow> (\<exists>T. closed T \<and> S = U \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set U) S = (\<exists>T. closed T \<and> S = U \<inter> T)
[PROOF STEP]
by (simp add: closedin_subtopology Int_ac)


[STATEMENT]
lemma extending_Un:
     "[| extending C h F YA' YA;  extending C h F YB' YB |]
      ==> extending C h F (YA' \<union> YB') (YA \<union> YB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>extending C h F YA' YA; extending C h F YB' YB\<rbrakk> \<Longrightarrow> extending C h F (YA' \<union> YB') (YA \<union> YB)
[PROOF STEP]
by (unfold extending_def, blast)


[STATEMENT]
lemma fps_divide_unit_factor_denom:
  fixes   f g :: "'a::{inverse,comm_monoid_add,uminus,mult_zero} fps"
  assumes "subdegree g \<le> subdegree f"
  shows
    "f / unit_factor g = Abs_fps (\<lambda>k. if k<subdegree g then 0 else (f/g) $ (k-subdegree g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f / unit_factor g = Abs_fps (\<lambda>k. if k < subdegree g then 0::'a else (f / g) $ (k - subdegree g))
[PROOF STEP]
by      (simp add: assms fps_divide_shift_denom)


[STATEMENT]
lemma fftt_4: assumes dx: "dim_vec x = 4"
  and be: "x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = True"
  shows "ceros_of_boolean_input x = {0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 1}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = True

goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 1}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = True

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 1}
[PROOF STEP]
using less_4_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = True \<and> x $ 3 = True
?n < 4 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2 \<or> ?n = 3

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 1}
[PROOF STEP]
by auto


[STATEMENT]
lemma weakly_fair_def3:
  shows "weakly_fair enabled taken = (\<diamond>\<box>enabled \<^bold>\<longrightarrow> \<box>\<diamond>taken)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weakly_fair enabled taken = (\<lambda>s. (\<diamond>\<box>enabled) s \<longrightarrow> (\<box>\<diamond>taken) s)
[PROOF STEP]
unfolding weakly_fair_def2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<box>(\<lambda>s. \<not> (\<box>(\<lambda>s. enabled s \<and> \<not> taken s)) s) = (\<lambda>s. (\<diamond>\<box>enabled) s \<longrightarrow> (\<box>\<diamond>taken) s)
[PROOF STEP]
apply (clarsimp simp: fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<box>\<diamond>(\<lambda>s. enabled s \<longrightarrow> taken s)) x = ((\<diamond>\<box>enabled) x \<longrightarrow> (\<box>\<diamond>taken) x)
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<forall>i. \<exists>ia. (enabled (x |\<^sub>s i |\<^sub>s ia) \<longrightarrow> taken (x |\<^sub>s i |\<^sub>s ia)) \<and> (\<forall>k<ia. True)) = ((\<exists>i. (\<forall>ia. enabled (x |\<^sub>s i |\<^sub>s ia)) \<and> (\<forall>k<i. True)) \<longrightarrow> (\<forall>i. \<exists>ia. taken (x |\<^sub>s i |\<^sub>s ia) \<and> (\<forall>k<ia. True)))
[PROOF STEP]
(* True, but can we get there deductively? *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<forall>i. \<exists>ia. (enabled (x |\<^sub>s i |\<^sub>s ia) \<longrightarrow> taken (x |\<^sub>s i |\<^sub>s ia)) \<and> (\<forall>k<ia. True)) = ((\<exists>i. (\<forall>ia. enabled (x |\<^sub>s i |\<^sub>s ia)) \<and> (\<forall>k<i. True)) \<longrightarrow> (\<forall>i. \<exists>ia. taken (x |\<^sub>s i |\<^sub>s ia) \<and> (\<forall>k<ia. True)))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x i ia. \<lbrakk>\<forall>i. \<exists>ia. enabled (x |\<^sub>s i + ia) \<longrightarrow> taken (x |\<^sub>s i + ia); \<forall>ia. enabled (x |\<^sub>s i + ia)\<rbrakk> \<Longrightarrow> \<exists>i. taken (x |\<^sub>s ia + i)
[PROOF STEP]
apply (metis (full_types) add.left_commute semiring_normalization_rules(25))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_columns_le_ncols:
  "card (columns A) \<le> ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (columns A) \<le> ncols A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (columns A) \<le> ncols A
[PROOF STEP]
have columns_rw: "columns A = (\<lambda>i. column i A)` UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. columns A = range (\<lambda>i. column i A)
[PROOF STEP]
unfolding columns_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {column i A |i. i \<in> UNIV} = range (\<lambda>i. column i A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
columns A = range (\<lambda>i. column i A)

goal (1 subgoal):
 1. card (columns A) \<le> ncols A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (columns A) \<le> ncols A
[PROOF STEP]
unfolding columns_rw ncols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (range (\<lambda>i. column i A)) \<le> CARD('c)
[PROOF STEP]
by (rule card_image_le, auto)
[PROOF STATE]
proof (state)
this:
card (columns A) \<le> ncols A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma M_perp_sym:
  assumes "M_perp l m"
  shows "M_perp m l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_perp m l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M_perp m l
[PROOF STEP]
from \<open>M_perp l m\<close>
[PROOF STATE]
proof (chain)
picking this:
M_perp l m
[PROOF STEP]
have "proj2_incident (pole l) m"
[PROOF STATE]
proof (prove)
using this:
M_perp l m

goal (1 subgoal):
 1. proj2_incident (pole l) m
[PROOF STEP]
by (unfold M_perp_def)
[PROOF STATE]
proof (state)
this:
proj2_incident (pole l) m

goal (1 subgoal):
 1. M_perp m l
[PROOF STEP]
hence "proj2_incident (pole m) (polar (pole l))"
[PROOF STATE]
proof (prove)
using this:
proj2_incident (pole l) m

goal (1 subgoal):
 1. proj2_incident (pole m) (polar (pole l))
[PROOF STEP]
by (rule incident_pole_polar)
[PROOF STATE]
proof (state)
this:
proj2_incident (pole m) (polar (pole l))

goal (1 subgoal):
 1. M_perp m l
[PROOF STEP]
hence "proj2_incident (pole m) l"
[PROOF STATE]
proof (prove)
using this:
proj2_incident (pole m) (polar (pole l))

goal (1 subgoal):
 1. proj2_incident (pole m) l
[PROOF STEP]
by (simp add: polar_pole)
[PROOF STATE]
proof (state)
this:
proj2_incident (pole m) l

goal (1 subgoal):
 1. M_perp m l
[PROOF STEP]
thus "M_perp m l"
[PROOF STATE]
proof (prove)
using this:
proj2_incident (pole m) l

goal (1 subgoal):
 1. M_perp m l
[PROOF STEP]
by (unfold M_perp_def)
[PROOF STATE]
proof (state)
this:
M_perp m l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma liouville_lambda_prime_power [simp]: "prime p \<Longrightarrow> liouville_lambda (p ^ k) = (-1) ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> liouville_lambda (p ^ k) = (- (1::'a)) ^ k
[PROOF STEP]
by (simp add: liouville_lambda_def prime_factorization_prime_power)


[STATEMENT]
lemma isometry_partial_isometry: \<open>isometry P \<Longrightarrow> partial_isometry P\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry P \<Longrightarrow> partial_isometry P
[PROOF STEP]
by (simp add: isometry_preserves_norm partial_isometry_def)


[STATEMENT]
lemma testN_post2:
  "\<not> f k \<Longrightarrow> adjoint (testN k) * post * testN k = 0\<^sub>m N N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f k \<Longrightarrow> adjoint (testN k) * post * testN k = 0\<^sub>m N N
[PROOF STEP]
apply (subst assoc_mult_mat[of _ N N _ N _ N])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<not> f k \<Longrightarrow> adjoint (testN k) \<in> carrier_mat N N
 2. \<not> f k \<Longrightarrow> post \<in> carrier_mat N N
 3. \<not> f k \<Longrightarrow> testN k \<in> carrier_mat N N
 4. \<not> f k \<Longrightarrow> adjoint (testN k) * (post * testN k) = 0\<^sub>m N N
[PROOF STEP]
apply (auto simp add: adjoint_dim testN_dim post_dim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f k \<Longrightarrow> adjoint (testN k) * (post * testN k) = 0\<^sub>m N N
[PROOF STEP]
apply (subst post_mult_testNk_neg, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f k \<Longrightarrow> adjoint (testN k) * 0\<^sub>m N N = 0\<^sub>m N N
[PROOF STEP]
unfolding hermitian_testN[unfolded hermitian_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f k \<Longrightarrow> testN k * 0\<^sub>m N N = 0\<^sub>m N N
[PROOF STEP]
using testN_dim[of k]
[PROOF STATE]
proof (prove)
using this:
testN k \<in> carrier_mat N N

goal (1 subgoal):
 1. \<not> f k \<Longrightarrow> testN k * 0\<^sub>m N N = 0\<^sub>m N N
[PROOF STEP]
by auto


[STATEMENT]
lemma mdeg_child_sucs_eq_if_gt1:
  assumes "max_deg (Node r {|(t,e)|}) > 1"
  shows "max_deg (Node r {|(t,e)|}) = max_deg (Node v (sucs t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg (Node v (sucs t))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg (Node v (sucs t))
[PROOF STEP]
have "fcard {|(t,e)|} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fcard {|(t, e)|} = 1
[PROOF STEP]
using fcard_single_1
[PROOF STATE]
proof (prove)
using this:
fcard {|?x|} = 1

goal (1 subgoal):
 1. fcard {|(t, e)|} = 1
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
fcard {|(t, e)|} = 1

goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg (Node v (sucs t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fcard {|(t, e)|} = 1
[PROOF STEP]
have "max_deg (Node r {|(t,e)|}) = max_deg t"
[PROOF STATE]
proof (prove)
using this:
fcard {|(t, e)|} = 1

goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fcard {|(t, e)|} = 1
1 < max_deg (Node r {|(t, e)|})

goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
max_deg (Node r {|(t, e)|}) = max_deg t

goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg (Node v (sucs t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
max_deg (Node r {|(t, e)|}) = max_deg t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
max_deg (Node r {|(t, e)|}) = max_deg t

goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg (Node v (sucs t))
[PROOF STEP]
using mdeg_root[of "root t" "sucs t" v] dtree.exhaust_sel[of t]
[PROOF STATE]
proof (prove)
using this:
max_deg (Node r {|(t, e)|}) = max_deg t
max_deg (Node (dtree.root t) (sucs t)) = max_deg (Node v (sucs t))
(t = Node (dtree.root t) (sucs t) \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. max_deg (Node r {|(t, e)|}) = max_deg (Node v (sucs t))
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
max_deg (Node r {|(t, e)|}) = max_deg (Node v (sucs t))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ltake_ldrop:
  "(xs \<up> m) \<down> n =(xs \<down> (n + m)) \<up> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<up> m \<down> n = xs \<down> (n + m) \<up> m
[PROOF STEP]
proof (induct "m" arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. xs \<up> 0 \<down> n = xs \<down> (n + 0) \<up> 0
 2. \<And>m xs. (\<And>xs. xs \<up> m \<down> n = xs \<down> (n + m) \<up> m) \<Longrightarrow> xs \<up> Suc m \<down> n = xs \<down> (n + Suc m) \<up> Suc m
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs. xs \<up> 0 \<down> n = xs \<down> (n + 0) \<up> 0
 2. \<And>m xs. (\<And>xs. xs \<up> m \<down> n = xs \<down> (n + m) \<up> m) \<Longrightarrow> xs \<up> Suc m \<down> n = xs \<down> (n + Suc m) \<up> Suc m
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<up> 0 \<down> n = xs \<down> (n + 0) \<up> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
xs \<up> 0 \<down> n = xs \<down> (n + 0) \<up> 0

goal (1 subgoal):
 1. \<And>m xs. (\<And>xs. xs \<up> m \<down> n = xs \<down> (n + m) \<up> m) \<Longrightarrow> xs \<up> Suc m \<down> n = xs \<down> (n + Suc m) \<up> Suc m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m xs. (\<And>xs. xs \<up> m \<down> n = xs \<down> (n + m) \<up> m) \<Longrightarrow> xs \<up> Suc m \<down> n = xs \<down> (n + Suc m) \<up> Suc m
[PROOF STEP]
case (Suc l)
[PROOF STATE]
proof (state)
this:
?xs \<up> l \<down> n = ?xs \<down> (n + l) \<up> l

goal (1 subgoal):
 1. \<And>m xs. (\<And>xs. xs \<up> m \<down> n = xs \<down> (n + m) \<up> m) \<Longrightarrow> xs \<up> Suc m \<down> n = xs \<down> (n + Suc m) \<up> Suc m
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?xs \<up> l \<down> n = ?xs \<down> (n + l) \<up> l

goal (1 subgoal):
 1. xs \<up> Suc l \<down> n = xs \<down> (n + Suc l) \<up> Suc l
[PROOF STEP]
by (cases "xs") auto
[PROOF STATE]
proof (state)
this:
xs \<up> Suc l \<down> n = xs \<down> (n + Suc l) \<up> Suc l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sets_scylinder: "(\<forall>x\<in>set xs. x \<in> sets S) \<Longrightarrow> scylinder (space S) xs \<in> sets (stream_space S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. x \<in> sets S \<Longrightarrow> scylinder (space S) xs \<in> sets (stream_space S)
[PROOF STEP]
by (induction xs) (auto simp: space_stream_space[symmetric])


[STATEMENT]
lemma set_butlast_distinct: "distinct xs \<Longrightarrow> set (butlast xs) \<inter> {last xs} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (butlast xs) \<inter> {last xs} = {}
[PROOF STEP]
by (metis append_butlast_last_id butlast.simps(1) distinct_append inf_bot_right inf_commute list.set(1) set_simps(2))


[STATEMENT]
lemma uint64_of_nat_bij_betw : "bij_betw uint64_of_nat  {..<2 ^ 64} (UNIV :: uint64 set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw uint64_of_nat {..<2 ^ 64} UNIV
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on uint64_of_nat {..<2 ^ 64} \<and> uint64_of_nat ` {..<2 ^ 64} = UNIV
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on uint64_of_nat {..<2 ^ 64}
 2. uint64_of_nat ` {..<2 ^ 64} = UNIV
[PROOF STEP]
show "inj_on uint64_of_nat {..<2 ^ 64}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on uint64_of_nat {..<2 ^ 64}
[PROOF STEP]
using nat_of_uint64_bij_betw uint64_nat_bij
[PROOF STATE]
proof (prove)
using this:
bij_betw nat_of_uint64 UNIV {..<2 ^ 64}
?x < 2 ^ 64 \<Longrightarrow> nat_of_uint64 (uint64_of_nat ?x) = ?x

goal (1 subgoal):
 1. inj_on uint64_of_nat {..<2 ^ 64}
[PROOF STEP]
by (metis inj_on_inverseI lessThan_iff)
[PROOF STATE]
proof (state)
this:
inj_on uint64_of_nat {..<2 ^ 64}

goal (1 subgoal):
 1. uint64_of_nat ` {..<2 ^ 64} = UNIV
[PROOF STEP]
show "uint64_of_nat ` {..<2 ^ 64} = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uint64_of_nat ` {..<2 ^ 64} = UNIV
[PROOF STEP]
using uint64_UNIV
[PROOF STATE]
proof (prove)
using this:
UNIV = uint64_of_nat ` {..<2 ^ 64}

goal (1 subgoal):
 1. uint64_of_nat ` {..<2 ^ 64} = UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
uint64_of_nat ` {..<2 ^ 64} = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complete_iff_size1: "complete t \<longleftrightarrow> size1 t = 2 ^ height t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete t = (size1 t = 2 ^ height t)
[PROOF STEP]
using complete_if_size1_height size1_if_complete
[PROOF STATE]
proof (prove)
using this:
size1 ?t = 2 ^ height ?t \<Longrightarrow> complete ?t
complete ?t \<Longrightarrow> size1 ?t = 2 ^ height ?t

goal (1 subgoal):
 1. complete t = (size1 t = 2 ^ height t)
[PROOF STEP]
by blast


[STATEMENT]
lemma ang_vec_plus_pi1:
  assumes "\<angle> z1 z2 > 0"
  shows "\<downharpoonright>\<angle> z1 z2 + pi\<downharpoonleft> = \<angle> z1 z2 - pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>\<angle> z1 z2 + pi\<downharpoonleft> = \<angle> z1 z2 - pi
[PROOF STEP]
proof (rule canon_ang_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. \<angle> z1 z2 - pi - (\<angle> z1 z2 + pi) = 2 * real_of_int x * pi
 2. - pi < \<angle> z1 z2 - pi \<and> \<angle> z1 z2 - pi \<le> pi
[PROOF STEP]
show "\<exists> x::int. \<angle> z1 z2 - pi - (\<angle> z1 z2 + pi) = 2 * real_of_int x * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. \<angle> z1 z2 - pi - (\<angle> z1 z2 + pi) = 2 * real_of_int x * pi
[PROOF STEP]
by (rule_tac x="-1" in exI) auto
[PROOF STATE]
proof (state)
this:
\<exists>x. \<angle> z1 z2 - pi - (\<angle> z1 z2 + pi) = 2 * real_of_int x * pi

goal (1 subgoal):
 1. - pi < \<angle> z1 z2 - pi \<and> \<angle> z1 z2 - pi \<le> pi
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - pi < \<angle> z1 z2 - pi \<and> \<angle> z1 z2 - pi \<le> pi
[PROOF STEP]
show "- pi < \<angle> z1 z2 - pi \<and> \<angle> z1 z2 - pi \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - pi < \<angle> z1 z2 - pi \<and> \<angle> z1 z2 - pi \<le> pi
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<angle> z1 z2

goal (1 subgoal):
 1. - pi < \<angle> z1 z2 - pi \<and> \<angle> z1 z2 - pi \<le> pi
[PROOF STEP]
unfolding ang_vec_def
[PROOF STATE]
proof (prove)
using this:
0 < \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft>

goal (1 subgoal):
 1. - pi < \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> - pi \<and> \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> - pi \<le> pi
[PROOF STEP]
using canon_ang(1)[of "Arg z2 - Arg z1"] canon_ang(2)[of "Arg z2 - Arg z1"]
[PROOF STATE]
proof (prove)
using this:
0 < \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft>
- pi < \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft>
\<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> \<le> pi

goal (1 subgoal):
 1. - pi < \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> - pi \<and> \<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> - pi \<le> pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- pi < \<angle> z1 z2 - pi \<and> \<angle> z1 z2 - pi \<le> pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_le_log_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 0 \<le> log a x \<longleftrightarrow> 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (0 \<le> log a x) = (1 \<le> x)
[PROOF STEP]
using log_le_cancel_iff[of a 1 x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < 1; 0 < x\<rbrakk> \<Longrightarrow> (log a 1 \<le> log a x) = (1 \<le> x)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (0 \<le> log a x) = (1 \<le> x)
[PROOF STEP]
by simp


[STATEMENT]
lemma restrictA_cong:
  "(\<And>x. x \<in> domA m1 \<Longrightarrow> x \<in> V \<longleftrightarrow> x \<in> V') \<Longrightarrow> m1 = m2 \<Longrightarrow> restrictA V m1 = restrictA V' m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> domA m1 \<Longrightarrow> (x \<in> V) = (x \<in> V'); m1 = m2\<rbrakk> \<Longrightarrow> restrictA V m1 = restrictA V' m2
[PROOF STEP]
unfolding restrict_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> domA m1 \<Longrightarrow> (x \<in> V) = (x \<in> V'); m1 = m2\<rbrakk> \<Longrightarrow> filter (\<lambda>(k, v). k \<in> V) m1 = filter (\<lambda>(k, v). k \<in> V') m2
[PROOF STEP]
by (induction m1 arbitrary: m2) auto


[STATEMENT]
lemma in_list_Suc_iff:
  "(xs \<in> list (Suc n) A) = (\<exists>y\<in>A. \<exists>ys \<in> list n A. xs = y#ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> list (Suc n) A) = (\<exists>y\<in>A. \<exists>ys\<in>list n A. xs = y # ys)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> list (Suc n) A) = (\<exists>y\<in>A. \<exists>ys\<in>list n A. xs = y # ys)
[PROOF STEP]
apply (unfold list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
[PROOF STEP]
apply (case_tac "xs")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
 2. \<And>a list. xs = a # list \<Longrightarrow> (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_integrable_cong_AE:
    "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow>
    AE x \<in> A in M. f x = g x \<Longrightarrow> A \<in> sets M \<Longrightarrow>
    set_integrable M A f = set_integrable M A g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M; AE x\<in>A in M. f x = g x; A \<in> sets M\<rbrakk> \<Longrightarrow> set_integrable M A f = set_integrable M A g
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M; AE x\<in>A in M. f x = g x; A \<in> sets M\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x) = integrable M (\<lambda>x. indicat_real A x *\<^sub>R g x)
[PROOF STEP]
by (rule integrable_cong_AE) auto


[STATEMENT]
lemma map_drop_delete: "map_drop k (map_of ps) = map_of (AList.delete k ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_drop k (map_of ps) = map_of (AList.delete k ps)
[PROOF STEP]
unfolding AList.delete_eq map_drop_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_filter (\<lambda>a'. a' \<noteq> k) (map_of ps) = map_of (filter (\<lambda>(k', uu_). k \<noteq> k') ps)
[PROOF STEP]
apply (subst map_filter_map_of)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (filter (\<lambda>(ka, uu_). ka \<noteq> k) ps) = map_of (filter (\<lambda>(k', uu_). k \<noteq> k') ps)
[PROOF STEP]
apply (rule arg_cong[where f = "map_of"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>(ka, uu_). ka \<noteq> k) ps = filter (\<lambda>(k', uu_). k \<noteq> k') ps
[PROOF STEP]
apply (rule filter_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set ps \<Longrightarrow> (case x of (ka, uu_) \<Rightarrow> ka \<noteq> k) = (case x of (k', uu_) \<Rightarrow> k \<noteq> k')
[PROOF STEP]
by auto


[STATEMENT]
lemma norm_bfun_disc_le: "norm f \<le> B \<Longrightarrow> (\<Sum>x. l^x * norm (apply_bfun f x)) \<le> (\<Sum>x. l^x * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm f \<le> B \<Longrightarrow> (\<Sum>x. l ^ x * norm (apply_bfun f x)) \<le> (\<Sum>x. l ^ x * B)
[PROOF STEP]
by (fastforce intro!: suminf_le mult_left_mono norm_le_norm_bfun intro: order.trans)