[STATEMENT]
theorem avl_delete:
  "avl t \<Longrightarrow> avl(delete x t)"
  "avl t \<Longrightarrow> height t \<in> {height (delete x t), height (delete x t) + 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (avl t \<Longrightarrow> avl (delete x t)) &&& (avl t \<Longrightarrow> height t \<in> {height (delete x t), height (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 (delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> \<in> {height (delete x \<langle>\<rangle>), height (delete x \<langle>\<rangle>) + 1}
 3. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (delete x x1); avl x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; avl x3 \<Longrightarrow> avl (delete x x3); avl x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> avl (delete x \<langle>x1, (a, b), x3\<rangle>)
 4. \<And>x1 a b x3. \<lbrakk>avl x1 \<Longrightarrow> avl (delete x x1); avl x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; avl x3 \<Longrightarrow> avl (delete x x3); avl x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; avl \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> height \<langle>x1, (a, b), x3\<rangle> \<in> {height (delete x \<langle>x1, (a, b), x3\<rangle>), height (delete x \<langle>x1, (a, b), x3\<rangle>) + 1}
[PROOF STEP]
case (Node l a n r)
[PROOF STATE]
proof (state)
this:
avl l \<Longrightarrow> avl (delete x l)
avl l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
avl r \<Longrightarrow> avl (delete x r)
avl r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}

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

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

goal (2 subgoals):
 1. x = a \<Longrightarrow> avl (delete x \<langle>l, (a, n), r\<rangle>)
 2. x \<noteq> a \<Longrightarrow> avl (delete x \<langle>l, (a, n), r\<rangle>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x = a

goal (1 subgoal):
 1. avl (delete x \<langle>l, (a, n), r\<rangle>)
[PROOF STEP]
using 1 avl_split_max[of l]
[PROOF STATE]
proof (prove)
using this:
x = a
avl \<langle>l, (a, n), 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. avl (delete x \<langle>l, (a, n), r\<rangle>)
[PROOF STEP]
by (auto intro!: avl_balR split: prod.split)
[PROOF STATE]
proof (state)
this:
avl (delete x \<langle>l, (a, n), r\<rangle>)

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

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> avl (delete x \<langle>l, (a, n), r\<rangle>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> a

goal (1 subgoal):
 1. avl (delete x \<langle>l, (a, n), r\<rangle>)
[PROOF STEP]
using Node 1
[PROOF STATE]
proof (prove)
using this:
x \<noteq> a
avl l \<Longrightarrow> avl (delete x l)
avl l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
avl r \<Longrightarrow> avl (delete x r)
avl r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
avl \<langle>l, (a, n), r\<rangle>

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

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

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

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

goal (2 subgoals):
 1. x = a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
 2. x \<noteq> a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x = a

goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
using 2 avl_split_max[of l]
[PROOF STATE]
proof (prove)
using this:
x = a
avl \<langle>l, (a, n), 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, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), 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, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), 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, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
proof(cases "x<a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
 2. \<not> x < a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < a

goal (2 subgoals):
 1. x < a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
 2. \<not> x < a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), 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 (delete x l) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
 2. height r \<noteq> height (delete x l) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
height r \<noteq> height (delete x l) + 2

goal (2 subgoals):
 1. height r = height (delete x l) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
 2. height r \<noteq> height (delete x l) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
height r \<noteq> height (delete x l) + 2

goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
using 2 Node(1,2) \<open>x < a\<close>
[PROOF STATE]
proof (prove)
using this:
height r \<noteq> height (delete x l) + 2
avl \<langle>l, (a, n), r\<rangle>
avl l \<Longrightarrow> avl (delete x l)
avl l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
x < a

goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
by(auto simp: balR_def)
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal (1 subgoal):
 1. height r = height (delete x l) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. height r = height (delete x l) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
height r = height (delete x l) + 2

goal (1 subgoal):
 1. height r = height (delete x l) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
height r = height (delete x l) + 2

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

goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
by simp linarith
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x < a \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), 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, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), 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 (delete x r) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
 2. height l \<noteq> height (delete x r) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
height l \<noteq> height (delete x r) + 2

goal (2 subgoals):
 1. height l = height (delete x r) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
 2. height l \<noteq> height (delete x r) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
height l \<noteq> height (delete x r) + 2

goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
using 2 Node(3,4) \<open>\<not>x < a\<close> \<open>x \<noteq> a\<close>
[PROOF STATE]
proof (prove)
using this:
height l \<noteq> height (delete x r) + 2
avl \<langle>l, (a, n), r\<rangle>
avl r \<Longrightarrow> avl (delete x r)
avl r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
\<not> x < a
x \<noteq> a

goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
by(auto simp: balL_def)
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal (1 subgoal):
 1. height l = height (delete x r) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. height l = height (delete x r) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
height l = height (delete x r) + 2

goal (1 subgoal):
 1. height l = height (delete x r) + 2 \<Longrightarrow> height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
height l = height (delete x r) + 2

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

goal (1 subgoal):
 1. height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}
[PROOF STEP]
by simp linarith
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height \<langle>l, (a, n), r\<rangle> \<in> {height (delete x \<langle>l, (a, n), r\<rangle>), height (delete x \<langle>l, (a, n), r\<rangle>) + 1}

goal (2 subgoals):
 1. avl \<langle>\<rangle> \<Longrightarrow> avl (delete x \<langle>\<rangle>)
 2. avl \<langle>\<rangle> \<Longrightarrow> height \<langle>\<rangle> \<in> {height (delete x \<langle>\<rangle>), height (delete x \<langle>\<rangle>) + 1}
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma interval_mul_commute: "A * B = B * A" for A B:: "'a::linordered_idom interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = B * A
[PROOF STEP]
by (simp add: interval_eq_iff lower_times upper_times ac_simps)


[STATEMENT]
lemma matrix_to_blinfun_inv\<^sub>L:
  assumes "invertible m"
  shows "matrix_to_blinfun (matrix_inv (m :: real^_^_)) = inv\<^sub>L (matrix_to_blinfun m)"
    "invertible\<^sub>L (matrix_to_blinfun m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_blinfun (matrix_inv m) = inv\<^sub>L (matrix_to_blinfun m) &&& invertible\<^sub>L (matrix_to_blinfun m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. matrix_to_blinfun (matrix_inv m) = inv\<^sub>L (matrix_to_blinfun m)
 2. invertible\<^sub>L (matrix_to_blinfun m)
[PROOF STEP]
have "m ** matrix_inv m = mat 1" "matrix_inv m ** m = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m ** matrix_inv m = mat 1 &&& matrix_inv m ** m = mat 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invertible m

goal (1 subgoal):
 1. m ** matrix_inv m = mat 1 &&& matrix_inv m ** m = mat 1
[PROOF STEP]
by (auto simp: matrix_inv_right matrix_inv_left)
[PROOF STATE]
proof (state)
this:
m ** matrix_inv m = mat 1
matrix_inv m ** m = mat 1

goal (2 subgoals):
 1. matrix_to_blinfun (matrix_inv m) = inv\<^sub>L (matrix_to_blinfun m)
 2. invertible\<^sub>L (matrix_to_blinfun m)
[PROOF STEP]
hence "matrix_to_blinfun (matrix_inv m) o\<^sub>L matrix_to_blinfun m = id_blinfun"
    "matrix_to_blinfun m o\<^sub>L matrix_to_blinfun (matrix_inv m) = id_blinfun"
[PROOF STATE]
proof (prove)
using this:
m ** matrix_inv m = mat 1
matrix_inv m ** m = mat 1

goal (1 subgoal):
 1. matrix_to_blinfun (matrix_inv m) o\<^sub>L matrix_to_blinfun m = id_blinfun &&& matrix_to_blinfun m o\<^sub>L matrix_to_blinfun (matrix_inv m) = id_blinfun
[PROOF STEP]
by (auto simp: matrix_to_blinfun_id matrix_to_blinfun_comp[symmetric])
[PROOF STATE]
proof (state)
this:
matrix_to_blinfun (matrix_inv m) o\<^sub>L matrix_to_blinfun m = id_blinfun
matrix_to_blinfun m o\<^sub>L matrix_to_blinfun (matrix_inv m) = id_blinfun

goal (2 subgoals):
 1. matrix_to_blinfun (matrix_inv m) = inv\<^sub>L (matrix_to_blinfun m)
 2. invertible\<^sub>L (matrix_to_blinfun m)
[PROOF STEP]
thus "matrix_to_blinfun (matrix_inv m) = inv\<^sub>L (matrix_to_blinfun m)" "invertible\<^sub>L (matrix_to_blinfun m)"
[PROOF STATE]
proof (prove)
using this:
matrix_to_blinfun (matrix_inv m) o\<^sub>L matrix_to_blinfun m = id_blinfun
matrix_to_blinfun m o\<^sub>L matrix_to_blinfun (matrix_inv m) = id_blinfun

goal (1 subgoal):
 1. matrix_to_blinfun (matrix_inv m) = inv\<^sub>L (matrix_to_blinfun m) &&& invertible\<^sub>L (matrix_to_blinfun m)
[PROOF STEP]
by (auto intro: inv\<^sub>L_I)
[PROOF STATE]
proof (state)
this:
matrix_to_blinfun (matrix_inv m) = inv\<^sub>L (matrix_to_blinfun m)
invertible\<^sub>L (matrix_to_blinfun m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma keys_add_eq: "keys (a + b) = keys a \<union> keys b - {x \<in> keys a \<inter> keys b. lookup a x + lookup b x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (a + b) = keys a \<union> keys b - {x \<in> keys a \<inter> keys b. lookup a x + lookup b x = (0::'b)}
[PROOF STEP]
by (auto simp: in_keys_iff lookup_add add_eq_0_iff
      simp del: lookup_not_eq_zero_eq_in_keys)


[STATEMENT]
lemma (in group) int_pow_mult_distrib:
  assumes eq: "x \<otimes> y = y \<otimes> x" and xy: "x \<in> carrier G" "y \<in> carrier G"
  shows "(x \<otimes> y) [^] (i::int) = x [^] i \<otimes> y [^] i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
proof (cases i rule: int_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. i = int n \<Longrightarrow> (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
 2. \<And>n. i = - int (Suc n) \<Longrightarrow> (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
case (nonneg n)
[PROOF STATE]
proof (state)
this:
i = int n

goal (2 subgoals):
 1. \<And>n. i = int n \<Longrightarrow> (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
 2. \<And>n. i = - int (Suc n) \<Longrightarrow> (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = int n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i = int n

goal (1 subgoal):
 1. (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
by (metis eq int_pow_int pow_mult_distrib xy)
[PROOF STATE]
proof (state)
this:
(x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i

goal (1 subgoal):
 1. \<And>n. i = - int (Suc n) \<Longrightarrow> (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. i = - int (Suc n) \<Longrightarrow> (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
case (neg n)
[PROOF STATE]
proof (state)
this:
i = - int (Suc n)

goal (1 subgoal):
 1. \<And>n. i = - int (Suc n) \<Longrightarrow> (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = - int (Suc n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i = - int (Suc n)

goal (1 subgoal):
 1. (x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i
[PROOF STEP]
unfolding neg
[PROOF STATE]
proof (prove)
using this:
- int (Suc n) = - int (Suc n)

goal (1 subgoal):
 1. (x \<otimes> y) [^] - int (Suc n) = x [^] - int (Suc n) \<otimes> y [^] - int (Suc n)
[PROOF STEP]
apply (simp add: xy int_pow_neg_int del: of_nat_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv ((x \<otimes> y) [^] n \<otimes> (x \<otimes> y)) = inv (x [^] n \<otimes> x) \<otimes> inv (y [^] n \<otimes> y)
[PROOF STEP]
by (metis eq inv_mult_group local.nat_pow_Suc nat_pow_closed pow_mult_distrib xy)
[PROOF STATE]
proof (state)
this:
(x \<otimes> y) [^] i = x [^] i \<otimes> y [^] i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem language_Collapse_dfa:
     "Collapse.language = language"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Collapse.language = language
[PROOF STEP]
by (simp add: ext_language_Collapse_dfa subset_antisym subset_iff)


[STATEMENT]
lemma stake_cycle_eq_mod_0[simp]: "\<lbrakk>u \<noteq> []; n mod length u = 0\<rbrakk> \<Longrightarrow>
   stake n (cycle u) = concat (replicate (n div length u) u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<noteq> []; n mod length u = 0\<rbrakk> \<Longrightarrow> stake n (cycle u) = concat (replicate (n div length u) u)
[PROOF STEP]
by (induct "n div length u" arbitrary: n u)
    (auto simp: stake_add [symmetric] mod_eq_0_iff_dvd elim!: dvdE)


[STATEMENT]
lemma asymp_equiv_plus_const_right: "(\<lambda>n. real n + c) \<sim>[at_top] (\<lambda>n. real n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real n + c) \<sim>[sequentially] real
[PROOF STEP]
using asymp_equiv_plus_const_left[of c]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. c + real n) \<sim>[sequentially] real

goal (1 subgoal):
 1. (\<lambda>n. real n + c) \<sim>[sequentially] real
[PROOF STEP]
by (simp add: add.commute)


[STATEMENT]
lemma S_alt_def: "S = {(l, u) . l \<in> L \<and> u \<in> V \<and> u \<turnstile> inv_of A l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = {(l, u). l \<in> L \<and> u \<in> V \<and> u \<turnstile> PTA.inv_of A l}
[PROOF STEP]
unfolding V_def S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(l, u). l \<in> L \<and> (\<forall>x\<in>\<X>. 0 \<le> u x) \<and> u \<turnstile> PTA.inv_of A l} = {(l, u). l \<in> L \<and> u \<in> {v. \<forall>x\<in>\<X>. 0 \<le> v x} \<and> u \<turnstile> PTA.inv_of A l}
[PROOF STEP]
by auto


[STATEMENT]
lemma compactin_subtopology: "compactin (subtopology X S) T \<longleftrightarrow> compactin X T \<and> T \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compactin (subtopology X S) T = (compactin X T \<and> T \<subseteq> S)
[PROOF STEP]
by (metis compactin_subspace inf.absorb_iff2 le_inf_iff subtopology_subtopology topspace_subtopology)


[STATEMENT]
lemma card_ghole_poss_num_gholes:
  "card (ghole_poss C) = num_gholes C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (ghole_poss C) = num_gholes C
[PROOF STEP]
unfolding ghole_poss_ghole_poss_list_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (ghole_poss_list C)) = num_gholes C
[PROOF STEP]
unfolding length_ghole_poss_list_num_gholes
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (ghole_poss_list C)) = length (ghole_poss_list C)
[PROOF STEP]
using ghole_poss_list_distict
[PROOF STATE]
proof (prove)
using this:
distinct (ghole_poss_list ?C)

goal (1 subgoal):
 1. card (set (ghole_poss_list C)) = length (ghole_poss_list C)
[PROOF STEP]
using distinct_card
[PROOF STATE]
proof (prove)
using this:
distinct (ghole_poss_list ?C)
distinct ?xs \<Longrightarrow> card (set ?xs) = length ?xs

goal (1 subgoal):
 1. card (set (ghole_poss_list C)) = length (ghole_poss_list C)
[PROOF STEP]
by blast


[STATEMENT]
lemma add_fract [simp]:
  "\<lbrakk> b \<noteq> 0; d \<noteq> 0 \<rbrakk> \<Longrightarrow> Fract a b + Fract c d = Fract (a * d + c * b) (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> (0::'a); d \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> Fract a b + Fract c d = Fract (a * d + c * b) (b * d)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma symm_relation_impl_preservation_equals_reflection:
  fixes Rel  :: "('a \<times> 'a) set"
    and Pred :: "'a \<Rightarrow> bool"
  assumes symm: "sym Rel"
  shows "rel_preserves_pred Rel Pred = rel_reflects_pred Rel Pred"
    and "rel_preserves_pred Rel Pred = rel_respects_pred Rel Pred"
    and "rel_reflects_pred Rel Pred = rel_respects_pred Rel Pred"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_preserves_pred Rel Pred = rel_reflects_pred Rel Pred &&& rel_preserves_pred Rel Pred = rel_respects_pred Rel Pred &&& rel_reflects_pred Rel Pred = rel_respects_pred Rel Pred
[PROOF STEP]
using symm
[PROOF STATE]
proof (prove)
using this:
sym Rel

goal (1 subgoal):
 1. rel_preserves_pred Rel Pred = rel_reflects_pred Rel Pred &&& rel_preserves_pred Rel Pred = rel_respects_pred Rel Pred &&& rel_reflects_pred Rel Pred = rel_respects_pred Rel Pred
[PROOF STEP]
unfolding sym_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x, y) \<in> Rel \<longrightarrow> (y, x) \<in> Rel

goal (1 subgoal):
 1. rel_preserves_pred Rel Pred = rel_reflects_pred Rel Pred &&& rel_preserves_pred Rel Pred = rel_respects_pred Rel Pred &&& rel_reflects_pred Rel Pred = rel_respects_pred Rel Pred
[PROOF STEP]
by blast+


[STATEMENT]
lemma vid_on_vintersection: "vid_on (A \<inter>\<^sub>\<circ> B) = vid_on A \<inter>\<^sub>\<circ> vid_on B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vid_on (A \<inter>\<^sub>\<circ> B) = vid_on A \<inter>\<^sub>\<circ> vid_on B
[PROOF STEP]
by auto


[STATEMENT]
lemma arcsin_1 [simp]: "arcsin 1 = pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcsin 1 = pi / 2
[PROOF STEP]
using arcsin_sin [of "pi/2"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- (pi / 2) \<le> pi / 2; pi / 2 \<le> pi / 2\<rbrakk> \<Longrightarrow> arcsin (sin (pi / 2)) = pi / 2

goal (1 subgoal):
 1. arcsin 1 = pi / 2
[PROOF STEP]
by simp


[STATEMENT]
lemma space_subset_in_sets:
  fixes J::"'a::countable set set"
  assumes "J \<subseteq> I"
  assumes "\<And>j. j \<in> J \<Longrightarrow> finite j"
  shows "space (PiF J M) \<in> sets (PiF I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
have "space (PiF J M) = \<Union>{space (PiF {j} M)|j. j \<in> J}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (Pi\<^sub>F J M) = \<Union> {space (Pi\<^sub>F {j} M) |j. j \<in> J}
[PROOF STEP]
unfolding space_PiF
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>J\<in>J. \<Pi>' j\<in>J. space (M j)) = \<Union> {\<Union>J\<in>{j}. \<Pi>' j\<in>J. space (M j) |j. j \<in> J}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
space (Pi\<^sub>F J M) = \<Union> {space (Pi\<^sub>F {j} M) |j. j \<in> J}

goal (1 subgoal):
 1. space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
space (Pi\<^sub>F J M) = \<Union> {space (Pi\<^sub>F {j} M) |j. j \<in> J}

goal (1 subgoal):
 1. space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
have "\<dots> \<in> sets (PiF I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {space (Pi\<^sub>F {j} M) |j. j \<in> J} \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
J \<subseteq> I
?j \<in> J \<Longrightarrow> finite ?j

goal (1 subgoal):
 1. \<Union> {space (Pi\<^sub>F {j} M) |j. j \<in> J} \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
by (intro countable_finite_comprehension) (auto simp: singleton_space_subset_in_sets)
[PROOF STATE]
proof (state)
this:
\<Union> {space (Pi\<^sub>F {j} M) |j. j \<in> J} \<in> sets (Pi\<^sub>F I M)

goal (1 subgoal):
 1. space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)

goal (1 subgoal):
 1. space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
space (Pi\<^sub>F J M) \<in> sets (Pi\<^sub>F I M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card1_eI: "1 \<le> card S \<Longrightarrow> \<exists>y S'. S = {y} \<union> S' \<and> y \<notin> S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> card S \<Longrightarrow> \<exists>y S'. S = {y} \<union> S' \<and> y \<notin> S'
[PROOF STEP]
by (metis One_nat_def card.infinite card_le_Suc_iff insert_is_Un leD zero_less_Suc)


[STATEMENT]
lemma sum_mset_delta:
  "sum_mset (image_mset (\<lambda>x. if x = y then c else 0) A) = c * of_nat (count A y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>#A. if x = y then c else (0::'a)) = c * of_nat (count A y)
[PROOF STEP]
by (induction A) (simp_all add: algebra_simps)


[STATEMENT]
theorem prepareNet_correct: "case (prepareNet el s t) of
      Some (c, adjmap,N) \<Rightarrow> (el, c) \<in> ln_rel \<and> Network c s t
        \<and> Graph.is_adj_map c adjmap \<and> Graph.V c \<subseteq> {0..<N}
    | None \<Rightarrow> \<not>ln_invar el \<or> \<not>Network (ln_\<alpha> el) s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. case prepareNet el s t of None \<Rightarrow> \<not> ln_invar el \<or> \<not> Network (ln_\<alpha> el) s t | Some (c, adjmap, N) \<Rightarrow> (el, c) \<in> ln_rel \<and> Network c s t \<and> Graph.is_adj_map c adjmap \<and> Graph.V c \<subseteq> {0..<N}
[PROOF STEP]
using checkNet4_correct[of el s t] ln_N_correct[of el]
[PROOF STATE]
proof (prove)
using this:
case checkNet4 el s t of None \<Rightarrow> \<not> ln_invar el \<or> \<not> Network (ln_\<alpha> el) s t | Some (c, adjmap) \<Rightarrow> (el, c) \<in> ln_rel \<and> Network c s t \<and> Graph.is_adj_map c adjmap
Graph.V (ln_\<alpha> el) \<subseteq> {0..<ln_N el}

goal (1 subgoal):
 1. case prepareNet el s t of None \<Rightarrow> \<not> ln_invar el \<or> \<not> Network (ln_\<alpha> el) s t | Some (c, adjmap, N) \<Rightarrow> (el, c) \<in> ln_rel \<and> Network c s t \<and> Graph.is_adj_map c adjmap \<and> Graph.V c \<subseteq> {0..<N}
[PROOF STEP]
unfolding prepareNet_def
[PROOF STATE]
proof (prove)
using this:
case checkNet4 el s t of None \<Rightarrow> \<not> ln_invar el \<or> \<not> Network (ln_\<alpha> el) s t | Some (c, adjmap) \<Rightarrow> (el, c) \<in> ln_rel \<and> Network c s t \<and> Graph.is_adj_map c adjmap
Graph.V (ln_\<alpha> el) \<subseteq> {0..<ln_N el}

goal (1 subgoal):
 1. case checkNet4 el s t \<bind> (\<lambda>(c, adjmap). let N = ln_N el in Some (c, adjmap, N)) of None \<Rightarrow> \<not> ln_invar el \<or> \<not> Network (ln_\<alpha> el) s t | Some (c, adjmap, N) \<Rightarrow> (el, c) \<in> ln_rel \<and> Network c s t \<and> Graph.is_adj_map c adjmap \<and> Graph.V c \<subseteq> {0..<N}
[PROOF STEP]
by (auto split: Option.bind_split simp: ln_rel_def br_def)


[STATEMENT]
lemma affine_hull_finite_intersection_hyperplanes:
  fixes S :: "'a::euclidean_space set"
  obtains \<F> where
     "finite \<F>"
     "of_nat (card \<F>) + aff_dim S = DIM('a)"
     "affine hull S = \<Inter>\<F>"
     "\<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain b where "b \<subseteq> S"
             and indb: "\<not> affine_dependent b"
             and eq: "affine hull S = affine hull b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<subseteq> S; \<not> affine_dependent b; affine hull S = affine hull b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using affine_basis_exists
[PROOF STATE]
proof (prove)
using this:
\<exists>B\<subseteq>?V. \<not> affine_dependent B \<and> affine hull ?V = affine hull B

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<subseteq> S; \<not> affine_dependent b; affine hull S = affine hull b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<subseteq> S
\<not> affine_dependent b
affine hull S = affine hull b

goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain c where indc: "\<not> affine_dependent c" and "b \<subseteq> c"
             and affc: "affine hull c = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>\<not> affine_dependent c; b \<subseteq> c; affine hull c = UNIV\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis extend_to_affine_basis affine_UNIV hull_same indb subset_UNIV)
[PROOF STATE]
proof (state)
this:
\<not> affine_dependent c
b \<subseteq> c
affine hull c = UNIV

goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> affine_dependent c
b \<subseteq> c
affine hull c = UNIV
[PROOF STEP]
have "finite c"
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent c
b \<subseteq> c
affine hull c = UNIV

goal (1 subgoal):
 1. finite c
[PROOF STEP]
by (simp add: aff_independent_finite)
[PROOF STATE]
proof (state)
this:
finite c

goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite c
[PROOF STEP]
have fbc: "finite b" "card b \<le> card c"
[PROOF STATE]
proof (prove)
using this:
finite c

goal (1 subgoal):
 1. finite b &&& card b \<le> card c
[PROOF STEP]
using \<open>b \<subseteq> c\<close> infinite_super
[PROOF STATE]
proof (prove)
using this:
finite c
b \<subseteq> c
\<lbrakk>?S \<subseteq> ?T; infinite ?S\<rbrakk> \<Longrightarrow> infinite ?T

goal (1 subgoal):
 1. finite b &&& card b \<le> card c
[PROOF STEP]
by (auto simp: card_mono)
[PROOF STATE]
proof (state)
this:
finite b
card b \<le> card c

goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have imeq: "(\<lambda>x. affine hull x) ` ((\<lambda>a. c - {a}) ` (c - b)) = ((\<lambda>a. affine hull (c - {a})) ` (c - b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (hull) affine ` (\<lambda>a. c - {a}) ` (c - b) = (\<lambda>a. affine hull (c - {a})) ` (c - b)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(hull) affine ` (\<lambda>a. c - {a}) ` (c - b) = (\<lambda>a. affine hull (c - {a})) ` (c - b)

goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have card_cb: "(card (c - b)) + aff_dim S = DIM('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card (c - b)) + aff_dim S = int DIM('a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int (card (c - b)) + aff_dim S = int DIM('a)
[PROOF STEP]
have aff: "aff_dim (UNIV::'a set) = aff_dim c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim UNIV = aff_dim c
[PROOF STEP]
by (metis aff_dim_affine_hull affc)
[PROOF STATE]
proof (state)
this:
aff_dim UNIV = aff_dim c

goal (1 subgoal):
 1. int (card (c - b)) + aff_dim S = int DIM('a)
[PROOF STEP]
have "aff_dim b = aff_dim S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim b = aff_dim S
[PROOF STEP]
by (metis (no_types) aff_dim_affine_hull eq)
[PROOF STATE]
proof (state)
this:
aff_dim b = aff_dim S

goal (1 subgoal):
 1. int (card (c - b)) + aff_dim S = int DIM('a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim b = aff_dim S
[PROOF STEP]
have "int (card b) = 1 + aff_dim S"
[PROOF STATE]
proof (prove)
using this:
aff_dim b = aff_dim S

goal (1 subgoal):
 1. int (card b) = 1 + aff_dim S
[PROOF STEP]
by (simp add: aff_dim_affine_independent indb)
[PROOF STATE]
proof (state)
this:
int (card b) = 1 + aff_dim S

goal (1 subgoal):
 1. int (card (c - b)) + aff_dim S = int DIM('a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (card b) = 1 + aff_dim S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (card b) = 1 + aff_dim S

goal (1 subgoal):
 1. int (card (c - b)) + aff_dim S = int DIM('a)
[PROOF STEP]
using fbc aff
[PROOF STATE]
proof (prove)
using this:
int (card b) = 1 + aff_dim S
finite b
card b \<le> card c
aff_dim UNIV = aff_dim c

goal (1 subgoal):
 1. int (card (c - b)) + aff_dim S = int DIM('a)
[PROOF STEP]
by (simp add: \<open>\<not> affine_dependent c\<close> \<open>b \<subseteq> c\<close> aff_dim_affine_independent card_Diff_subset of_nat_diff)
[PROOF STATE]
proof (state)
this:
int (card (c - b)) + aff_dim S = int DIM('a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int (card (c - b)) + aff_dim S = int DIM('a)

goal (1 subgoal):
 1. (\<And>\<F>. \<lbrakk>finite \<F>; int (card \<F>) + aff_dim S = int DIM('a); affine hull S = \<Inter> \<F>; \<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof (cases "c = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = b \<Longrightarrow> thesis
 2. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = b

goal (2 subgoals):
 1. c = b \<Longrightarrow> thesis
 2. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite ?\<F>
 2. int (card ?\<F>) + aff_dim S = int DIM('a)
 3. affine hull S = \<Inter> ?\<F>
 4. \<And>h. h \<in> ?\<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
show "int (card {}) + aff_dim S = int DIM('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card {}) + aff_dim S = int DIM('a)
[PROOF STEP]
using True card_cb
[PROOF STATE]
proof (prove)
using this:
c = b
int (card (c - b)) + aff_dim S = int DIM('a)

goal (1 subgoal):
 1. int (card {}) + aff_dim S = int DIM('a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (card {}) + aff_dim S = int DIM('a)

goal (3 subgoals):
 1. finite {}
 2. affine hull S = \<Inter> {}
 3. \<And>h. h \<in> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
show "affine hull S = \<Inter> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = \<Inter> {}
[PROOF STEP]
using True affc eq
[PROOF STATE]
proof (prove)
using this:
c = b
affine hull c = UNIV
affine hull S = affine hull b

goal (1 subgoal):
 1. affine hull S = \<Inter> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
affine hull S = \<Inter> {}

goal (2 subgoals):
 1. finite {}
 2. \<And>h. h \<in> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
thesis

goal (1 subgoal):
 1. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> b

goal (1 subgoal):
 1. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
have ind: "\<not> affine_dependent (\<Union>a\<in>c - b. c - {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> affine_dependent (\<Union>a\<in>c - b. c - {a})
[PROOF STEP]
by (rule affine_independent_subset [OF indc]) auto
[PROOF STATE]
proof (state)
this:
\<not> affine_dependent (\<Union>a\<in>c - b. c - {a})

goal (1 subgoal):
 1. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
have *: "1 + aff_dim (c - {t}) = int (DIM('a))" if t: "t \<in> c" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + aff_dim (c - {t}) = int DIM('a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 + aff_dim (c - {t}) = int DIM('a)
[PROOF STEP]
have "insert t c = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert t c = c
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
t \<in> c

goal (1 subgoal):
 1. insert t c = c
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
insert t c = c

goal (1 subgoal):
 1. 1 + aff_dim (c - {t}) = int DIM('a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
insert t c = c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
insert t c = c

goal (1 subgoal):
 1. 1 + aff_dim (c - {t}) = int DIM('a)
[PROOF STEP]
by (metis (full_types) add.commute aff_dim_affine_hull aff_dim_insert aff_dim_UNIV affc affine_dependent_def indc insert_Diff_single t)
[PROOF STATE]
proof (state)
this:
1 + aff_dim (c - {t}) = int DIM('a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?t \<in> c \<Longrightarrow> 1 + aff_dim (c - {?t}) = int DIM('a)

goal (1 subgoal):
 1. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
let ?\<F> = "(\<lambda>x. affine hull x) ` ((\<lambda>a. c - {a}) ` (c - b))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> b \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. finite ?\<F>
 2. int (card ?\<F>) + aff_dim S = int DIM('a)
 3. affine hull S = \<Inter> ?\<F>
 4. \<And>h. h \<in> ?\<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
have "card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)
[PROOF STEP]
proof (rule card_image)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>a. affine hull (c - {a})) (c - b)
[PROOF STEP]
show "inj_on (\<lambda>a. affine hull (c - {a})) (c - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>a. affine hull (c - {a})) (c - b)
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>c - b. \<forall>y\<in>c - b. affine hull (c - {x}) = affine hull (c - {y}) \<longrightarrow> x = y
[PROOF STEP]
by (metis Diff_eq_empty_iff Diff_iff indc affine_dependent_def hull_subset insert_iff)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>a. affine hull (c - {a})) (c - b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)

goal (4 subgoals):
 1. finite ?\<F>
 2. int (card ?\<F>) + aff_dim S = int DIM('a)
 3. affine hull S = \<Inter> ?\<F>
 4. \<And>h. h \<in> ?\<F> \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)
[PROOF STEP]
show "int (card ?\<F>) + aff_dim S = int DIM('a)"
[PROOF STATE]
proof (prove)
using this:
card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)

goal (1 subgoal):
 1. int (card ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))) + aff_dim S = int DIM('a)
[PROOF STEP]
by (simp add: imeq card_cb)
[PROOF STATE]
proof (state)
this:
int (card ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))) + aff_dim S = int DIM('a)

goal (3 subgoals):
 1. finite ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))
 2. affine hull S = \<Inter> ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))
 3. \<And>h. h \<in> (hull) affine ` (\<lambda>a. c - {a}) ` (c - b) \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
show "affine hull S = \<Inter> ?\<F>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = \<Inter> ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))
[PROOF STEP]
by (metis Diff_eq_empty_iff INT_simps(4) UN_singleton order_refl \<open>b \<subseteq> c\<close> False eq double_diff affine_hull_Inter [OF ind])
[PROOF STATE]
proof (state)
this:
affine hull S = \<Inter> ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))

goal (2 subgoals):
 1. finite ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))
 2. \<And>h. h \<in> (hull) affine ` (\<lambda>a. c - {a}) ` (c - b) \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
have "\<And>a. \<lbrakk>a \<in> c; a \<notin> b\<rbrakk> \<Longrightarrow> aff_dim (c - {a}) = int (DIM('a) - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<in> c; a \<notin> b\<rbrakk> \<Longrightarrow> aff_dim (c - {a}) = int (DIM('a) - Suc 0)
[PROOF STEP]
by (metis "*" DIM_ge_Suc0 One_nat_def add_diff_cancel_left' int_ops(2) of_nat_diff)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> c; ?a \<notin> b\<rbrakk> \<Longrightarrow> aff_dim (c - {?a}) = int (DIM('a) - Suc 0)

goal (2 subgoals):
 1. finite ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))
 2. \<And>h. h \<in> (hull) affine ` (\<lambda>a. c - {a}) ` (c - b) \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?a \<in> c; ?a \<notin> b\<rbrakk> \<Longrightarrow> aff_dim (c - {?a}) = int (DIM('a) - Suc 0)
[PROOF STEP]
show "\<And>h. h \<in> ?\<F> \<Longrightarrow> \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x = b}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> c; ?a \<notin> b\<rbrakk> \<Longrightarrow> aff_dim (c - {?a}) = int (DIM('a) - Suc 0)

goal (1 subgoal):
 1. \<And>h. h \<in> (hull) affine ` (\<lambda>a. c - {a}) ` (c - b) \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x = b}
[PROOF STEP]
by (auto simp only: One_nat_def aff_dim_eq_hyperplane [symmetric])
[PROOF STATE]
proof (state)
this:
?h \<in> (hull) affine ` (\<lambda>a. c - {a}) ` (c - b) \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> ?h = {x. a \<bullet> x = b}

goal (1 subgoal):
 1. finite ((hull) affine ` (\<lambda>a. c - {a}) ` (c - b))
[PROOF STEP]
qed (use \<open>finite c\<close> in auto)
[PROOF STATE]
proof (state)
this:
thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iterate_add_less_eq_iff1:
  "j \<le> (i::nat) \<Longrightarrow> (iterate_add i (u:: 'a :: {cancel_comm_monoid_add, ordered_ab_semigroup_add_imp_le}) + m \<le> iterate_add j u + n) = (iterate_add (i-j) u + m \<le> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> (iterate_add i u + m \<le> iterate_add j u + n) = (iterate_add (i - j) u + m \<le> n)
[PROOF STEP]
by (auto dest!: le_Suc_ex add_right_imp_eq simp: ab_semigroup_add_class.add_ac(1))


[STATEMENT]
lemma matrix_scaleR_right: "r *\<^sub>R (a::'a::real_algebra_1^'n^'m) ** b = r *\<^sub>R (a ** b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r *\<^sub>R a ** b = r *\<^sub>R (a ** b)
[PROOF STEP]
by (vector matrix_matrix_mult_def algebra_simps scaleR_sum_right)


[STATEMENT]
lemma lSup_minus_LNil: "lSup (Y - {LNil}) = lSup Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lSup (Y - {LNil}) = lSup Y
[PROOF STEP]
using lSup_insert_LNil[where Y="Y - {LNil}", symmetric]
[PROOF STATE]
proof (prove)
using this:
lSup (Y - {LNil}) = lSup (insert LNil (Y - {LNil}))

goal (1 subgoal):
 1. lSup (Y - {LNil}) = lSup Y
[PROOF STEP]
by(cases "LNil \<in> Y")(simp_all add: insert_absorb)


[STATEMENT]
lemma expands_to_basic_inverse:
  assumes "basis_wf (b # basis)" "length basis = expansion_level TYPE('a::multiseries)"
  shows   "((\<lambda>x. inverse (b x)) expands_to
             MS (MSLCons (const_expansion 1 :: 'a, -1) MSLNil) (\<lambda>x. b x powr -1)) (b # basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
basis_wf (b # basis)
length basis = expansion_level TYPE('a)
[PROOF STEP]
have "eventually (\<lambda>x. b x > 0) at_top"
[PROOF STATE]
proof (prove)
using this:
basis_wf (b # basis)
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < b x
[PROOF STEP]
by (simp add: basis_wf_Cons filterlim_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < b x

goal (1 subgoal):
 1. ((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < b x

goal (1 subgoal):
 1. ((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)
[PROOF STEP]
have "(\<lambda>a. inverse (a powr 1)) \<in> o(\<lambda>a. a powr e')" if "e' > -1" for e' :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. inverse (a powr 1)) \<in> o(\<lambda>a. a powr e')
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
- 1 < e'

goal (1 subgoal):
 1. (\<lambda>a. inverse (a powr 1)) \<in> o(\<lambda>a. a powr e')
[PROOF STEP]
by (simp add: landau_o.small.inverse_eq2 powr_add [symmetric] one_smallo_powr)
[PROOF STATE]
proof (state)
this:
- 1 < ?e' \<Longrightarrow> (\<lambda>a. inverse (a powr 1)) \<in> o(\<lambda>a. a powr ?e')

goal (1 subgoal):
 1. ((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. 0 < b x
- 1 < ?e' \<Longrightarrow> (\<lambda>a. inverse (a powr 1)) \<in> o(\<lambda>a. a powr ?e')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 < b x
- 1 < ?e' \<Longrightarrow> (\<lambda>a. inverse (a powr 1)) \<in> o(\<lambda>a. a powr ?e')

goal (1 subgoal):
 1. ((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 < b x
- 1 < ?e' \<Longrightarrow> (\<lambda>a. inverse (a powr 1)) \<in> o(\<lambda>a. a powr ?e')
basis_wf (b # basis)
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. ((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)
[PROOF STEP]
by (auto simp: expands_to.simps basis_wf_Cons powr_minus
             elim: eventually_mono
             intro!: is_expansion_aux.intros is_expansion_const
                     landau_o.small.compose[of _ at_top _ b])
[PROOF STATE]
proof (state)
this:
((\<lambda>x. inverse (b x)) expands_to MS (MSLCons (const_expansion 1, - 1) MSLNil) (\<lambda>x. b x powr - 1)) (b # basis)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fis_singleton_alt: "fis_singleton f = (\<exists>e. f = {|e|})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fis_singleton f = (\<exists>e. f = {|e|})
[PROOF STEP]
by (metis fis_singleton.rep_eq fset_inverse fset_simps(1) fset_simps(2) is_singleton_def)


[STATEMENT]
lemma (in algebraic_semidom) is_unit_prod_mset_iff:
  "is_unit (prod_mset A) \<longleftrightarrow> (\<forall>x \<in># A. is_unit x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (\<Prod>\<^sub># A) = (\<forall>x\<in>#A. is_unit x)
[PROOF STEP]
by (induct A) (auto simp: is_unit_mult_iff)


[STATEMENT]
lemma field_sum_of_halves: "x / 2 + x / 2 = x"
  for x :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / (2::'a) + x / (2::'a) = x
[PROOF STEP]
by simp


[STATEMENT]
lemma trans_imp_quasi_trans: "trans r \<Longrightarrow> quasi_trans r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans r \<Longrightarrow> quasi_trans r
[PROOF STEP]
by (rule quasi_transI, unfold strict_pref_def trans_def, blast)


[STATEMENT]
lemma path_image_subpath:
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
  shows "path_image(subpath u v g) = (if u \<le> v then g ` {u..v} else g ` {v..u})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (subpath u v g) = (if u \<le> v then g ` {u..v} else g ` {v..u})
[PROOF STEP]
by (simp add: path_image_subpath_gen closed_segment_eq_real_ivl)


[STATEMENT]
lemma zero_not_in_nonzero: "\<zero>\<^bsub>R\<^esub> \<notin> nonzero R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>R\<^esub> \<notin> nonzero R
[PROOF STEP]
unfolding nonzero_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>R\<^esub> \<notin> {a \<in> carrier R. a \<noteq> \<zero>\<^bsub>R\<^esub>}
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_segment_closed_segment_subset:
  fixes s::real and i::nat
  assumes "s \<in> closed_segment a b"
  assumes "a \<in> closed_segment c d" "b \<in> closed_segment c d"
  shows "s \<in> closed_segment c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> {c--d}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s \<in> {a--b}
a \<in> {c--d}
b \<in> {c--d}

goal (1 subgoal):
 1. s \<in> {c--d}
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl split: if_split_asm)


[STATEMENT]
lemma ssorted_iff_mono: "ssorted s \<longleftrightarrow> (\<forall>i j. i \<le> j \<longrightarrow> s !! i \<le> s !! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ssorted s = (\<forall>i j. i \<le> j \<longrightarrow> s !! i \<le> s !! j)
[PROOF STEP]
using ssorted_monoI ssorted_monoD
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i \<le> j \<longrightarrow> ?s !! i \<le> ?s !! j \<Longrightarrow> ssorted ?s
\<lbrakk>ssorted ?s; ?i \<le> ?j\<rbrakk> \<Longrightarrow> ?s !! ?i \<le> ?s !! ?j

goal (1 subgoal):
 1. ssorted s = (\<forall>i j. i \<le> j \<longrightarrow> s !! i \<le> s !! j)
[PROOF STEP]
by metis


[STATEMENT]
lemma literal_ordering_trans :
  assumes "literal_ordering A B"
  assumes "literal_ordering B C"
  shows "literal_ordering A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. literal_ordering A C
[PROOF STEP]
using assms(1) assms(2) atom_ordering_trans literal_ordering.simps
[PROOF STATE]
proof (prove)
using this:
literal_ordering A B
literal_ordering B C
\<forall>x y z. (x, y) \<in> atom_ordering \<longrightarrow> (y, z) \<in> atom_ordering \<longrightarrow> (x, z) \<in> atom_ordering
literal_ordering ?L1.0 ?L2.0 = ((atom ?L1.0, atom ?L2.0) \<in> atom_ordering)

goal (1 subgoal):
 1. literal_ordering A C
[PROOF STEP]
by blast


[STATEMENT]
lemma IVT_two_functions:
  fixes f :: "('a::{linear_continuum_topology, real_vector}) \<Rightarrow>
  ('b::{linorder_topology,real_normed_vector,ordered_ab_group_add})"
  assumes conts: "continuous_on {a..b} f" "continuous_on {a..b} g"
      and ahyp: "f a < g a" and bhyp: "g b < f b " and "a \<le> b"
    shows "\<exists>x\<in>{a..b}. f x = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
let "?h x" = "f x - g x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
have "?h a \<le> 0" and "?h b \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a - g a \<le> (0::'b) &&& (0::'b) \<le> f b - g b
[PROOF STEP]
using ahyp bhyp
[PROOF STATE]
proof (prove)
using this:
f a < g a
g b < f b

goal (1 subgoal):
 1. f a - g a \<le> (0::'b) &&& (0::'b) \<le> f b - g b
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
f a - g a \<le> (0::'b)
(0::'b) \<le> f b - g b

goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f a - g a \<le> (0::'b)
(0::'b) \<le> f b - g b

goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
have "continuous_on {a..b} ?h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>a. f a - g a)
[PROOF STEP]
using conts continuous_on_diff
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} f
continuous_on {a..b} g
\<lbrakk>continuous_on ?s ?f; continuous_on ?s ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (\<lambda>x. ?f x - ?g x)

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>a. f a - g a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>a. f a - g a)

goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f a - g a \<le> (0::'b)
(0::'b) \<le> f b - g b
continuous_on {a..b} (\<lambda>a. f a - g a)
[PROOF STEP]
obtain x where "a \<le> x" "x \<le> b" and "?h x = 0"
[PROOF STATE]
proof (prove)
using this:
f a - g a \<le> (0::'b)
(0::'b) \<le> f b - g b
continuous_on {a..b} (\<lambda>a. f a - g a)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>a \<le> x; x \<le> b; f x - g x = (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using IVT'[of "?h"] \<open>a \<le> b\<close>
[PROOF STATE]
proof (prove)
using this:
f a - g a \<le> (0::'b)
(0::'b) \<le> f b - g b
continuous_on {a..b} (\<lambda>a. f a - g a)
\<lbrakk>f ?a - g ?a \<le> ?y; ?y \<le> f ?b - g ?b; ?a \<le> ?b; continuous_on {?a..?b} (\<lambda>a. f a - g a)\<rbrakk> \<Longrightarrow> \<exists>x\<ge>?a. x \<le> ?b \<and> f x - g x = ?y
a \<le> b

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>a \<le> x; x \<le> b; f x - g x = (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<le> x
x \<le> b
f x - g x = (0::'b)

goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x \<le> b
f x - g x = (0::'b)

goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
using \<open>a \<le> b\<close>
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x \<le> b
f x - g x = (0::'b)
a \<le> b

goal (1 subgoal):
 1. \<exists>x\<in>{a..b}. f x = g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{a..b}. f x = g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_inverse_neq_Ex:
  "\<exists>a :: ('a :: {inverse, comm_ring_1, division_ring}) hyperdual . inverse (inverse a) \<noteq> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. inverse (inverse a) \<noteq> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. inverse (inverse a) \<noteq> a
[PROOF STEP]
have "\<exists>a :: 'a hyperdual . Base a = 0 \<and> a \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. Base a = (0::'a) \<and> a \<noteq> 0
[PROOF STEP]
by (metis (full_types) hyperdual.sel(1) hyperdual.sel(4) zero_neq_one)
[PROOF STATE]
proof (state)
this:
\<exists>a. Base a = (0::'a) \<and> a \<noteq> 0

goal (1 subgoal):
 1. \<exists>a. inverse (inverse a) \<noteq> a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>a. Base a = (0::'a) \<and> a \<noteq> 0

goal (1 subgoal):
 1. \<exists>a. inverse (inverse a) \<noteq> a
[PROOF STEP]
have "\<And>a :: 'a hyperdual . (Base a = 0 \<and> a \<noteq> 0) \<Longrightarrow> (inverse (inverse a) \<noteq> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. Base a = (0::'a) \<and> a \<noteq> 0 \<Longrightarrow> inverse (inverse a) \<noteq> a
[PROOF STEP]
using hyp_inverse_zero hyp_invertible_inverse
[PROOF STATE]
proof (prove)
using this:
(inverse ?a = 0) = (Base ?a = (0::?'a))
(Base ?a = (0::?'a)) = (Base (inverse ?a) = (0::?'a))

goal (1 subgoal):
 1. \<And>a. Base a = (0::'a) \<and> a \<noteq> 0 \<Longrightarrow> inverse (inverse a) \<noteq> a
[PROOF STEP]
by smt
[PROOF STATE]
proof (state)
this:
Base ?a = (0::'a) \<and> ?a \<noteq> 0 \<Longrightarrow> inverse (inverse ?a) \<noteq> ?a

goal (1 subgoal):
 1. \<exists>a. inverse (inverse a) \<noteq> a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. Base a = (0::'a) \<and> a \<noteq> 0
Base ?a = (0::'a) \<and> ?a \<noteq> 0 \<Longrightarrow> inverse (inverse ?a) \<noteq> ?a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>a. Base a = (0::'a) \<and> a \<noteq> 0
Base ?a = (0::'a) \<and> ?a \<noteq> 0 \<Longrightarrow> inverse (inverse ?a) \<noteq> ?a

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AC_mono:
  fixes a::"'s prog"
  assumes rab: "a \<sqsubseteq> b" and rcd: "c \<sqsubseteq> d"
  shows "(a \<Squnion> c) \<sqsubseteq> (b \<Squnion> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Squnion> c) \<sqsubseteq> (b \<Squnion> d)
[PROOF STEP]
proof(rule refinesI, unfold wp_eval, rule le_funI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> max (wp a P x) (wp c P x) \<le> max (wp b P x) (wp d P x)
[PROOF STEP]
fix P::"'s \<Rightarrow> real" and s::'s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> max (wp a P x) (wp c P x) \<le> max (wp b P x) (wp d P x)
[PROOF STEP]
assume sP: "sound P"
[PROOF STATE]
proof (state)
this:
sound P

goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> max (wp a P x) (wp c P x) \<le> max (wp b P x) (wp d P x)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<sqsubseteq> b
c \<sqsubseteq> d
sound P
[PROOF STEP]
have "wp a P s \<le> wp b P s" and "wp c P s \<le> wp d P s"
[PROOF STATE]
proof (prove)
using this:
a \<sqsubseteq> b
c \<sqsubseteq> d
sound P

goal (1 subgoal):
 1. wp a P s \<le> wp b P s &&& wp c P s \<le> wp d P s
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
wp a P s \<le> wp b P s
wp c P s \<le> wp d P s

goal (1 subgoal):
 1. \<And>P x. sound P \<Longrightarrow> max (wp a P x) (wp c P x) \<le> max (wp b P x) (wp d P x)
[PROOF STEP]
thus "max (wp a P s) (wp c P s) \<le> max (wp b P s) (wp d P s)"
[PROOF STATE]
proof (prove)
using this:
wp a P s \<le> wp b P s
wp c P s \<le> wp d P s

goal (1 subgoal):
 1. max (wp a P s) (wp c P s) \<le> max (wp b P s) (wp d P s)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
max (wp a P s) (wp c P s) \<le> max (wp b P s) (wp d P s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SUP_ereal_mult_left:
  fixes f :: "'a \<Rightarrow> ereal"
  assumes "I \<noteq> {}"
  assumes f: "\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i" and c: "0 \<le> c"
  shows "(SUP i\<in>I. c * f i) = c * (SUP i\<in>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
proof (cases "(SUP i \<in> I. f i) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sup (f ` I) = 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
 2. Sup (f ` I) \<noteq> 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Sup (f ` I) = 0

goal (2 subgoals):
 1. Sup (f ` I) = 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
 2. Sup (f ` I) \<noteq> 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sup (f ` I) = 0
[PROOF STEP]
have "\<And>i. i \<in> I \<Longrightarrow> f i = 0"
[PROOF STATE]
proof (prove)
using this:
Sup (f ` I) = 0

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> f i = 0
[PROOF STEP]
by (metis SUP_upper f antisym)
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> f ?i = 0

goal (2 subgoals):
 1. Sup (f ` I) = 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
 2. Sup (f ` I) \<noteq> 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
Sup (f ` I) = 0
?i \<in> I \<Longrightarrow> f ?i = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Sup (f ` I) = 0
?i \<in> I \<Longrightarrow> f ?i = 0

goal (1 subgoal):
 1. (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(SUP i\<in>I. c * f i) = c * Sup (f ` I)

goal (1 subgoal):
 1. Sup (f ` I) \<noteq> 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sup (f ` I) \<noteq> 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Sup (f ` I) \<noteq> 0

goal (1 subgoal):
 1. Sup (f ` I) \<noteq> 0 \<Longrightarrow> (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sup (f ` I) \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Sup (f ` I) \<noteq> 0

goal (1 subgoal):
 1. (SUP i\<in>I. c * f i) = c * Sup (f ` I)
[PROOF STEP]
by (subst continuous_at_Sup_mono[where f="\<lambda>x. c * x"])
       (auto simp: mono_def continuous_at continuous_at_imp_continuous_at_within \<open>I \<noteq> {}\<close> image_comp
             intro!: ereal_mult_left_mono c)
[PROOF STATE]
proof (state)
this:
(SUP i\<in>I. c * f i) = c * Sup (f ` I)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma evalmat_unfold:
  "evalmat P A = (\<Sum>i = 0..degree P. coeff P i *k matpow A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evalmat P A = (\<Sum>i = 0..degree P. coeff P i *k matpow A i)
[PROOF STEP]
by (simp add: evalmat_def atMost_def [symmetric] atMost_atLeast0)


[STATEMENT]
lemma abs_conv_abscissa_norm [simp]:
  fixes f :: "'a :: dirichlet_series fds"
  shows "abs_conv_abscissa (fds_norm f) = abs_conv_abscissa f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa (fds_norm f) = abs_conv_abscissa f
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. abs_conv_abscissa (fds_norm f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_norm f)
[PROOF STEP]
show "abs_conv_abscissa f \<le> abs_conv_abscissa (fds_norm f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa f \<le> abs_conv_abscissa (fds_norm f)
[PROOF STEP]
proof (rule abs_conv_abscissa_leI_weak)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. abs_conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. abs_conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
assume "abs_conv_abscissa (fds_norm f) < ereal x"
[PROOF STATE]
proof (state)
this:
abs_conv_abscissa (fds_norm f) < ereal x

goal (1 subgoal):
 1. \<And>x. abs_conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
hence "fds_abs_converges (fds_norm f) (of_real x)"
[PROOF STATE]
proof (prove)
using this:
abs_conv_abscissa (fds_norm f) < ereal x

goal (1 subgoal):
 1. fds_abs_converges (fds_norm f) (of_real x)
[PROOF STEP]
by (intro fds_abs_converges) auto
[PROOF STATE]
proof (state)
this:
fds_abs_converges (fds_norm f) (of_real x)

goal (1 subgoal):
 1. \<And>x. abs_conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
thus "fds_abs_converges f (of_real x)"
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges (fds_norm f) (of_real x)

goal (1 subgoal):
 1. fds_abs_converges f (of_real x)
[PROOF STEP]
by (simp add: fds_abs_converges_norm_iff')
[PROOF STATE]
proof (state)
this:
fds_abs_converges f (of_real x)

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

goal (1 subgoal):
 1. abs_conv_abscissa (fds_norm f) \<le> abs_conv_abscissa f
[PROOF STEP]
qed (auto intro!: abs_conv_abscissa_leI_weak simp: fds_abs_converges_norm_iff' fds_abs_converges)


[STATEMENT]
theorem select_rec_partition:
  assumes "d > 0" "k < length xs"
  shows "select k xs = (
           let (ys, zs) = partition (\<lambda>y. y \<le> x) xs
           in  if k < length ys then select k ys else select (k - length ys) zs
          )" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
define ys zs where "ys = filter (\<lambda>y. y \<le> x) xs" and "zs = filter (\<lambda>y. \<not>(y \<le> x)) xs"
[PROOF STATE]
proof (state)
this:
ys = filter (\<lambda>y. y \<le> x) xs
zs = filter (\<lambda>y. \<not> y \<le> x) xs

goal (1 subgoal):
 1. select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
have "select k xs = select k (ys @ zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select k xs = select k (ys @ zs)
[PROOF STEP]
by (intro select_cong) (simp_all add: ys_def zs_def)
[PROOF STATE]
proof (state)
this:
select k xs = select k (ys @ zs)

goal (1 subgoal):
 1. select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
select k xs = select k (ys @ zs)

goal (1 subgoal):
 1. select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
have "\<dots> = (if k < length ys then select k ys else select (k - length ys) zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select k (ys @ zs) = (if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
k < length xs

goal (1 subgoal):
 1. select k (ys @ zs) = (if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
by (intro select_append') (auto simp: ys_def zs_def sum_length_filter_compl)
[PROOF STATE]
proof (state)
this:
select k (ys @ zs) = (if k < length ys then select k ys else select (k - length ys) zs)

goal (1 subgoal):
 1. select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
select k xs = (if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
select k xs = (if k < length ys then select k ys else select (k - length ys) zs)

goal (1 subgoal):
 1. select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)
[PROOF STEP]
by (simp add: ys_def zs_def Let_def o_def)
[PROOF STATE]
proof (state)
this:
select k xs = (let (ys, zs) = partition (\<lambda>y. y \<le> x) xs in if k < length ys then select k ys else select (k - length ys) zs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_fold_rbt_insert:
  assumes "inv_12 t2"
  shows "inv_12 (RBT_Impl.fold (rbt_insert_with_key f) t1 t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_12 (RBT_Impl.fold (rbt_insert_with_key f) t1 t2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv_12 (RBT_Impl.fold (rbt_insert_with_key f) t1 t2)
[PROOF STEP]
define xs where "xs = RBT_Impl.entries t1"
[PROOF STATE]
proof (state)
this:
xs = entries t1

goal (1 subgoal):
 1. inv_12 (RBT_Impl.fold (rbt_insert_with_key f) t1 t2)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
inv_12 t2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv_12 t2

goal (1 subgoal):
 1. inv_12 (RBT_Impl.fold (rbt_insert_with_key f) t1 t2)
[PROOF STEP]
unfolding RBT_Impl.fold_def xs_def[symmetric]
[PROOF STATE]
proof (prove)
using this:
inv_12 t2

goal (1 subgoal):
 1. inv_12 (List.fold (\<lambda>(x, y). rbt_insert_with_key f x y) xs t2)
[PROOF STEP]
by (induct xs rule: rev_induct)
       (auto simp: inv_12_def rbt_insert_with_key_def ins_inv1_inv2)
[PROOF STATE]
proof (state)
this:
inv_12 (RBT_Impl.fold (rbt_insert_with_key f) t1 t2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemParallelReflexive:
    shows "lineA \<parallel> lineA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lineA \<parallel>  lineA
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lineA \<parallel>  lineA
[PROOF STEP]
define dir where "dir = direction lineA"
[PROOF STATE]
proof (state)
this:
dir = direction lineA

goal (1 subgoal):
 1. lineA \<parallel>  lineA
[PROOF STEP]
have "(1 \<noteq> 0) \<and> (dir = 1**dir)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) \<noteq> (0::'a) \<and> dir = (1::'a) ** dir
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) \<noteq> (0::'a) \<and> dir = (1::'a) ** dir

goal (1 subgoal):
 1. lineA \<parallel>  lineA
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(1::'a) \<noteq> (0::'a) \<and> dir = (1::'a) ** dir

goal (1 subgoal):
 1. lineA \<parallel>  lineA
[PROOF STEP]
by (metis dir_def parallel.simps)
[PROOF STATE]
proof (state)
this:
lineA \<parallel>  lineA

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem pr_gr_is_pr: "pr_gr \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_gr \<in> PrimRec1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pr_gr \<in> PrimRec1
[PROOF STEP]
have S1: "(\<lambda> x. pr_gr x) = PrimRecOp1 0 (\<lambda> x y. g_step y (c_fst x))" (is "_ = ?f")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_gr = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. pr_gr x = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. pr_gr x = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) x
[PROOF STEP]
show "pr_gr x = ?f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_gr x = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) x
[PROOF STEP]
by (induct x) (simp add: pr_gr_at_0, simp add: pr_gr_at_Suc)
[PROOF STATE]
proof (state)
this:
pr_gr x = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pr_gr = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x))

goal (1 subgoal):
 1. pr_gr \<in> PrimRec1
[PROOF STEP]
have S2: "PrimRecOp1 0 (\<lambda> x y. g_step y (c_fst x)) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec1
[PROOF STEP]
proof (rule pr_rec1)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec2
[PROOF STEP]
from g_step_is_pr
[PROOF STATE]
proof (chain)
picking this:
g_step \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
g_step \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec2
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec1

goal (1 subgoal):
 1. pr_gr \<in> PrimRec1
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
pr_gr = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x))
PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pr_gr = PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x))
PrimRecOp1 0 (\<lambda>x y. g_step y (c_fst x)) \<in> PrimRec1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem dfs_imp_reachable:
  assumes y: "isNode y"
      and xs: "list_all isNode xs"
      and m: "memb y (dfs empt xs)"
  shows "\<exists>y'. nodeAbs y' = nodeAbs y \<and> y' \<in> reachable (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y'. nodeAbs y' = nodeAbs y \<and> y' \<in> reachable (set xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y'. nodeAbs y' = nodeAbs y \<and> y' \<in> reachable (set xs)
[PROOF STEP]
from m dfs_subset_reachable_visit_nodes [OF empt_invariant xs] y
[PROOF STATE]
proof (chain)
picking this:
memb y (dfs empt xs)
nodeAbs ` set_of (dfs empt xs) \<subseteq> nodeAbs ` (reachable (set xs) \<union> set_of empt)
isNode y
[PROOF STEP]
obtain y'
    where "nodeAbs y' = nodeAbs y"
      and "y' \<in> reachable (set xs)"
[PROOF STATE]
proof (prove)
using this:
memb y (dfs empt xs)
nodeAbs ` set_of (dfs empt xs) \<subseteq> nodeAbs ` (reachable (set xs) \<union> set_of empt)
isNode y

goal (1 subgoal):
 1. (\<And>y'. \<lbrakk>nodeAbs y' = nodeAbs y; y' \<in> reachable (set xs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: empt set_of_def)
[PROOF STATE]
proof (state)
this:
nodeAbs y' = nodeAbs y
y' \<in> reachable (set xs)

goal (1 subgoal):
 1. \<exists>y'. nodeAbs y' = nodeAbs y \<and> y' \<in> reachable (set xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nodeAbs y' = nodeAbs y
y' \<in> reachable (set xs)

goal (1 subgoal):
 1. \<exists>y'. nodeAbs y' = nodeAbs y \<and> y' \<in> reachable (set xs)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y'. nodeAbs y' = nodeAbs y \<and> y' \<in> reachable (set xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_fps_expansion_mult [fps_expansion_intros]:
  fixes F G :: "'a :: {banach, real_normed_div_algebra, comm_ring_1} fps"
  assumes "f has_fps_expansion F" "g has_fps_expansion G"
  shows   "(\<lambda>x. f x * g x) has_fps_expansion F * G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
g has_fps_expansion G
[PROOF STEP]
have "0 < min (fps_conv_radius F) (fps_conv_radius G)"
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
g has_fps_expansion G

goal (1 subgoal):
 1. 0 < min (fps_conv_radius F) (fps_conv_radius G)
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
0 < min (fps_conv_radius F) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < min (fps_conv_radius F) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
have "\<dots> \<le> fps_conv_radius (F * G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (fps_conv_radius F) (fps_conv_radius G) \<le> fps_conv_radius (F * G)
[PROOF STEP]
by (rule fps_conv_radius_mult)
[PROOF STATE]
proof (state)
this:
min (fps_conv_radius F) (fps_conv_radius G) \<le> fps_conv_radius (F * G)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < fps_conv_radius (F * G)
[PROOF STEP]
have radius: "\<dots> > 0"
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius (F * G)

goal (1 subgoal):
 1. 0 < fps_conv_radius (F * G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < fps_conv_radius (F * G)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
g has_fps_expansion G
[PROOF STEP]
have "eventually (\<lambda>x. x \<in> eball 0 (fps_conv_radius F)) (nhds 0)"
                  "eventually (\<lambda>x. x \<in> eball 0 (fps_conv_radius G)) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
g has_fps_expansion G

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'b). x \<in> eball (0::'b) (fps_conv_radius F) &&& \<forall>\<^sub>F x in nhds (0::'c). x \<in> eball (0::'c) (fps_conv_radius G)
[PROOF STEP]
by (intro eventually_nhds_in_open; force simp: has_fps_expansion_def zero_ereal_def)+
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
have "eventually (\<lambda>x. eval_fps F x = f x) (nhds 0)"
            and "eventually (\<lambda>x. eval_fps G x = g x) (nhds 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x &&& \<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
g has_fps_expansion G

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x &&& \<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x
\<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x
\<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x
[PROOF STEP]
have "eventually (\<lambda>x. eval_fps (F * G) x = f x * g x) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x
\<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'a). eval_fps (F * G) x = f x * g x
[PROOF STEP]
by eventually_elim (auto simp: eval_fps_mult)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::'a). eval_fps (F * G) x = f x * g x

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
with radius
[PROOF STATE]
proof (chain)
picking this:
0 < fps_conv_radius (F * G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps (F * G) x = f x * g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius (F * G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps (F * G) x = f x * g x

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) has_fps_expansion F * G
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x * g x) has_fps_expansion F * G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monotone_directed_image:
  assumes mono: "monotone_on I (\<preceq>) (\<sqsubseteq>) f"
  assumes dir: "directed I (\<preceq>)" shows "directed (f ` I) (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directed (f ` I) (\<sqsubseteq>)
[PROOF STEP]
proof (rule directedI, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y xa xb. \<lbrakk>xa \<in> I; xb \<in> I\<rbrakk> \<Longrightarrow> \<exists>z\<in>f ` I. f xa \<sqsubseteq> z \<and> f xb \<sqsubseteq> z
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y xa xb. \<lbrakk>xa \<in> I; xb \<in> I\<rbrakk> \<Longrightarrow> \<exists>z\<in>f ` I. f xa \<sqsubseteq> z \<and> f xb \<sqsubseteq> z
[PROOF STEP]
assume x: "x \<in> I" and y: "y \<in> I"
[PROOF STATE]
proof (state)
this:
x \<in> I
y \<in> I

goal (1 subgoal):
 1. \<And>x y xa xb. \<lbrakk>xa \<in> I; xb \<in> I\<rbrakk> \<Longrightarrow> \<exists>z\<in>f ` I. f xa \<sqsubseteq> z \<and> f xb \<sqsubseteq> z
[PROOF STEP]
with dir
[PROOF STATE]
proof (chain)
picking this:
directed I (\<preceq>)
x \<in> I
y \<in> I
[PROOF STEP]
obtain z where z: "z \<in> I" and "x \<preceq> z" and "y \<preceq> z"
[PROOF STATE]
proof (prove)
using this:
directed I (\<preceq>)
x \<in> I
y \<in> I

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> I; x \<preceq> z; y \<preceq> z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: directedE)
[PROOF STATE]
proof (state)
this:
z \<in> I
x \<preceq> z
y \<preceq> z

goal (1 subgoal):
 1. \<And>x y xa xb. \<lbrakk>xa \<in> I; xb \<in> I\<rbrakk> \<Longrightarrow> \<exists>z\<in>f ` I. f xa \<sqsubseteq> z \<and> f xb \<sqsubseteq> z
[PROOF STEP]
with mono x y
[PROOF STATE]
proof (chain)
picking this:
Binary_Relations.monotone_on I (\<preceq>) (\<sqsubseteq>) f
x \<in> I
y \<in> I
z \<in> I
x \<preceq> z
y \<preceq> z
[PROOF STEP]
have "f x \<sqsubseteq> f z" and "f y \<sqsubseteq> f z"
[PROOF STATE]
proof (prove)
using this:
Binary_Relations.monotone_on I (\<preceq>) (\<sqsubseteq>) f
x \<in> I
y \<in> I
z \<in> I
x \<preceq> z
y \<preceq> z

goal (1 subgoal):
 1. f x \<sqsubseteq> f z &&& f y \<sqsubseteq> f z
[PROOF STEP]
by (auto dest: monotone_onD)
[PROOF STATE]
proof (state)
this:
f x \<sqsubseteq> f z
f y \<sqsubseteq> f z

goal (1 subgoal):
 1. \<And>x y xa xb. \<lbrakk>xa \<in> I; xb \<in> I\<rbrakk> \<Longrightarrow> \<exists>z\<in>f ` I. f xa \<sqsubseteq> z \<and> f xb \<sqsubseteq> z
[PROOF STEP]
with z
[PROOF STATE]
proof (chain)
picking this:
z \<in> I
f x \<sqsubseteq> f z
f y \<sqsubseteq> f z
[PROOF STEP]
show "\<exists>fz \<in> f ` I. f x \<sqsubseteq> fz \<and> f y \<sqsubseteq> fz"
[PROOF STATE]
proof (prove)
using this:
z \<in> I
f x \<sqsubseteq> f z
f y \<sqsubseteq> f z

goal (1 subgoal):
 1. \<exists>fz\<in>f ` I. f x \<sqsubseteq> fz \<and> f y \<sqsubseteq> fz
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>fz\<in>f ` I. f x \<sqsubseteq> fz \<and> f y \<sqsubseteq> fz

goal:
No subgoals!
[PROOF STEP]
qed