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

goal (4 subgoals):
 1. hbt \<langle>\<rangle> \<Longrightarrow> hbt (delete x \<langle>\<rangle>)
 2. hbt \<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>hbt x1 \<Longrightarrow> hbt (delete x x1); hbt x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; hbt x3 \<Longrightarrow> hbt (delete x x3); hbt x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; hbt \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> hbt (delete x \<langle>x1, (a, b), x3\<rangle>)
 4. \<And>x1 a b x3. \<lbrakk>hbt x1 \<Longrightarrow> hbt (delete x x1); hbt x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; hbt x3 \<Longrightarrow> hbt (delete x x3); hbt x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; hbt \<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:
hbt \<langle>l, (a, n), r\<rangle>

goal (4 subgoals):
 1. hbt \<langle>\<rangle> \<Longrightarrow> hbt (delete x \<langle>\<rangle>)
 2. hbt \<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>hbt x1 \<Longrightarrow> hbt (delete x x1); hbt x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; hbt x3 \<Longrightarrow> hbt (delete x x3); hbt x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; hbt \<langle>x1, (a, b), x3\<rangle>\<rbrakk> \<Longrightarrow> hbt (delete x \<langle>x1, (a, b), x3\<rangle>)
 4. \<And>x1 a b x3. \<lbrakk>hbt x1 \<Longrightarrow> hbt (delete x x1); hbt x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; hbt x3 \<Longrightarrow> hbt (delete x x3); hbt x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; hbt \<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]
thus ?case
[PROOF STATE]
proof (prove)
using this:
hbt \<langle>l, (a, n), r\<rangle>

goal (1 subgoal):
 1. hbt (delete x \<langle>l, (a, n), r\<rangle>)
[PROOF STEP]
using Node hbt_split_max[of l]
[PROOF STATE]
proof (prove)
using this:
hbt \<langle>l, (a, n), r\<rangle>
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
\<lbrakk>hbt l; l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> hbt (fst (split_max l)) \<and> height l \<in> {height (fst (split_max l)), height (fst (split_max l)) + 1}

goal (1 subgoal):
 1. hbt (delete x \<langle>l, (a, n), r\<rangle>)
[PROOF STEP]
by (auto intro!: hbt_balL hbt_balR split: prod.split)
[PROOF STATE]
proof (state)
this:
hbt (delete x \<langle>l, (a, n), r\<rangle>)

goal (3 subgoals):
 1. hbt \<langle>\<rangle> \<Longrightarrow> hbt (delete x \<langle>\<rangle>)
 2. hbt \<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>hbt x1 \<Longrightarrow> hbt (delete x x1); hbt x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; hbt x3 \<Longrightarrow> hbt (delete x x3); hbt x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; hbt \<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:
hbt \<langle>l, (a, n), r\<rangle>

goal (3 subgoals):
 1. hbt \<langle>\<rangle> \<Longrightarrow> hbt (delete x \<langle>\<rangle>)
 2. hbt \<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>hbt x1 \<Longrightarrow> hbt (delete x x1); hbt x1 \<Longrightarrow> height x1 \<in> {height (delete x x1), height (delete x x1) + 1}; hbt x3 \<Longrightarrow> hbt (delete x x3); hbt x3 \<Longrightarrow> height x3 \<in> {height (delete x x3), height (delete x x3) + 1}; hbt \<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]
then
[PROOF STATE]
proof (chain)
picking this:
x = a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = a

goal (1 subgoal):
 1. height \<langle>l, (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 1 hbt_split_max[of l]
[PROOF STATE]
proof (prove)
using this:
x = a
hbt \<langle>l, (a, n), r\<rangle>
\<lbrakk>hbt l; l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> hbt (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) + m + 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height r = height (delete x l) + m + 1 \<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) + m + 1 \<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) + m + 1

goal (2 subgoals):
 1. height r = height (delete x l) + m + 1 \<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) + m + 1 \<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]
with Node 1 \<open>x < a\<close>
[PROOF STATE]
proof (chain)
picking this:
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
x < a
height r \<noteq> height (delete x l) + m + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
x < a
height r \<noteq> height (delete x l) + m + 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)
[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) + m + 1 \<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) + m + 1 \<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) + m + 1

goal (1 subgoal):
 1. height r = height (delete x l) + m + 1 \<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]
hence "(height (balR (delete x l) a r) = height (delete x l) + m + 1) \<or>
          height (balR (delete x l) a r) = height (delete x l) + m + 2" (is "?A \<or> ?B")
[PROOF STATE]
proof (prove)
using this:
height r = height (delete x l) + m + 1

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

goal (1 subgoal):
 1. height (balR (delete x l) a r) = height (delete x l) + m + 1 \<or> height (balR (delete x l) a r) = height (delete x l) + m + 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
height (balR (delete x l) a r) = height (delete x l) + m + 1 \<or> height (balR (delete x l) a r) = height (delete x l) + m + 2

goal (1 subgoal):
 1. height r = height (delete x l) + m + 1 \<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 (balR (delete x l) a r) = height (delete x l) + m + 1 \<or> height (balR (delete x l) a r) = height (delete x l) + m + 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]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height (balR (delete x l) a r) = height (delete x l) + m + 1 \<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 (balR (delete x l) a r) = height (delete x l) + m + 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]
assume ?A
[PROOF STATE]
proof (state)
this:
height (balR (delete x l) a r) = height (delete x l) + m + 1

goal (2 subgoals):
 1. height (balR (delete x l) a r) = height (delete x l) + m + 1 \<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 (balR (delete x l) a r) = height (delete x l) + m + 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]
with \<open>x < a\<close> Node 2
[PROOF STATE]
proof (chain)
picking this:
x < a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balR (delete x l) a r) = height (delete x l) + m + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balR (delete x l) a r) = height (delete x l) + m + 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 split!: if_splits)
[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 (balR (delete x l) a r) = height (delete x l) + m + 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 (balR (delete x l) a r) = height (delete x l) + m + 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]
assume ?B
[PROOF STATE]
proof (state)
this:
height (balR (delete x l) a r) = height (delete x l) + m + 2

goal (1 subgoal):
 1. height (balR (delete x l) a r) = height (delete x l) + m + 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]
with \<open>x < a\<close> Node 2
[PROOF STATE]
proof (chain)
picking this:
x < a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balR (delete x l) a r) = height (delete x l) + m + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balR (delete x l) a r) = height (delete x l) + m + 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]
by(auto simp: balR_def split!: if_splits)
[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 (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) + m + 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height l = height (delete x r) + m + 1 \<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) + m + 1 \<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) + m + 1

goal (2 subgoals):
 1. height l = height (delete x r) + m + 1 \<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) + m + 1 \<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]
with Node 1 \<open>\<not>x < a\<close> \<open>x \<noteq> a\<close>
[PROOF STATE]
proof (chain)
picking this:
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
\<not> x < a
x \<noteq> a
height l \<noteq> height (delete x r) + m + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
\<not> x < a
x \<noteq> a
height l \<noteq> height (delete x r) + m + 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: 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) + m + 1 \<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) + m + 1 \<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) + m + 1

goal (1 subgoal):
 1. height l = height (delete x r) + m + 1 \<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]
hence "(height (balL l a (delete x r)) = height (delete x r) + m + 1) \<or>
          height (balL l a (delete x r)) = height (delete x r) + m + 2" (is "?A \<or> ?B")
[PROOF STATE]
proof (prove)
using this:
height l = height (delete x r) + m + 1

goal (1 subgoal):
 1. height (balL l a (delete x r)) = height (delete x r) + m + 1 \<or> height (balL l a (delete x r)) = height (delete x r) + m + 2
[PROOF STEP]
using Node 2 height_balL[OF _ _ True]
[PROOF STATE]
proof (prove)
using this:
height l = height (delete x r) + m + 1
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
\<lbrakk>hbt l; hbt (delete x r)\<rbrakk> \<Longrightarrow> height (balL l ?a (delete x r)) \<in> {height (delete x r) + m + 1, height (delete x r) + m + 2}

goal (1 subgoal):
 1. height (balL l a (delete x r)) = height (delete x r) + m + 1 \<or> height (balL l a (delete x r)) = height (delete x r) + m + 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
height (balL l a (delete x r)) = height (delete x r) + m + 1 \<or> height (balL l a (delete x r)) = height (delete x r) + m + 2

goal (1 subgoal):
 1. height l = height (delete x r) + m + 1 \<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 (balL l a (delete x r)) = height (delete x r) + m + 1 \<or> height (balL l a (delete x r)) = height (delete x r) + m + 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]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height (balL l a (delete x r)) = height (delete x r) + m + 1 \<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 (balL l a (delete x r)) = height (delete x r) + m + 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]
assume ?A
[PROOF STATE]
proof (state)
this:
height (balL l a (delete x r)) = height (delete x r) + m + 1

goal (2 subgoals):
 1. height (balL l a (delete x r)) = height (delete x r) + m + 1 \<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 (balL l a (delete x r)) = height (delete x r) + m + 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]
with \<open>\<not>x < a\<close> \<open>x \<noteq> a\<close> Node 2
[PROOF STATE]
proof (chain)
picking this:
\<not> x < a
x \<noteq> a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balL l a (delete x r)) = height (delete x r) + m + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> x < a
x \<noteq> a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balL l a (delete x r)) = height (delete x r) + m + 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: balL_def split: if_splits)
[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 (balL l a (delete x r)) = height (delete x r) + m + 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 (balL l a (delete x r)) = height (delete x r) + m + 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]
assume ?B
[PROOF STATE]
proof (state)
this:
height (balL l a (delete x r)) = height (delete x r) + m + 2

goal (1 subgoal):
 1. height (balL l a (delete x r)) = height (delete x r) + m + 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]
with \<open>\<not>x < a\<close> \<open>x \<noteq> a\<close> Node 2
[PROOF STATE]
proof (chain)
picking this:
\<not> x < a
x \<noteq> a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balL l a (delete x r)) = height (delete x r) + m + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> x < a
x \<noteq> a
hbt l \<Longrightarrow> hbt (delete x l)
hbt l \<Longrightarrow> height l \<in> {height (delete x l), height (delete x l) + 1}
hbt r \<Longrightarrow> hbt (delete x r)
hbt r \<Longrightarrow> height r \<in> {height (delete x r), height (delete x r) + 1}
hbt \<langle>l, (a, n), r\<rangle>
height (balL l a (delete x r)) = height (delete x r) + m + 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]
by(auto simp: balL_def split: if_splits)
[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:
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. hbt \<langle>\<rangle> \<Longrightarrow> hbt (delete x \<langle>\<rangle>)
 2. hbt \<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 accum2_lemma [simp]:
  shows "rec_eval (rec_accum2 f) [x, y1, y2] = (\<Prod> z \<le> x. rec_eval f  [z, y1, y2])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_accum2 f) [x, y1, y2] = (\<Prod>z\<le>x. rec_eval f [z, y1, y2])
[PROOF STEP]
by (induct x) (simp_all add: rec_accum2_def)


[STATEMENT]
lemma isometry_cblinfun_image_inf_distrib[simp]:
  fixes U::\<open>'a::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'b::chilbert_space\<close>
    and X Y::"'a ccsubspace"
  assumes "isometry U"
  shows "U *\<^sub>S (inf X Y) = inf (U *\<^sub>S X) (U *\<^sub>S Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U *\<^sub>S X \<sqinter> Y = U *\<^sub>S X \<sqinter> (U *\<^sub>S Y)
[PROOF STEP]
using cblinfun_image_INF_eq[where V="\<lambda>b. if b then X else Y" and U=U]
[PROOF STATE]
proof (prove)
using this:
isometry U \<Longrightarrow> U *\<^sub>S (\<Sqinter>i. if i then X else Y) = (\<Sqinter>i. U *\<^sub>S (if i then X else Y))

goal (1 subgoal):
 1. U *\<^sub>S X \<sqinter> Y = U *\<^sub>S X \<sqinter> (U *\<^sub>S Y)
[PROOF STEP]
unfolding INF_UNIV_bool_expand
[PROOF STATE]
proof (prove)
using this:
isometry U \<Longrightarrow> U *\<^sub>S (if True then X else Y) \<sqinter> (if False then X else Y) = U *\<^sub>S (if True then X else Y) \<sqinter> (U *\<^sub>S (if False then X else Y))

goal (1 subgoal):
 1. U *\<^sub>S X \<sqinter> Y = U *\<^sub>S X \<sqinter> (U *\<^sub>S Y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isometry U \<Longrightarrow> U *\<^sub>S (if True then X else Y) \<sqinter> (if False then X else Y) = U *\<^sub>S (if True then X else Y) \<sqinter> (U *\<^sub>S (if False then X else Y))
isometry U

goal (1 subgoal):
 1. U *\<^sub>S X \<sqinter> Y = U *\<^sub>S X \<sqinter> (U *\<^sub>S Y)
[PROOF STEP]
by auto


[STATEMENT]
lemma rank_0: "rank 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank 0 = 0
[PROOF STEP]
unfolding rank_def row_rank_def row_space_def rows_def row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (vec.span {vec_lambda (($) (0 $ i)) |i. i \<in> UNIV}) = 0
[PROOF STEP]
by (simp add: vec.dim_span vec.dim_zero_eq' vec_nth_inverse)


[STATEMENT]
lemma winding_number_eq:
     "\<lbrakk>path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; w \<in> S; z \<in> S; connected S; S \<inter> path_image \<gamma> = {}\<rbrakk>
      \<Longrightarrow> winding_number \<gamma> w = winding_number \<gamma> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; w \<in> S; z \<in> S; connected S; S \<inter> path_image \<gamma> = {}\<rbrakk> \<Longrightarrow> winding_number \<gamma> w = winding_number \<gamma> z
[PROOF STEP]
using winding_number_constant
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path ?\<gamma>; pathfinish ?\<gamma> = pathstart ?\<gamma>; connected ?S; ?S \<inter> path_image ?\<gamma> = {}\<rbrakk> \<Longrightarrow> winding_number ?\<gamma> constant_on ?S

goal (1 subgoal):
 1. \<lbrakk>path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; w \<in> S; z \<in> S; connected S; S \<inter> path_image \<gamma> = {}\<rbrakk> \<Longrightarrow> winding_number \<gamma> w = winding_number \<gamma> z
[PROOF STEP]
by (metis constant_on_def)


[STATEMENT]
lemma Fract_less_one_iff: "0 < b \<Longrightarrow> Fract a b < 1 \<longleftrightarrow> a < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (Fract a b < 1) = (a < b)
[PROOF STEP]
by (simp add: One_rat_def mult_less_cancel_right_disj)


[STATEMENT]
lemma of_nat_ge_0[simp]: "of_nat x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> of_nat x
[PROOF STEP]
proof (induct x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (0::'a) \<le> of_nat 0
 2. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (0::'a) \<le> of_nat 0
 2. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> of_nat 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> of_nat 0

goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
case (Suc x)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> of_nat x

goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
hence "0 \<le> of_nat x"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> of_nat x

goal (1 subgoal):
 1. (0::'a) \<le> of_nat x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> of_nat x

goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> of_nat x

goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
have "of_nat x < of_nat (Suc x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat x < of_nat (Suc x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_nat x < of_nat (Suc x)

goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> of_nat x \<Longrightarrow> (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < of_nat (Suc x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(0::'a) < of_nat (Suc x)

goal (1 subgoal):
 1. (0::'a) \<le> of_nat (Suc x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> of_nat (Suc x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_det_inv:
  assumes "mat_det A \<noteq> 0"
  shows "mat_det (mat_inv A) = 1 / mat_det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_det (mat_inv A) = 1 / mat_det A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_det (mat_inv A) = 1 / mat_det A
[PROOF STEP]
have "mat_det eye = mat_det A * mat_det (mat_inv A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_det eye = mat_det A * mat_det (mat_inv A)
[PROOF STEP]
using mat_inv_l[OF assms, symmetric]
[PROOF STATE]
proof (prove)
using this:
eye = mat_inv A *\<^sub>m\<^sub>m A

goal (1 subgoal):
 1. mat_det eye = mat_det A * mat_det (mat_inv A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_det eye = mat_det A * mat_det (mat_inv A)

goal (1 subgoal):
 1. mat_det (mat_inv A) = 1 / mat_det A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
mat_det eye = mat_det A * mat_det (mat_inv A)

goal (1 subgoal):
 1. mat_det (mat_inv A) = 1 / mat_det A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det eye = mat_det A * mat_det (mat_inv A)
mat_det A \<noteq> 0

goal (1 subgoal):
 1. mat_det (mat_inv A) = 1 / mat_det A
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
mat_det (mat_inv A) = 1 / mat_det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_tl_listsN: "A \<subseteq> lists (listsN (n + 1) S) \<Longrightarrow> map tl ` A \<subseteq> lists (listsN n S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> lists (listsN (n + 1) S) \<Longrightarrow> map tl ` A \<subseteq> lists (listsN n S)
[PROOF STEP]
proof (intro image_subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> lists (listsN (n + 1) S); x \<in> A\<rbrakk> \<Longrightarrow> map tl x \<in> lists (listsN n S)
[PROOF STEP]
fix xss
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> lists (listsN (n + 1) S); x \<in> A\<rbrakk> \<Longrightarrow> map tl x \<in> lists (listsN n S)
[PROOF STEP]
assume "A \<subseteq> lists (listsN (n + 1) S)" "xss \<in> A"
[PROOF STATE]
proof (state)
this:
A \<subseteq> lists (listsN (n + 1) S)
xss \<in> A

goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> lists (listsN (n + 1) S); x \<in> A\<rbrakk> \<Longrightarrow> map tl x \<in> lists (listsN n S)
[PROOF STEP]
hence "set xss \<subseteq> listsN (n + 1) S"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> lists (listsN (n + 1) S)
xss \<in> A

goal (1 subgoal):
 1. set xss \<subseteq> listsN (n + 1) S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set xss \<subseteq> listsN (n + 1) S

goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> lists (listsN (n + 1) S); x \<in> A\<rbrakk> \<Longrightarrow> map tl x \<in> lists (listsN n S)
[PROOF STEP]
hence "\<forall>xs \<in> set xss. tl xs \<in> listsN n S"
[PROOF STATE]
proof (prove)
using this:
set xss \<subseteq> listsN (n + 1) S

goal (1 subgoal):
 1. \<forall>xs\<in>set xss. tl xs \<in> listsN n S
[PROOF STEP]
using tl_listsN[of "set xss" S n]
[PROOF STATE]
proof (prove)
using this:
set xss \<subseteq> listsN (n + 1) S
set xss \<subseteq> listsN (n + 1) S \<Longrightarrow> tl ` set xss \<subseteq> listsN n S

goal (1 subgoal):
 1. \<forall>xs\<in>set xss. tl xs \<in> listsN n S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>xs\<in>set xss. tl xs \<in> listsN n S

goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> lists (listsN (n + 1) S); x \<in> A\<rbrakk> \<Longrightarrow> map tl x \<in> lists (listsN n S)
[PROOF STEP]
thus "map tl xss \<in> lists (listsN n S)"
[PROOF STATE]
proof (prove)
using this:
\<forall>xs\<in>set xss. tl xs \<in> listsN n S

goal (1 subgoal):
 1. map tl xss \<in> lists (listsN n S)
[PROOF STEP]
by (induct xss) auto
[PROOF STATE]
proof (state)
this:
map tl xss \<in> lists (listsN n S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gchoose_rising_sum_nat: "(\<Sum>j\<le>n. int j + int k gchoose k) = (int n + int k + 1) gchoose (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
have "(\<Sum>j\<le>n. int j + int k gchoose k) = int (\<Sum>j\<le>n. k + j choose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int (\<Sum>j\<le>n. k + j choose k)
[PROOF STEP]
by (simp add: int_binomial add.commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>n. int j + int k gchoose k) = int (\<Sum>j\<le>n. k + j choose k)

goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>n. int j + int k gchoose k) = int (\<Sum>j\<le>n. k + j choose k)

goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
have "(\<Sum>j\<le>n. k + j choose k) = (k + n + 1) choose (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<le>n. k + j choose k) = k + n + 1 choose (k + 1)
[PROOF STEP]
by (fact choose_rising_sum(1))
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>n. k + j choose k) = k + n + 1 choose (k + 1)

goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>n. k + j choose k) = k + n + 1 choose (k + 1)

goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
have "int \<dots> = (int n + int k + 1) gchoose (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (k + n + 1 choose (k + 1)) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
by (simp add: int_binomial ac_simps del: binomial_Suc_Suc)
[PROOF STATE]
proof (state)
this:
int (k + n + 1 choose (k + 1)) = int n + int k + 1 gchoose Suc k

goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k

goal (1 subgoal):
 1. (\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>n. int j + int k gchoose k) = int n + int k + 1 gchoose Suc k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lim_add:
  fixes f g::"_ \<Rightarrow> 'a::{t2_space,topological_monoid_add}"
  assumes "\<exists>y. (f \<longlongrightarrow> y) F" and "\<exists>y. (g \<longlongrightarrow> y) F" and "F\<noteq>bot"
  shows "Lim F f + Lim F g = Lim F (\<lambda>x. f x+g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lim F f + Lim F g = Lim F (\<lambda>x. f x + g x)
[PROOF STEP]
apply (rule tendsto_Lim[OF \<open>F\<noteq>bot\<close>, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) \<longlongrightarrow> Lim F f + Lim F g) F
[PROOF STEP]
apply (auto intro!:tendsto_eq_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f \<longlongrightarrow> Lim F f) F
 2. (g \<longlongrightarrow> Lim F g) F
[PROOF STEP]
using assms tendsto_Lim
[PROOF STATE]
proof (prove)
using this:
\<exists>y. (f \<longlongrightarrow> y) F
\<exists>y. (g \<longlongrightarrow> y) F
F \<noteq> bot
\<lbrakk>?net \<noteq> bot; (?f \<longlongrightarrow> ?l) ?net\<rbrakk> \<Longrightarrow> Lim ?net ?f = ?l

goal (2 subgoals):
 1. (f \<longlongrightarrow> Lim F f) F
 2. (g \<longlongrightarrow> Lim F g) F
[PROOF STEP]
by blast+


[STATEMENT]
lemma diag_idx_to_el_img:
  assumes "k < dist_el_card B"
shows "diag_idx_to_el B k \<in> diag_elems B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_idx_to_el B k \<in> diag_elems B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. diag_idx_to_el B k \<in> diag_elems B
[PROOF STEP]
have "diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
[PROOF STEP]
using diag_idx_to_el_bij[of B]
[PROOF STATE]
proof (prove)
using this:
bij_betw (diag_idx_to_el B) {..<dist_el_card B} (diag_elems B)

goal (1 subgoal):
 1. diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on (diag_idx_to_el B) {..<dist_el_card B} \<and> diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B

goal (1 subgoal):
 1. diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B

goal (1 subgoal):
 1. diag_idx_to_el B k \<in> diag_elems B
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B

goal (1 subgoal):
 1. diag_idx_to_el B k \<in> diag_elems B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
diag_idx_to_el B ` {..<dist_el_card B} = diag_elems B
k < dist_el_card B

goal (1 subgoal):
 1. diag_idx_to_el B k \<in> diag_elems B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diag_idx_to_el B k \<in> diag_elems B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_Gram_Schmidt:
  fixes xs::"('a::{real_inner}^'b) list"
  assumes "distinct xs"
  shows "card(set (Gram_Schmidt xs)) \<le> card (set (xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt xs)) \<le> card (set xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs

goal (1 subgoal):
 1. card (set (Gram_Schmidt xs)) \<le> card (set xs)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct [] \<Longrightarrow> card (set (Gram_Schmidt [])) \<le> card (set [])
 2. \<And>a xs. \<lbrakk>distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> card (set (Gram_Schmidt (a # xs))) \<le> card (set (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
distinct []

goal (2 subgoals):
 1. distinct [] \<Longrightarrow> card (set (Gram_Schmidt [])) \<le> card (set [])
 2. \<And>a xs. \<lbrakk>distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> card (set (Gram_Schmidt (a # xs))) \<le> card (set (a # xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt [])) \<le> card (set [])
[PROOF STEP]
unfolding Gram_Schmidt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (foldr Gram_Schmidt_step [] [])) \<le> card (set [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt [])) \<le> card (set [])

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> card (set (Gram_Schmidt (a # xs))) \<le> card (set (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> card (set (Gram_Schmidt (a # xs))) \<le> card (set (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs)
distinct (x # xs)

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> card (set (Gram_Schmidt (a # xs))) \<le> card (set (a # xs))
[PROOF STEP]
define b where "b = (\<Sum>xa\<in>set (Gram_Schmidt xs). (x \<bullet> xa / (xa \<bullet> xa)) *\<^sub>R xa)"
[PROOF STATE]
proof (state)
this:
b = (\<Sum>xa\<in>set (Gram_Schmidt xs). (x \<bullet> xa / (xa \<bullet> xa)) *\<^sub>R xa)

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> card (set (Gram_Schmidt (a # xs))) \<le> card (set (a # xs))
[PROOF STEP]
have distinct_xs: "distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs
[PROOF STEP]
using Cons.prems
[PROOF STATE]
proof (prove)
using this:
distinct (x # xs)

goal (1 subgoal):
 1. distinct xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct xs

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>distinct xs \<Longrightarrow> card (set (Gram_Schmidt xs)) \<le> card (set xs); distinct (a # xs)\<rbrakk> \<Longrightarrow> card (set (Gram_Schmidt (a # xs))) \<le> card (set (a # xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
proof (cases "x - b \<notin> set (Gram_Schmidt xs)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x - b \<notin> set (Gram_Schmidt xs)

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))
[PROOF STEP]
unfolding Gram_Schmidt_cons Gram_Schmidt_step_def b_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt xs @ [x - proj_onto x (set (Gram_Schmidt xs))])) = card (insert (x - (\<Sum>xa\<in>set (Gram_Schmidt xs). (x \<bullet> xa / (xa \<bullet> xa)) *\<^sub>R xa)) (set (Gram_Schmidt xs)))
[PROOF STEP]
unfolding proj_onto_def proj_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt xs @ [x - (\<Sum>u\<in>set (Gram_Schmidt xs). (x \<bullet> u / (u \<bullet> u)) *\<^sub>R u)])) = card (insert (x - (\<Sum>xa\<in>set (Gram_Schmidt xs). (x \<bullet> xa / (xa \<bullet> xa)) *\<^sub>R xa)) (set (Gram_Schmidt xs)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... = Suc (card (set (Gram_Schmidt xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert (x - b) (set (Gram_Schmidt xs))) = Suc (card (set (Gram_Schmidt xs)))
[PROOF STEP]
proof (rule card_insert_disjoint)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (set (Gram_Schmidt xs))
 2. x - b \<notin> set (Gram_Schmidt xs)
[PROOF STEP]
show "finite (set (Gram_Schmidt xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set (Gram_Schmidt xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (set (Gram_Schmidt xs))

goal (1 subgoal):
 1. x - b \<notin> set (Gram_Schmidt xs)
[PROOF STEP]
show "x - b \<notin> set (Gram_Schmidt xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - b \<notin> set (Gram_Schmidt xs)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
x - b \<notin> set (Gram_Schmidt xs)

goal (1 subgoal):
 1. x - b \<notin> set (Gram_Schmidt xs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x - b \<notin> set (Gram_Schmidt xs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (insert (x - b) (set (Gram_Schmidt xs))) = Suc (card (set (Gram_Schmidt xs)))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (insert (x - b) (set (Gram_Schmidt xs))) = Suc (card (set (Gram_Schmidt xs)))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... \<le> Suc (card (set xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card (set (Gram_Schmidt xs))) \<le> Suc (card (set xs))
[PROOF STEP]
using Cons.hyps[OF distinct_xs]
[PROOF STATE]
proof (prove)
using this:
card (set (Gram_Schmidt xs)) \<le> card (set xs)

goal (1 subgoal):
 1. Suc (card (set (Gram_Schmidt xs))) \<le> Suc (card (set xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (card (set (Gram_Schmidt xs))) \<le> Suc (card (set xs))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card (set (Gram_Schmidt xs))) \<le> Suc (card (set xs))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... = Suc (length (remdups xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card (set xs)) = Suc (length (remdups xs))
[PROOF STEP]
unfolding List.card_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (length (remdups xs)) = Suc (length (remdups xs))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Suc (card (set xs)) = Suc (length (remdups xs))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card (set xs)) = Suc (length (remdups xs))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... \<le> (length (remdups (x # xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (length (remdups xs)) \<le> length (remdups (x # xs))
[PROOF STEP]
by (metis Cons.prems distinct_xs impossible_Cons not_less_eq_eq remdups_id_iff_distinct)
[PROOF STATE]
proof (state)
this:
Suc (length (remdups xs)) \<le> length (remdups (x # xs))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (length (remdups xs)) \<le> length (remdups (x # xs))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... \<le> (card (set (x # xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (remdups (x # xs)) \<le> card (set (x # xs))
[PROOF STEP]
by (metis dual_order.refl length_remdups_card_conv)
[PROOF STATE]
proof (state)
this:
length (remdups (x # xs)) \<le> card (set (x # xs))

goal (2 subgoals):
 1. x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
 2. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))

goal (1 subgoal):
 1. card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x - b \<notin> set (Gram_Schmidt xs)

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have x_b_in: "x - b \<in> set (Gram_Schmidt xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - b \<in> set (Gram_Schmidt xs)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> x - b \<notin> set (Gram_Schmidt xs)

goal (1 subgoal):
 1. x - b \<in> set (Gram_Schmidt xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - b \<in> set (Gram_Schmidt xs)

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))
[PROOF STEP]
unfolding Gram_Schmidt_cons Gram_Schmidt_step_def b_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt xs @ [x - proj_onto x (set (Gram_Schmidt xs))])) = card (insert (x - (\<Sum>xa\<in>set (Gram_Schmidt xs). (x \<bullet> xa / (xa \<bullet> xa)) *\<^sub>R xa)) (set (Gram_Schmidt xs)))
[PROOF STEP]
unfolding proj_onto_def proj_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt xs @ [x - (\<Sum>u\<in>set (Gram_Schmidt xs). (x \<bullet> u / (u \<bullet> u)) *\<^sub>R u)])) = card (insert (x - (\<Sum>xa\<in>set (Gram_Schmidt xs). (x \<bullet> xa / (xa \<bullet> xa)) *\<^sub>R xa)) (set (Gram_Schmidt xs)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt (x # xs))) = card (insert (x - b) (set (Gram_Schmidt xs)))

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... = (card (set (Gram_Schmidt xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert (x - b) (set (Gram_Schmidt xs))) = card (set (Gram_Schmidt xs))
[PROOF STEP]
by (metis False insert_absorb)
[PROOF STATE]
proof (state)
this:
card (insert (x - b) (set (Gram_Schmidt xs))) = card (set (Gram_Schmidt xs))

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (insert (x - b) (set (Gram_Schmidt xs))) = card (set (Gram_Schmidt xs))

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... \<le> (card (set xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Gram_Schmidt xs)) \<le> card (set xs)
[PROOF STEP]
using Cons.hyps[OF distinct_xs]
[PROOF STATE]
proof (prove)
using this:
card (set (Gram_Schmidt xs)) \<le> card (set xs)

goal (1 subgoal):
 1. card (set (Gram_Schmidt xs)) \<le> card (set xs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt xs)) \<le> card (set xs)

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt xs)) \<le> card (set xs)

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
have "... \<le> (card (set (x # xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set xs) \<le> card (set (x # xs))
[PROOF STEP]
unfolding List.card_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (remdups xs) \<le> length (remdups (x # xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (set xs) \<le> card (set (x # xs))

goal (1 subgoal):
 1. \<not> x - b \<notin> set (Gram_Schmidt xs) \<Longrightarrow> card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))

goal (1 subgoal):
 1. card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (set (Gram_Schmidt (x # xs))) \<le> card (set (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem sim_first: assumes H: "s \<approx> t" shows "first s = first t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. first s = first t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. first s = first t
[PROOF STEP]
from H
[PROOF STATE]
proof (chain)
picking this:
s \<approx> t
[PROOF STEP]
have "(\<natural> s) 0 = (\<natural> t) 0"
[PROOF STATE]
proof (prove)
using this:
s \<approx> t

goal (1 subgoal):
 1. \<natural> s 0 = \<natural> t 0
[PROOF STEP]
by (simp add: seqsimilar_def)
[PROOF STATE]
proof (state)
this:
\<natural> s 0 = \<natural> t 0

goal (1 subgoal):
 1. first s = first t
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<natural> s 0 = \<natural> t 0

goal (1 subgoal):
 1. first s = first t
[PROOF STEP]
by (simp add: collapse_def first_def)
[PROOF STATE]
proof (state)
this:
first s = first t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_mix_is_density:
  assumes "0 < n"
  shows "density_operator (max_mix_density n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. density_operator (max_mix_density n)
[PROOF STEP]
unfolding density_operator_def max_mix_density_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) \<and> Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
 2. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
have "Complex_Matrix.trace (complex_of_real ((1::real)/n) \<cdot>\<^sub>m 1\<^sub>m n) =
    (complex_of_real ((1::real)/n)) *  (Complex_Matrix.trace ((1\<^sub>m n)::complex Matrix.mat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n)
[PROOF STEP]
using one_carrier_mat trace_smult[of "(1\<^sub>m n)::complex Matrix.mat"]
[PROOF STATE]
proof (prove)
using this:
1\<^sub>m ?n \<in> carrier_mat ?n ?n
1\<^sub>m n \<in> carrier_mat ?n ?n \<Longrightarrow> Complex_Matrix.trace (?c \<cdot>\<^sub>m 1\<^sub>m n) = ?c * Complex_Matrix.trace (1\<^sub>m n)

goal (1 subgoal):
 1. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n)

goal (2 subgoals):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
 2. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n)

goal (2 subgoals):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
 2. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
have "... = (complex_of_real ((1::real)/n))  * (real n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n) = complex_of_real (1 / real n) * complex_of_real (real n)
[PROOF STEP]
using trace_1[of n]
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.trace (1\<^sub>m n) = of_nat n

goal (1 subgoal):
 1. complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n) = complex_of_real (1 / real n) * complex_of_real (real n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n) = complex_of_real (1 / real n) * complex_of_real (real n)

goal (2 subgoals):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
 2. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real n) * Complex_Matrix.trace (1\<^sub>m n) = complex_of_real (1 / real n) * complex_of_real (real n)

goal (2 subgoals):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
 2. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (1 / real n) * complex_of_real (real n) = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. complex_of_real (1 / real n) * complex_of_real (real n) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real (1 / real n) * complex_of_real (real n) = 1

goal (2 subgoals):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
 2. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
show "Complex_Matrix.trace (complex_of_real ((1::real)/n) \<cdot>\<^sub>m 1\<^sub>m n) =  1"
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1

goal (1 subgoal):
 1. Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n) = 1

goal (1 subgoal):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
[PROOF STEP]
show "Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)
[PROOF STEP]
by (rule positive_smult, (auto simp add: positive_one less_eq_complex_def))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.positive (complex_of_real (1 / real n) \<cdot>\<^sub>m 1\<^sub>m n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_sgn [tendsto_intros]: "(f \<longlongrightarrow> l) F \<Longrightarrow> l \<noteq> 0 \<Longrightarrow> ((\<lambda>x. sgn (f x)) \<longlongrightarrow> sgn l) F"
  for l :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> l) F; l \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ((\<lambda>x. sgn (f x)) \<longlongrightarrow> sgn l) F
[PROOF STEP]
unfolding sgn_div_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> l) F; l \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x /\<^sub>R norm (f x)) \<longlongrightarrow> l /\<^sub>R norm l) F
[PROOF STEP]
by (simp add: tendsto_intros)


[STATEMENT]
lemma csin_double:
  "2 * csin (a::real) * ccos a = csin(2 * a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * complex_of_real (sin a) * complex_of_real (cos a) = complex_of_real (sin (2 * a))
[PROOF STEP]
using sin_add[of a a]
[PROOF STATE]
proof (prove)
using this:
sin (a + a) = sin a * cos a + cos a * sin a

goal (1 subgoal):
 1. 2 * complex_of_real (sin a) * complex_of_real (cos a) = complex_of_real (sin (2 * a))
[PROOF STEP]
by simp


[STATEMENT]
lemma rtranclp_conjD:
  "(\<lambda>x1 x2. r1 x1 x2 \<and> r2 x1 x2)\<^sup>*\<^sup>* x1 x2 \<Longrightarrow>
  r1\<^sup>*\<^sup>* x1 x2 \<and> r2\<^sup>*\<^sup>* x1 x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x1 x2. r1 x1 x2 \<and> r2 x1 x2)\<^sup>*\<^sup>* x1 x2 \<Longrightarrow> r1\<^sup>*\<^sup>* x1 x2 \<and> r2\<^sup>*\<^sup>* x1 x2
[PROOF STEP]
by (metis (no_types, lifting) rtrancl_mono_proof)


[STATEMENT]
lemma tdev_msum_pdevs: "degree f \<le> n \<Longrightarrow> tdev (msum_pdevs n f g) = tdev f + tdev g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree f \<le> n \<Longrightarrow> tdev (msum_pdevs n f g) = tdev f + tdev g
[PROOF STEP]
by (auto simp: tdev_def pdevs_apply_msum_pdevs intro!: sum_msum_pdevs_cases)


[STATEMENT]
lemma atLeastLessThan_iff[simp]: "(i \<in> {l\<le>\<^sub>a..<\<^sub>au}) = (l \<le>\<^sub>a i \<and> i <\<^sub>a u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {l\<le>\<^sub>a..<\<^sub>au}) = (l \<le>\<^sub>a i \<and> i <\<^sub>a u)
[PROOF STEP]
unfolding interval_def ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {x \<in> UNIV. l \<le>\<^sub>a x} \<inter> {x \<in> UNIV. x <\<^sub>a u}) = (l \<le>\<^sub>a i \<and> i <\<^sub>a u)
[PROOF STEP]
by simp


[STATEMENT]
lemma DirProd_monoid:
  assumes "monoid G" and "monoid H"
  shows "monoid (G \<times>\<times> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.monoid (G \<times>\<times> H)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Group.monoid (G \<times>\<times> H)
[PROOF STEP]
interpret G: monoid G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.monoid G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Group.monoid (G \<times>\<times> H)
[PROOF STEP]
interpret H: monoid H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.monoid H
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Group.monoid (G \<times>\<times> H)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Group.monoid G
Group.monoid H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Group.monoid G
Group.monoid H

goal (1 subgoal):
 1. Group.monoid (G \<times>\<times> H)
[PROOF STEP]
by (unfold monoid_def DirProd_def, auto)
[PROOF STATE]
proof (state)
this:
Group.monoid (G \<times>\<times> H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_rotation_mapping_u_to_positive_x_axis:
  assumes "u \<noteq> 0\<^sub>h" and "u \<noteq> \<infinity>\<^sub>h"
  shows "\<exists> \<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
obtain c where *: "u = of_complex c"
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. (\<And>c. u = of_complex c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h
?z = \<infinity>\<^sub>h \<or> (\<exists>x. ?z = of_complex x)

goal (1 subgoal):
 1. (\<And>c. u = of_complex c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u = of_complex c

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis
[PROOF STEP]
have "is_real (cis (- Arg c) * c)" "Re (cis (-Arg c) * c) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (cis (- Arg c) * c) &&& 0 < Re (cis (- Arg c) * c)
[PROOF STEP]
using "*" assms is_real_rot_to_x_axis positive_rot_to_x_axis of_complex_zero_iff
[PROOF STATE]
proof (prove)
using this:
u = of_complex c
u \<noteq> 0\<^sub>h
u \<noteq> \<infinity>\<^sub>h
?z \<noteq> 0 \<Longrightarrow> is_real (cis (- Arg ?z) * ?z)
?z \<noteq> 0 \<Longrightarrow> 0 < Re (cis (- Arg ?z) * ?z)
(of_complex ?x = 0\<^sub>h) = (?x = 0)

goal (1 subgoal):
 1. is_real (cis (- Arg c) * c) &&& 0 < Re (cis (- Arg c) * c)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
is_real (cis (- Arg c) * c)
0 < Re (cis (- Arg c) * c)

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_real (cis (- Arg c) * c)
0 < Re (cis (- Arg c) * c)

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
is_real (cis (- Arg c) * c)
0 < Re (cis (- Arg c) * c)
u = of_complex c

goal (1 subgoal):
 1. \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis
[PROOF STEP]
by (rule_tac x="-Arg c" in exI) (simp add: positive_x_axis_def circline_set_x_axis)
[PROOF STATE]
proof (state)
this:
\<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) u \<in> positive_x_axis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_setI:
  assumes "a \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "eval_at_point R a p =\<zero>\<^bsub>R\<^esub>"
  shows  "a \<in> zero_set R n p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> V n p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (R\<^bsup>n\<^esup>)
eval_at_point R a p = \<zero>

goal (1 subgoal):
 1. a \<in> V n p
[PROOF STEP]
by (metis (mono_tags, lifting) mem_Collect_eq zero_set_def)


[STATEMENT]
lemma inner_prod_distrib_left:
  fixes u v w :: "('a::conjugatable_field) vec"
  assumes dimu: "u \<in> carrier_vec n" and dimv:"v \<in> carrier_vec n" and dimw: "w \<in> carrier_vec n"
  shows "inner_prod (v + w) u = inner_prod v u + inner_prod w u" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
have dimcv: "conjugate v \<in> carrier_vec n" and dimcw: "conjugate w \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate v \<in> carrier_vec n &&& conjugate w \<in> carrier_vec n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier_vec n
v \<in> carrier_vec n
w \<in> carrier_vec n

goal (1 subgoal):
 1. conjugate v \<in> carrier_vec n &&& conjugate w \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate v \<in> carrier_vec n
conjugate w \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
have dimvw: "conjugate (v + w) \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (v + w) \<in> carrier_vec n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier_vec n
v \<in> carrier_vec n
w \<in> carrier_vec n

goal (1 subgoal):
 1. conjugate (v + w) \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate (v + w) \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
have "u \<bullet> (conjugate (v + w)) = u \<bullet> conjugate v + u \<bullet> conjugate w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
using dimv dimw dimu dimcv dimcw
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n
u \<in> carrier_vec n
conjugate v \<in> carrier_vec n
conjugate w \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
by (metis conjugate_add_vec scalar_prod_add_distrib)
[PROOF STATE]
proof (state)
this:
inner_prod (v + w) u = inner_prod v u + inner_prod w u

goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inner_prod (v + w) u = inner_prod v u + inner_prod w u

goal (1 subgoal):
 1. inner_prod (v + w) u = inner_prod v u + inner_prod w u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (v + w) u = inner_prod v u + inner_prod w u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_derivative_unique:
  assumes "(f has_derivative F) (at x)"
    and "(f has_derivative F') (at x)"
  shows "F = F'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = F'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F = F'
[PROOF STEP]
have "((\<lambda>x. 0) has_derivative (\<lambda>h. F h - F' h)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. 0::'b) has_derivative (\<lambda>h. F h - F' h)) (at x)
[PROOF STEP]
using has_derivative_diff [OF assms]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x - f x) has_derivative (\<lambda>x. F x - F' x)) (at x)

goal (1 subgoal):
 1. ((\<lambda>x. 0::'b) has_derivative (\<lambda>h. F h - F' h)) (at x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>x. 0::'b) has_derivative (\<lambda>h. F h - F' h)) (at x)

goal (1 subgoal):
 1. F = F'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. 0::'b) has_derivative (\<lambda>h. F h - F' h)) (at x)
[PROOF STEP]
have "(\<lambda>h. F h - F' h) = (\<lambda>h. 0)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. 0::'b) has_derivative (\<lambda>h. F h - F' h)) (at x)

goal (1 subgoal):
 1. (\<lambda>h. F h - F' h) = (\<lambda>h. 0::'b)
[PROOF STEP]
by (rule has_derivative_zero_unique)
[PROOF STATE]
proof (state)
this:
(\<lambda>h. F h - F' h) = (\<lambda>h. 0::'b)

goal (1 subgoal):
 1. F = F'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>h. F h - F' h) = (\<lambda>h. 0::'b)
[PROOF STEP]
show "F = F'"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>h. F h - F' h) = (\<lambda>h. 0::'b)

goal (1 subgoal):
 1. F = F'
[PROOF STEP]
unfolding fun_eq_iff right_minus_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>x. F x = F' x

goal (1 subgoal):
 1. \<forall>x. F x = F' x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
F = F'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_integral_X_power:
  "fls_integral (fls_X ^ n ::'a :: {ring_1,inverse} fls) =
    fls_const (inverse (of_nat (Suc n))) * fls_X ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fls_X ^ n) = fls_const (inverse (of_nat (Suc n))) * fls_X ^ Suc n
[PROOF STEP]
proof (intro fls_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. fls_integral (fls_X ^ n) $$ x = (fls_const (inverse (of_nat (Suc n))) * fls_X ^ Suc n) $$ x
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. fls_integral (fls_X ^ n) $$ x = (fls_const (inverse (of_nat (Suc n))) * fls_X ^ Suc n) $$ x
[PROOF STEP]
have "(fls_X :: 'a fls) ^ Suc n $$ k = (if k=Suc n then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_X ^ Suc n $$ k = (if k = int (Suc n) then 1::'a else (0::'a))
[PROOF STEP]
by (rule fls_X_power_nth)
[PROOF STATE]
proof (state)
this:
fls_X ^ Suc n $$ k = (if k = int (Suc n) then 1::'a else (0::'a))

goal (1 subgoal):
 1. \<And>x. fls_integral (fls_X ^ n) $$ x = (fls_const (inverse (of_nat (Suc n))) * fls_X ^ Suc n) $$ x
[PROOF STEP]
thus
    "fls_integral ((fls_X::'a fls) ^ n) $$ k =
      (fls_const (inverse (of_nat (Suc n))) * (fls_X::'a fls) ^ Suc n) $$ k"
[PROOF STATE]
proof (prove)
using this:
fls_X ^ Suc n $$ k = (if k = int (Suc n) then 1::'a else (0::'a))

goal (1 subgoal):
 1. fls_integral (fls_X ^ n) $$ k = (fls_const (inverse (of_nat (Suc n))) * fls_X ^ Suc n) $$ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_integral (fls_X ^ n) $$ k = (fls_const (inverse (of_nat (Suc n))) * fls_X ^ Suc n) $$ k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem loxodromic_unique_fixed_points:
  assumes "loxodromic_isometry f"
  shows "Gromov_extension f xi = xi \<longleftrightarrow> xi = attracting_fixed_point f \<or> xi = repelling_fixed_point f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Gromov_extension f xi = xi) = (xi = attracting_fixed_point f \<or> xi = repelling_fixed_point f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Gromov_extension f xi = xi) = (xi = attracting_fixed_point f \<or> xi = repelling_fixed_point f)
[PROOF STEP]
have "xi = attracting_fixed_point f" if H: "Gromov_extension f xi = xi" "xi \<noteq> repelling_fixed_point f" for xi
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xi = attracting_fixed_point f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xi = attracting_fixed_point f
[PROOF STEP]
have "((Gromov_extension f)^^n) xi = xi" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Gromov_extension f ^^ n) xi = xi
[PROOF STEP]
apply (induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (Gromov_extension f ^^ 0) xi = xi
 2. \<And>n. (Gromov_extension f ^^ n) xi = xi \<Longrightarrow> (Gromov_extension f ^^ Suc n) xi = xi
[PROOF STEP]
using H(1)
[PROOF STATE]
proof (prove)
using this:
Gromov_extension f xi = xi

goal (2 subgoals):
 1. (Gromov_extension f ^^ 0) xi = xi
 2. \<And>n. (Gromov_extension f ^^ n) xi = xi \<Longrightarrow> (Gromov_extension f ^^ Suc n) xi = xi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Gromov_extension f ^^ ?n) xi = xi

goal (1 subgoal):
 1. xi = attracting_fixed_point f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Gromov_extension f ^^ ?n) xi = xi
[PROOF STEP]
have "(\<lambda>n. ((Gromov_extension f)^^n) xi) \<longlonglongrightarrow> xi"
[PROOF STATE]
proof (prove)
using this:
(Gromov_extension f ^^ ?n) xi = xi

goal (1 subgoal):
 1. (\<lambda>n. (Gromov_extension f ^^ n) xi) \<longlonglongrightarrow> xi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (Gromov_extension f ^^ n) xi) \<longlonglongrightarrow> xi

goal (1 subgoal):
 1. xi = attracting_fixed_point f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (Gromov_extension f ^^ n) xi) \<longlonglongrightarrow> xi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (Gromov_extension f ^^ n) xi) \<longlonglongrightarrow> xi

goal (1 subgoal):
 1. xi = attracting_fixed_point f
[PROOF STEP]
using loxodromic_attracting_fixed_point_attracts[OF assms H(2)] LIMSEQ_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (Gromov_extension f ^^ n) xi) \<longlonglongrightarrow> xi
(\<lambda>n. (Gromov_extension f ^^ n) xi) \<longlonglongrightarrow> attracting_fixed_point f
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. xi = attracting_fixed_point f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xi = attracting_fixed_point f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>Gromov_extension f ?xi = ?xi; ?xi \<noteq> repelling_fixed_point f\<rbrakk> \<Longrightarrow> ?xi = attracting_fixed_point f

goal (1 subgoal):
 1. (Gromov_extension f xi = xi) = (xi = attracting_fixed_point f \<or> xi = repelling_fixed_point f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>Gromov_extension f ?xi = ?xi; ?xi \<noteq> repelling_fixed_point f\<rbrakk> \<Longrightarrow> ?xi = attracting_fixed_point f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Gromov_extension f ?xi = ?xi; ?xi \<noteq> repelling_fixed_point f\<rbrakk> \<Longrightarrow> ?xi = attracting_fixed_point f

goal (1 subgoal):
 1. (Gromov_extension f xi = xi) = (xi = attracting_fixed_point f \<or> xi = repelling_fixed_point f)
[PROOF STEP]
using loxodromic_attracting_fixed_point(2)[OF assms] loxodromic_repelling_fixed_point(2)[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Gromov_extension f ?xi = ?xi; ?xi \<noteq> repelling_fixed_point f\<rbrakk> \<Longrightarrow> ?xi = attracting_fixed_point f
Gromov_extension f (attracting_fixed_point f) = attracting_fixed_point f
Gromov_extension f (repelling_fixed_point f) = repelling_fixed_point f

goal (1 subgoal):
 1. (Gromov_extension f xi = xi) = (xi = attracting_fixed_point f \<or> xi = repelling_fixed_point f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Gromov_extension f xi = xi) = (xi = attracting_fixed_point f \<or> xi = repelling_fixed_point f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma col_addrow:
  "l \<noteq> i \<Longrightarrow> i < n \<Longrightarrow> col (addrow_mat n a k l) i = unit_vec n i"
  "k < n \<Longrightarrow> l < n \<Longrightarrow> col (addrow_mat n a k l) l = a \<cdot>\<^sub>v unit_vec n k + unit_vec n l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>l \<noteq> i; i < n\<rbrakk> \<Longrightarrow> col (addrow_mat n a k l) i = unit_vec n i) &&& (\<lbrakk>k < n; l < n\<rbrakk> \<Longrightarrow> col (addrow_mat n a k l) l = a \<cdot>\<^sub>v unit_vec n k + unit_vec n l)
[PROOF STEP]
by (rule eq_vecI, auto)


[STATEMENT]
lemma coeff_degree_mult: "coeff (p * q) (degree (p * q)) = coeff q (degree q) * coeff p (degree p)"
  for p q :: "'a::{comm_semiring_0,semiring_no_zero_divisors} poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff (p * q) = lead_coeff q * lead_coeff p
[PROOF STEP]
by (cases "p = 0 \<or> q = 0") (auto simp: degree_mult_eq coeff_mult_degree_sum mult_ac)


[STATEMENT]
lemma Rep_matrix_zero_imp_mult_zero:
  "\<forall>j i k. (Rep_matrix A j k = 0) | (Rep_matrix B k i) = 0  \<Longrightarrow> A * B = (0::('a::lattice_ring) matrix)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j i k. Rep_matrix A j k = (0::'a) \<or> Rep_matrix B k i = (0::'a) \<Longrightarrow> A * B = 0
[PROOF STEP]
apply (subst Rep_matrix_inject[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j i k. Rep_matrix A j k = (0::'a) \<or> Rep_matrix B k i = (0::'a) \<Longrightarrow> Rep_matrix (A * B) = Rep_matrix 0
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<forall>j i k. Rep_matrix A j k = (0::'a) \<or> Rep_matrix B k i = (0::'a) \<Longrightarrow> Rep_matrix (A * B) x xa = Rep_matrix 0 x xa
[PROOF STEP]
apply (auto simp add: Rep_matrix_mult foldseq_zero zero_imp_mult_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma content_mult:
  fixes p q :: "'a :: {factorial_semiring, semiring_gcd, normalization_semidom_multiplicative} poly"
  shows "content (p * q) = content p * content q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (p * q) = content p * content q
[PROOF STEP]
proof (cases "p * q = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
 2. p * q \<noteq> 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p * q \<noteq> 0

goal (2 subgoals):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
 2. p * q \<noteq> 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p * q \<noteq> 0
[PROOF STEP]
have "p \<noteq> 0" and "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p * q \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 &&& q \<noteq> 0
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
p \<noteq> 0
q \<noteq> 0

goal (2 subgoals):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
 2. p * q \<noteq> 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
q \<noteq> 0
[PROOF STEP]
have *: "content (primitive_part p * primitive_part q) = 1"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. content (primitive_part p * primitive_part q) = (1::'a)
[PROOF STEP]
by (auto intro: content_1_mult)
[PROOF STATE]
proof (state)
this:
content (primitive_part p * primitive_part q) = (1::'a)

goal (2 subgoals):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
 2. p * q \<noteq> 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
have "p * q = smult (content p) (primitive_part p) * smult (content q) (primitive_part q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * q = smult (content p) (primitive_part p) * smult (content q) (primitive_part q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p * q = smult (content p) (primitive_part p) * smult (content q) (primitive_part q)

goal (2 subgoals):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
 2. p * q \<noteq> 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p * q = smult (content p) (primitive_part p) * smult (content q) (primitive_part q)

goal (2 subgoals):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
 2. p * q \<noteq> 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
have "\<dots> = smult (content p * content q) (primitive_part p * primitive_part q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (content p) (primitive_part p) * smult (content q) (primitive_part q) = smult (content p * content q) (primitive_part p * primitive_part q)
[PROOF STEP]
by (metis mult.commute mult_smult_right smult_smult)
[PROOF STATE]
proof (state)
this:
smult (content p) (primitive_part p) * smult (content q) (primitive_part q) = smult (content p * content q) (primitive_part p * primitive_part q)

goal (2 subgoals):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
 2. p * q \<noteq> 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
content (primitive_part p * primitive_part q) = (1::'a)
smult (content p) (primitive_part p) * smult (content q) (primitive_part q) = smult (content p * content q) (primitive_part p * primitive_part q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
content (primitive_part p * primitive_part q) = (1::'a)
smult (content p) (primitive_part p) * smult (content q) (primitive_part q) = smult (content p * content q) (primitive_part p * primitive_part q)

goal (1 subgoal):
 1. content (p * q) = content p * content q
[PROOF STEP]
by (simp add: normalize_mult)
[PROOF STATE]
proof (state)
this:
content (p * q) = content p * content q

goal (1 subgoal):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p * q = 0

goal (1 subgoal):
 1. p * q = 0 \<Longrightarrow> content (p * q) = content p * content q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p * q = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p * q = 0

goal (1 subgoal):
 1. content (p * q) = content p * content q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
content (p * q) = content p * content q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_mult_mono:"\<lbrakk> i < j; (0::int) < k \<rbrakk> \<Longrightarrow> k * i < k * j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < j; 0 < k\<rbrakk> \<Longrightarrow> k * i < k * j
[PROOF STEP]
apply (frule zmult_zless_mono2_lemma [of "i" "j" "nat k"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>i < j; 0 < k\<rbrakk> \<Longrightarrow> 0 < nat k
 2. \<lbrakk>i < j; 0 < k; int (nat k) * i < int (nat k) * j\<rbrakk> \<Longrightarrow> k * i < k * j
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < j; 0 < k; int (nat k) * i < int (nat k) * j\<rbrakk> \<Longrightarrow> k * i < k * j
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done