[STATEMENT]
lemma norm_triangle_ineq3: "\<bar>norm a - norm b\<bar> \<le> norm (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>norm a - norm b\<bar> \<le> norm (a - b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>norm a - norm b\<bar> \<le> norm (a - b)
[PROOF STEP]
have "norm a - norm b \<le> norm (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm a - norm b \<le> norm (a - b)
[PROOF STEP]
by (simp add: norm_triangle_ineq2)
[PROOF STATE]
proof (state)
this:
norm a - norm b \<le> norm (a - b)

goal (1 subgoal):
 1. \<bar>norm a - norm b\<bar> \<le> norm (a - b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
norm a - norm b \<le> norm (a - b)

goal (1 subgoal):
 1. \<bar>norm a - norm b\<bar> \<le> norm (a - b)
[PROOF STEP]
have "norm b - norm a \<le> norm (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm b - norm a \<le> norm (a - b)
[PROOF STEP]
by (metis norm_minus_commute norm_triangle_ineq2)
[PROOF STATE]
proof (state)
this:
norm b - norm a \<le> norm (a - b)

goal (1 subgoal):
 1. \<bar>norm a - norm b\<bar> \<le> norm (a - b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
norm a - norm b \<le> norm (a - b)
norm b - norm a \<le> norm (a - b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm a - norm b \<le> norm (a - b)
norm b - norm a \<le> norm (a - b)

goal (1 subgoal):
 1. \<bar>norm a - norm b\<bar> \<le> norm (a - b)
[PROOF STEP]
by (simp add: abs_le_iff)
[PROOF STATE]
proof (state)
this:
\<bar>norm a - norm b\<bar> \<le> norm (a - b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_incseq_approx:
  fixes a b :: ereal
  assumes "a < b"
  obtains X :: "nat \<Rightarrow> real" where "incseq X" "\<And>i. a < X i" "\<And>i. X i < b" "X \<longlonglongrightarrow> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases b)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = \<infinity>\<rbrakk> \<Longrightarrow> thesis
 3. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case PInf
[PROOF STATE]
proof (state)
this:
b = \<infinity>

goal (3 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = \<infinity>\<rbrakk> \<Longrightarrow> thesis
 3. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with \<open>a < b\<close>
[PROOF STATE]
proof (chain)
picking this:
a < b
b = \<infinity>
[PROOF STEP]
have "a = -\<infinity> \<or> (\<exists>r. a = ereal r)"
[PROOF STATE]
proof (prove)
using this:
a < b
b = \<infinity>

goal (1 subgoal):
 1. a = - \<infinity> \<or> (\<exists>r. a = ereal r)
[PROOF STEP]
by (cases a) auto
[PROOF STATE]
proof (state)
this:
a = - \<infinity> \<or> (\<exists>r. a = ereal r)

goal (3 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = \<infinity>\<rbrakk> \<Longrightarrow> thesis
 3. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a = - \<infinity> \<or> (\<exists>r. a = ereal r)

goal (3 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = \<infinity>\<rbrakk> \<Longrightarrow> thesis
 3. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "(\<lambda>x. ereal (real (Suc x))) \<longlonglongrightarrow> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ereal (real (Suc x))) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
by (simp add: Lim_PInfty filterlim_sequentially_Suc) (metis le_SucI of_nat_Suc of_nat_mono order_trans real_arch_simple)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (real (Suc x))) \<longlonglongrightarrow> \<infinity>

goal (3 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = \<infinity>\<rbrakk> \<Longrightarrow> thesis
 3. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (real (Suc x))) \<longlonglongrightarrow> \<infinity>

goal (3 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = \<infinity>\<rbrakk> \<Longrightarrow> thesis
 3. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "\<And>r. (\<lambda>x. ereal (r + real (Suc x))) \<longlonglongrightarrow> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. (\<lambda>x. ereal (r + real (Suc x))) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
by (simp add: filterlim_sequentially_Suc Lim_PInfty) (metis add.commute diff_le_eq nat_ceiling_le_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (?r + real (Suc x))) \<longlonglongrightarrow> \<infinity>

goal (3 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = \<infinity>\<rbrakk> \<Longrightarrow> thesis
 3. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a = - \<infinity> \<or> (\<exists>r. a = ereal r)
(\<lambda>x. ereal (real (Suc x))) \<longlonglongrightarrow> \<infinity>
(\<lambda>x. ereal (?r + real (Suc x))) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
a = - \<infinity> \<or> (\<exists>r. a = ereal r)
(\<lambda>x. ereal (real (Suc x))) \<longlonglongrightarrow> \<infinity>
(\<lambda>x. ereal (?r + real (Suc x))) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (intro that[of "\<lambda>i. real_of_ereal a + Suc i"])
       (auto simp: incseq_def PInf)
[PROOF STATE]
proof (state)
this:
thesis

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (real b')
[PROOF STATE]
proof (state)
this:
b = ereal b'

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
define d where "d = b' - (if a = -\<infinity> then b' - 1 else real_of_ereal a)"
[PROOF STATE]
proof (state)
this:
d = b' - (if a = - \<infinity> then b' - 1 else real_of_ereal a)

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with \<open>a < b\<close>
[PROOF STATE]
proof (chain)
picking this:
a < b
d = b' - (if a = - \<infinity> then b' - 1 else real_of_ereal a)
[PROOF STEP]
have a': "0 < d"
[PROOF STATE]
proof (prove)
using this:
a < b
d = b' - (if a = - \<infinity> then b' - 1 else real_of_ereal a)

goal (1 subgoal):
 1. 0 < d
[PROOF STEP]
by (cases a) (auto simp: real)
[PROOF STATE]
proof (state)
this:
0 < d

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < d

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "\<And>i r. r < b' \<Longrightarrow> (b' - r) * 1 < (b' - r) * real (Suc (Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i r. r < b' \<Longrightarrow> (b' - r) * 1 < (b' - r) * real (Suc (Suc i))
[PROOF STEP]
by (intro mult_strict_left_mono) auto
[PROOF STATE]
proof (state)
this:
?r < b' \<Longrightarrow> (b' - ?r) * 1 < (b' - ?r) * real (Suc (Suc ?i))

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with \<open>a < b\<close> a'
[PROOF STATE]
proof (chain)
picking this:
a < b
0 < d
?r < b' \<Longrightarrow> (b' - ?r) * 1 < (b' - ?r) * real (Suc (Suc ?i))
[PROOF STEP]
have "\<And>i. a < ereal (b' - d / real (Suc (Suc i)))"
[PROOF STATE]
proof (prove)
using this:
a < b
0 < d
?r < b' \<Longrightarrow> (b' - ?r) * 1 < (b' - ?r) * real (Suc (Suc ?i))

goal (1 subgoal):
 1. \<And>i. a < ereal (b' - d / real (Suc (Suc i)))
[PROOF STEP]
by (cases a) (auto simp: real d_def field_simps)
[PROOF STATE]
proof (state)
this:
a < ereal (b' - d / real (Suc (Suc ?i)))

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a < ereal (b' - d / real (Suc (Suc ?i)))

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "(\<lambda>i. b' - d / real i) \<longlonglongrightarrow> b'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. b' - d / real i) \<longlonglongrightarrow> b'
[PROOF STEP]
by (force intro: tendsto_eq_intros tendsto_divide_0[OF tendsto_const] filterlim_sup1
              simp: at_infinity_eq_at_top_bot filterlim_real_sequentially)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. b' - d / real i) \<longlonglongrightarrow> b'

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. b' - d / real i) \<longlonglongrightarrow> b'
[PROOF STEP]
have "(\<lambda>i. b' - d / Suc (Suc i)) \<longlonglongrightarrow> b'"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. b' - d / real i) \<longlonglongrightarrow> b'

goal (1 subgoal):
 1. (\<lambda>i. b' - d / real (Suc (Suc i))) \<longlonglongrightarrow> b'
[PROOF STEP]
by (blast intro: dest: filterlim_sequentially_Suc [THEN iffD2])
[PROOF STATE]
proof (state)
this:
(\<lambda>i. b' - d / real (Suc (Suc i))) \<longlonglongrightarrow> b'

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = ereal r\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < d
a < ereal (b' - d / real (Suc (Suc ?i)))
(\<lambda>i. b' - d / real (Suc (Suc i))) \<longlonglongrightarrow> b'
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
0 < d
a < ereal (b' - d / real (Suc (Suc ?i)))
(\<lambda>i. b' - d / real (Suc (Suc i))) \<longlonglongrightarrow> b'

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (intro that[of "\<lambda>i. b' - d / Suc (Suc i)"])
       (auto simp: real incseq_def intro!: divide_left_mono)
[PROOF STATE]
proof (state)
this:
thesis

goal (1 subgoal):
 1. \<lbrakk>\<And>X. \<lbrakk>incseq X; \<And>i. a < ereal (X i); \<And>i. ereal (X i) < b; (\<lambda>x. ereal (X x)) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> thesis; b = - \<infinity>\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
qed (use \<open>a < b\<close> in auto)


[STATEMENT]
lemma supp_aezfun_times :
  "supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)
[PROOF STEP]
have "supp (aezfun (x * y)) = supp (convolution (aezfun x) (aezfun y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (aezfun (x * y)) = supp (convolution (aezfun x) (aezfun y))
[PROOF STEP]
by transfer fast
[PROOF STATE]
proof (state)
this:
supp (aezfun (x * y)) = supp (convolution (aezfun x) (aezfun y))

goal (1 subgoal):
 1. supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
supp (aezfun (x * y)) = supp (convolution (aezfun x) (aezfun y))

goal (1 subgoal):
 1. supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)
[PROOF STEP]
using supp_convolution_subset_sum_supp
[PROOF STATE]
proof (prove)
using this:
supp (aezfun (x * y)) = supp (convolution (aezfun x) (aezfun y))
supp (convolution ?f ?g) \<subseteq> supp ?f + supp ?g

goal (1 subgoal):
 1. supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem fusion_gfp_geq:
  assumes monoH: "mono H"
  and distribF: "dist_over_inf F"
  and comp_geq: "\<And>x. ((H \<circ> F) x \<sqsubseteq> (F \<circ> G) x)"
  shows "gfp H \<sqsubseteq> F (gfp G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "(gfp H) \<sqsubseteq> (F \<circ> F\<^sup>\<flat>) (gfp H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp H \<sqsubseteq> (F \<circ> F\<^sup>\<flat>) (gfp H)
variables:
F, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using distribF l_cancellation
[PROOF STATE]
proof (prove)
using this:
dist_over_inf (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
dist_over_inf (?F::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice) \<Longrightarrow> (?x::?'a::refinement_lattice) \<sqsubseteq> (?F \<circ> ?F\<^sup>\<flat>) ?x

goal (1 subgoal):
 1. gfp H \<sqsubseteq> (F \<circ> F\<^sup>\<flat>) (gfp H)
variables:
F, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H)

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H)
[PROOF STEP]
have "H (gfp H) \<sqsubseteq> H ((F \<circ> F\<^sup>\<flat>) (gfp H))"
[PROOF STATE]
proof (prove)
using this:
gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H)

goal (1 subgoal):
 1. H (gfp H) \<sqsubseteq> H ((F \<circ> F\<^sup>\<flat>) (gfp H))
variables:
F, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: monoD monoH)
[PROOF STATE]
proof (state)
this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> H (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> H (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))
[PROOF STEP]
have "H (gfp H) \<sqsubseteq> F ((G \<circ> F\<^sup>\<flat>) (gfp H))"
[PROOF STATE]
proof (prove)
using this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> H (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))

goal (1 subgoal):
 1. H (gfp H) \<sqsubseteq> F ((G \<circ> F\<^sup>\<flat>) (gfp H))
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using comp_geq
[PROOF STATE]
proof (prove)
using this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> H (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))
((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) (?x::'a::refinement_lattice) \<sqsubseteq> (F \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) ?x

goal (1 subgoal):
 1. H (gfp H) \<sqsubseteq> F ((G \<circ> F\<^sup>\<flat>) (gfp H))
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis comp_def refine_trans)
[PROOF STATE]
proof (state)
this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))
[PROOF STEP]
have "(F\<^sup>\<flat>) (H (gfp H)) \<sqsubseteq> (G \<circ> F\<^sup>\<flat>) (gfp H)"
[PROOF STATE]
proof (prove)
using this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))

goal (1 subgoal):
 1. (F\<^sup>\<flat>) (H (gfp H)) \<sqsubseteq> (G \<circ> F\<^sup>\<flat>) (gfp H)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using distribF
[PROOF STATE]
proof (prove)
using this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H) \<sqsubseteq> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H))
dist_over_inf (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. (F\<^sup>\<flat>) (H (gfp H)) \<sqsubseteq> (G \<circ> F\<^sup>\<flat>) (gfp H)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis (mono_tags) l_galois_connection)
[PROOF STATE]
proof (state)
this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>\<flat>) ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H)) \<sqsubseteq> ((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H)

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>\<flat>) ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H)) \<sqsubseteq> ((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H)
[PROOF STEP]
have "(F\<^sup>\<flat>) (gfp H) \<sqsubseteq> (gfp G)"
[PROOF STATE]
proof (prove)
using this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>\<flat>) ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp H)) \<sqsubseteq> ((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>\<flat>) (gfp H)

goal (1 subgoal):
 1. (F\<^sup>\<flat>) (gfp H) \<sqsubseteq> gfp G
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis comp_apply gfp_unfold gfp_upperbound monoH)
[PROOF STATE]
proof (state)
this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>\<flat>) (gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus "gfp H \<sqsubseteq> F (gfp G)"
[PROOF STATE]
proof (prove)
using this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>\<flat>) (gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using distribF
[PROOF STATE]
proof (prove)
using this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>\<flat>) (gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
dist_over_inf (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. gfp H \<sqsubseteq> F (gfp G)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis (mono_tags) l_galois_connection)
[PROOF STATE]
proof (state)
this:
gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))

goal:
No subgoals!
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma monom_pow:"monom (Poly_Mapping.single v n0) a ^ n = monom (Poly_Mapping.single v (n0*n)) (a ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (Poly_Mapping.single v n0) a ^ n = monom (Poly_Mapping.single v (n0 * n)) (a ^ n)
[PROOF STEP]
apply (induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. monom (Poly_Mapping.single v n0) a ^ 0 = monom (Poly_Mapping.single v (n0 * 0)) (a ^ 0)
 2. \<And>n. monom (Poly_Mapping.single v n0) a ^ n = monom (Poly_Mapping.single v (n0 * n)) (a ^ n) \<Longrightarrow> monom (Poly_Mapping.single v n0) a ^ Suc n = monom (Poly_Mapping.single v (n0 * Suc n)) (a ^ Suc n)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. monom (Poly_Mapping.single v n0) a ^ n = monom (Poly_Mapping.single v (n0 * n)) (a ^ n) \<Longrightarrow> monom (Poly_Mapping.single v n0) a * monom (Poly_Mapping.single v (n0 * n)) (a ^ n) = monom (Poly_Mapping.single v (n0 + n0 * n)) (a * a ^ n)
[PROOF STEP]
by (metis (no_types, lifting) mult_monom single_add)


[STATEMENT]
lemma homotopy_equivalent_space_imp_isomorphic_relative_homology_groups:
  assumes "continuous_map X Y f" and fim: "f ` S \<subseteq> T"
      and "continuous_map Y X g" and gim: "g ` T \<subseteq> S"
      and "homotopic_with (\<lambda>h. h ` S \<subseteq> S) X X (g \<circ> f) id"
      and "homotopic_with (\<lambda>k. k ` T \<subseteq> T) Y Y (f \<circ> g) id"
    shows "relative_homology_group p X S \<cong> relative_homology_group p Y T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relative_homology_group p X S \<cong> relative_homology_group p Y T
[PROOF STEP]
using homotopy_equivalence_relative_homology_group_isomorphism [OF assms]
[PROOF STATE]
proof (prove)
using this:
hom_induced ?p X S Y T f \<in> Group.iso (relative_homology_group ?p X S) (relative_homology_group ?p Y T)

goal (1 subgoal):
 1. relative_homology_group p X S \<cong> relative_homology_group p Y T
[PROOF STEP]
unfolding is_iso_def
[PROOF STATE]
proof (prove)
using this:
hom_induced ?p X S Y T f \<in> Group.iso (relative_homology_group ?p X S) (relative_homology_group ?p Y T)

goal (1 subgoal):
 1. Group.iso (relative_homology_group p X S) (relative_homology_group p Y T) \<noteq> {}
[PROOF STEP]
by blast


[STATEMENT]
lemma asymp_equivI'_const:
  assumes "((\<lambda>x. f x / g x) \<longlongrightarrow> c) F" "c \<noteq> 0"
  shows   "f \<sim>[F] (\<lambda>x. c * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<sim>[F] (\<lambda>x. c * g x)
[PROOF STEP]
using tendsto_mult[OF assms(1) tendsto_const[of "inverse c"]] assms(2)
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x / g x * inverse c) \<longlongrightarrow> c * inverse c) F
c \<noteq> (0::'b)

goal (1 subgoal):
 1. f \<sim>[F] (\<lambda>x. c * g x)
[PROOF STEP]
by (intro asymp_equivI') (simp add: field_simps)


[STATEMENT]
lemma A34_ub: assumes "bst t"
shows "S34.A a t \<le> (3/2) * log 2 (size1 t) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S34.A a t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S34.A a t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
have "S34.A a t \<le> log (root 3 4) (size1 t) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S34.A a t \<le> log (root 3 4) (real (size1 t)) + 1
[PROOF STEP]
by(rule S34.A_ub3[OF assms])
[PROOF STATE]
proof (state)
this:
S34.A a t \<le> log (root 3 4) (real (size1 t)) + 1

goal (1 subgoal):
 1. S34.A a t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S34.A a t \<le> log (root 3 4) (real (size1 t)) + 1

goal (1 subgoal):
 1. S34.A a t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
have "\<dots> = (3/2) * log 2 (size t + 1) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (root 3 4) (real (size1 t)) + 1 = 3 / 2 * log 2 (real (size t + 1)) + 1
[PROOF STEP]
by(simp add: log4_log2)
[PROOF STATE]
proof (state)
this:
log (root 3 4) (real (size1 t)) + 1 = 3 / 2 * log 2 (real (size t + 1)) + 1

goal (1 subgoal):
 1. S34.A a t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S34.A a t \<le> 3 / 2 * log 2 (real (size t + 1)) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S34.A a t \<le> 3 / 2 * log 2 (real (size t + 1)) + 1

goal (1 subgoal):
 1. S34.A a t \<le> 3 / 2 * \<phi> t + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S34.A a t \<le> 3 / 2 * \<phi> t + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infin_imp_iNextWeak_iNextStrong_eq_iNext: "
  \<lbrakk> infinite I; t0 \<in> I \<rbrakk> \<Longrightarrow>
  ((\<circle>\<^sub>W t t0 I. P t) = (\<circle> t t0 I. P t)) \<and> ((\<circle>\<^sub>S t t0 I. P t) = (\<circle> t t0 I. P t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite I; t0 \<in> I\<rbrakk> \<Longrightarrow> iNextWeak t0 I P = iNext t0 I P \<and> iNextStrong t0 I P = iNext t0 I P
[PROOF STEP]
by (simp add: iTL_Next_iff nat_cut_greater_infinite_not_empty)


[STATEMENT]
lemma GDERIV_diff:
    "\<lbrakk>GDERIV f x :> df; GDERIV g x :> dg\<rbrakk>
     \<Longrightarrow> GDERIV (\<lambda>x. f x - g x) x :> df - dg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>GDERIV f x :> df; GDERIV g x :> dg\<rbrakk> \<Longrightarrow> GDERIV (\<lambda>x. f x - g x) x :> df - dg
[PROOF STEP]
unfolding gderiv_def inner_diff_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_derivative (\<lambda>h. inner h df)) (at x); (g has_derivative (\<lambda>h. inner h dg)) (at x)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x - g x) has_derivative (\<lambda>h. inner h df - inner h dg)) (at x)
[PROOF STEP]
by (rule has_derivative_diff)


[STATEMENT]
lemma rotation_minus_pi_2_y_axis [simp]:
  shows "moebius_circline (moebius_rotation (-pi/2)) y_axis = x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (moebius_rotation (- pi / 2)) y_axis = x_axis
[PROOF STEP]
unfolding moebius_rotation_def moebius_similarity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (mk_moebius (cis (- pi / 2)) 0 0 1) y_axis = x_axis
[PROOF STEP]
by (transfer, transfer, simp add: mat_adj_def mat_cnj_def, rule_tac x="-1" in exI, simp)


[STATEMENT]
lemma nsets_singleton_iff: "nsets {a} r = (if r=0 then {{}} else if r=1 then {{a}} else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [{a}]\<^bsup>r\<^esup> = (if r = 0 then {{}} else if r = 1 then {{a}} else {})
[PROOF STEP]
by (auto simp: nsets_def card_gt_0_iff subset_singleton_iff)


[STATEMENT]
lemma sub1:
 assumes "p*q = 1"
 shows "r*(p*q) = r*1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * (p * q) = r * (1::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p * q = (1::'a)

goal (1 subgoal):
 1. r * (p * q) = r * (1::'a)
[PROOF STEP]
by metis


[STATEMENT]
lemma sum_of_unit_vec_length:
  fixes i j n:: nat and c:: complex
  assumes "i < n" and "j < n" and "i \<noteq> j"
  shows "\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2 = 1 + cnj(c) * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
define v where d0:"v = unit_vec n i + c \<cdot>\<^sub>v unit_vec n j"
[PROOF STATE]
proof (state)
this:
v = unit_vec n i + c \<cdot>\<^sub>v unit_vec n j

goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
have "\<forall>k<n. v $ k = (if k = i then 1 else (if k = j then c else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k<n. v $ k = (if k = i then 1 else if k = j then c else 0)
[PROOF STEP]
using d0 assms(1,2,3)
[PROOF STATE]
proof (prove)
using this:
v = unit_vec n i + c \<cdot>\<^sub>v unit_vec n j
i < n
j < n
i \<noteq> j

goal (1 subgoal):
 1. \<forall>k<n. v $ k = (if k = i then 1 else if k = j then c else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>k<n. v $ k = (if k = i then 1 else if k = j then c else 0)

goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>k<n. v $ k = (if k = i then 1 else if k = j then c else 0)
[PROOF STEP]
have "\<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj(c) * c else 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>k<n. v $ k = (if k = i then 1 else if k = j then c else 0)

goal (1 subgoal):
 1. \<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj c * c else 0)
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
\<forall>k<n. v $ k = (if k = i then 1 else if k = j then c else 0)
i \<noteq> j

goal (1 subgoal):
 1. \<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj c * c else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj c * c else 0)

goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj c * c else 0)

goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
have "\<parallel>v\<parallel>\<^sup>2 = (\<Sum>k = 0..<n. cnj (v $ k) * v $ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (\<parallel>v\<parallel>\<^sup>2) = (\<Sum>k = 0..<n. cnj (v $ k) * v $ k)
[PROOF STEP]
using d0 assms cpx_vec_length_inner_prod inner_prod_def
[PROOF STATE]
proof (prove)
using this:
v = unit_vec n i + c \<cdot>\<^sub>v unit_vec n j
i < n
j < n
i \<noteq> j
complex_of_real (\<parallel>?v\<parallel>\<^sup>2) = \<langle>?v|?v\<rangle>
\<langle>?u|?v\<rangle> \<equiv> \<Sum>i = 0..<dim_vec ?v. cnj (?u $ i) * ?v $ i

goal (1 subgoal):
 1. complex_of_real (\<parallel>v\<parallel>\<^sup>2) = (\<Sum>k = 0..<n. cnj (v $ k) * v $ k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real (\<parallel>v\<parallel>\<^sup>2) = (\<Sum>k = 0..<n. cnj (v $ k) * v $ k)

goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj c * c else 0)
complex_of_real (\<parallel>v\<parallel>\<^sup>2) = (\<Sum>k = 0..<n. cnj (v $ k) * v $ k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj c * c else 0)
complex_of_real (\<parallel>v\<parallel>\<^sup>2) = (\<Sum>k = 0..<n. cnj (v $ k) * v $ k)

goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
using d0 assms
[PROOF STATE]
proof (prove)
using this:
\<forall>k<n. cnj (v $ k) * v $ k = (if k = i then 1 else 0) + (if k = j then cnj c * c else 0)
complex_of_real (\<parallel>v\<parallel>\<^sup>2) = (\<Sum>k = 0..<n. cnj (v $ k) * v $ k)
v = unit_vec n i + c \<cdot>\<^sub>v unit_vec n j
i < n
j < n
i \<noteq> j

goal (1 subgoal):
 1. complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c
[PROOF STEP]
by (auto simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
complex_of_real (\<parallel>unit_vec n i + c \<cdot>\<^sub>v unit_vec n j\<parallel>\<^sup>2) = 1 + cnj c * c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fvars_softSubst[simp]:
  "\<phi> \<in> fmla \<Longrightarrow> t \<in> trm \<Longrightarrow> x \<in> var \<Longrightarrow>
 Fvars (softSubst \<phi> t x) = (Fvars \<phi> \<union> FvarsT t - {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; t \<in> trm; x \<in> var\<rbrakk> \<Longrightarrow> Fvars (softSubst \<phi> t x) = Fvars \<phi> \<union> FvarsT t - {x}
[PROOF STEP]
unfolding softSubst_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; t \<in> trm; x \<in> var\<rbrakk> \<Longrightarrow> Fvars (exi x (cnj (eql (Var x) t) \<phi>)) = Fvars \<phi> \<union> FvarsT t - {x}
[PROOF STEP]
by auto


[STATEMENT]
lemma mapping_of_lift_add : "mapping_of (liftPoly x y (a + b)) = mapping_of (liftPoly x y a) + mapping_of (liftPoly x y b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mapping_of (liftPoly x y (a + b)) = mapping_of (liftPoly x y a) + mapping_of (liftPoly x y b)
[PROOF STEP]
unfolding liftPoly.rep_eq plus_mpoly.rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higherPoly\<^sub>0 x y (mapping_of a + mapping_of b) = higherPoly\<^sub>0 x y (mapping_of a) + higherPoly\<^sub>0 x y (mapping_of b)
[PROOF STEP]
using higherPoly\<^sub>0_add
[PROOF STATE]
proof (prove)
using this:
higherPoly\<^sub>0 ?x ?y (?p + ?q) = higherPoly\<^sub>0 ?x ?y ?p + higherPoly\<^sub>0 ?x ?y ?q

goal (1 subgoal):
 1. higherPoly\<^sub>0 x y (mapping_of a + mapping_of b) = higherPoly\<^sub>0 x y (mapping_of a) + higherPoly\<^sub>0 x y (mapping_of b)
[PROOF STEP]
.


[STATEMENT]
lemma closure_approachable:
  fixes S :: "'a::metric_space set"
  shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> closure S) = (\<forall>e>0. \<exists>y\<in>S. dist y x < e)
[PROOF STEP]
apply (auto simp: closure_def islimpt_approachable)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. \<lbrakk>0 < e; x \<in> S\<rbrakk> \<Longrightarrow> \<exists>y\<in>S. dist y x < e
[PROOF STEP]
apply (metis dist_self)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma winding_number_nearby_paths_eq:
     "\<lbrakk>path g; path h; pathstart h = pathstart g; pathfinish h = pathfinish g;
      \<And>t. t \<in> {0..1} \<Longrightarrow> norm(h t - g t) < norm(g t - z)\<rbrakk>
      \<Longrightarrow> winding_number h z = winding_number g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path g; path h; pathstart h = pathstart g; pathfinish h = pathfinish g; \<And>t. t \<in> {0..1} \<Longrightarrow> cmod (h t - g t) < cmod (g t - z)\<rbrakk> \<Longrightarrow> winding_number h z = winding_number g z
[PROOF STEP]
by (metis segment_bound(2) norm_minus_commute not_le winding_number_paths_linear_eq)


[STATEMENT]
lemma (in abelian_group) a_lcos_m_assoc:
  "\<lbrakk> M \<subseteq> carrier G; g \<in> carrier G; h \<in> carrier G \<rbrakk> \<Longrightarrow> g <+ (h <+ M) = (g \<oplus> h) <+ M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M \<subseteq> carrier G; g \<in> carrier G; h \<in> carrier G\<rbrakk> \<Longrightarrow> g <+ (h <+ M) = g \<oplus> h <+ M
[PROOF STEP]
by (rule group.lcos_m_assoc [OF a_group,
    folded a_l_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma in_Fvars_substD:
  "y \<in> Fvars (subst \<phi> t x) \<Longrightarrow> \<phi> \<in> fmla \<Longrightarrow> t \<in> trm \<Longrightarrow> x \<in> var
   \<Longrightarrow> y \<in> (Fvars \<phi> - {x}) \<union> (if x \<in> Fvars \<phi> then FvarsT t else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> Fvars (subst \<phi> t x); \<phi> \<in> fmla; t \<in> trm; x \<in> var\<rbrakk> \<Longrightarrow> y \<in> Fvars \<phi> - {x} \<union> (if x \<in> Fvars \<phi> then FvarsT t else {})
[PROOF STEP]
using Fvars_subst
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?\<phi> \<in> fmla; ?t \<in> trm; ?x \<in> var\<rbrakk> \<Longrightarrow> Fvars (subst ?\<phi> ?t ?x) = Fvars ?\<phi> - {?x} \<union> (if ?x \<in> Fvars ?\<phi> then FvarsT ?t else {})

goal (1 subgoal):
 1. \<lbrakk>y \<in> Fvars (subst \<phi> t x); \<phi> \<in> fmla; t \<in> trm; x \<in> var\<rbrakk> \<Longrightarrow> y \<in> Fvars \<phi> - {x} \<union> (if x \<in> Fvars \<phi> then FvarsT t else {})
[PROOF STEP]
by auto


[STATEMENT]
lemma image_mset_union [simp]: "image_mset f (M + N) = image_mset f M + image_mset f N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (M + N) = image_mset f M + image_mset f N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. image_mset f (M + N) = image_mset f M + image_mset f N
[PROOF STEP]
interpret comp_fun_commute "add_mset \<circ> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute (add_mset \<circ> f)
[PROOF STEP]
by (fact comp_fun_commute_mset_image)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. image_mset f (M + N) = image_mset f M + image_mset f N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (M + N) = image_mset f M + image_mset f N
[PROOF STEP]
by (induct N) (simp_all add: image_mset_def)
[PROOF STATE]
proof (state)
this:
image_mset f (M + N) = image_mset f M + image_mset f N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prob_eq:
  "prob A = (if A \<subseteq> Pow S_edges then (\<Sum>edges\<in>A. p^card edges * (1 - p)^card (S_edges - edges)) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob A = (if A \<subseteq> Pow S_edges then \<Sum>edges\<in>A. p ^ card edges * (1 - p) ^ card (S_edges - edges) else 0)
[PROOF STEP]
using emeasure_eq[of A] p_prob
[PROOF STATE]
proof (prove)
using this:
emeasure P A = ennreal (if A \<subseteq> Pow S_edges then \<Sum>edges\<in>A. p ^ card edges * (1 - p) ^ card (S_edges - edges) else 0)
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. prob A = (if A \<subseteq> Pow S_edges then \<Sum>edges\<in>A. p ^ card edges * (1 - p) ^ card (S_edges - edges) else 0)
[PROOF STEP]
unfolding emeasure_eq_measure
[PROOF STATE]
proof (prove)
using this:
ennreal (prob A) = ennreal (if A \<subseteq> Pow S_edges then \<Sum>edges\<in>A. p ^ card edges * (1 - p) ^ card (S_edges - edges) else 0)
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. prob A = (if A \<subseteq> Pow S_edges then \<Sum>edges\<in>A. p ^ card edges * (1 - p) ^ card (S_edges - edges) else 0)
[PROOF STEP]
by (simp add: sum_nonneg)


[STATEMENT]
lemma card_notin_fset:
  shows "(x |\<notin>| S) = (card_fset (insert_fset x S) = Suc (card_fset S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x |\<notin>| S) = (card_fset (insert_fset x S) = Suc (card_fset S))
[PROOF STEP]
by simp


[STATEMENT]
lemma span_UNIV[simp]: "span UNIV = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span UNIV = UNIV
[PROOF STEP]
by (auto intro: span_base)


[STATEMENT]
lemma scene_space_inter_assoc:
  assumes "x \<in> scene_space" "y \<in> scene_space" "z \<in> scene_space"
  shows "(x \<sqinter>\<^sub>S y) \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
have "(x \<sqinter>\<^sub>S y) \<sqinter>\<^sub>S z = - (- x \<squnion>\<^sub>S - y \<squnion>\<^sub>S - z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = - (- x \<squnion>\<^sub>S - y \<squnion>\<^sub>S - z)
[PROOF STEP]
by (simp add: scene_demorgan1 uminus_scene_twice)
[PROOF STATE]
proof (state)
this:
x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = - (- x \<squnion>\<^sub>S - y \<squnion>\<^sub>S - z)

goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = - (- x \<squnion>\<^sub>S - y \<squnion>\<^sub>S - z)

goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
have "... = - (- x \<squnion>\<^sub>S (- y \<squnion>\<^sub>S - z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- x \<squnion>\<^sub>S - y \<squnion>\<^sub>S - z) = - (- x \<squnion>\<^sub>S (- y \<squnion>\<^sub>S - z))
[PROOF STEP]
by (simp add: assms scene_space_uminus scene_space_union_assoc)
[PROOF STATE]
proof (state)
this:
- (- x \<squnion>\<^sub>S - y \<squnion>\<^sub>S - z) = - (- x \<squnion>\<^sub>S (- y \<squnion>\<^sub>S - z))

goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- x \<squnion>\<^sub>S - y \<squnion>\<^sub>S - z) = - (- x \<squnion>\<^sub>S (- y \<squnion>\<^sub>S - z))

goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
have "... = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- x \<squnion>\<^sub>S (- y \<squnion>\<^sub>S - z)) = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
by (simp add: scene_demorgan1 uminus_scene_twice)
[PROOF STATE]
proof (state)
this:
- (- x \<squnion>\<^sub>S (- y \<squnion>\<^sub>S - z)) = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)

goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)

goal (1 subgoal):
 1. x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<sqinter>\<^sub>S y \<sqinter>\<^sub>S z = x \<sqinter>\<^sub>S (y \<sqinter>\<^sub>S z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power2_i [simp]: "\<i>\<^sup>2 = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i>\<^sup>2 = - 1
[PROOF STEP]
by (simp add: power2_eq_square)


[STATEMENT]
theorem delete_bound_size_univ': "invar_vebt t n \<Longrightarrow> u =  2^n \<Longrightarrow>   T\<^sub>d\<^sub>e\<^sub>l\<^sub>e\<^sub>t\<^sub>e'  t x \<le> 2 +  lb (lb u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; u = 2 ^ n\<rbrakk> \<Longrightarrow> real (T\<^sub>d\<^sub>e\<^sub>l\<^sub>e\<^sub>t\<^sub>e' t x) \<le> 2 + log 2 (log 2 u)
[PROOF STEP]
using delete_bound_height'[of t n x] height_double_log_univ_size[of u n t]
[PROOF STATE]
proof (prove)
using this:
invar_vebt t n \<Longrightarrow> T\<^sub>d\<^sub>e\<^sub>l\<^sub>e\<^sub>t\<^sub>e' t x \<le> 1 + height t
\<lbrakk>u = 2 ^ n; invar_vebt t n\<rbrakk> \<Longrightarrow> real (height t) \<le> 1 + log 2 (log 2 u)

goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; u = 2 ^ n\<rbrakk> \<Longrightarrow> real (T\<^sub>d\<^sub>e\<^sub>l\<^sub>e\<^sub>t\<^sub>e' t x) \<le> 2 + log 2 (log 2 u)
[PROOF STEP]
by simp


[STATEMENT]
lemma clop_Inf_closed_var:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "clop f \<Longrightarrow> f \<circ> Inf \<circ> (`) f  = Inf \<circ> (`) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clop f \<Longrightarrow> f \<circ> Inf \<circ> (`) f = Inf \<circ> (`) f
[PROOF STEP]
unfolding clop_def mono_def comp_def le_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. id x \<le> f x) \<and> (\<forall>x y. x \<le> y \<longrightarrow> f x \<le> f y) \<and> (\<forall>x. f (f x) \<le> f x) \<Longrightarrow> (\<lambda>x. f (\<Sqinter> (f ` x))) = (\<lambda>x. \<Sqinter> (f ` x))
[PROOF STEP]
by (metis (mono_tags, lifting) antisym id_apply le_INF_iff order_refl)


[STATEMENT]
lemma lattice_of_finsum:
  assumes "set fs \<subseteq> carrier_vec n"
  shows "lattice_of fs = range (\<lambda> c. finsum V (\<lambda> i. of_int (c i) \<cdot>\<^sub>v fs ! i) {0 ..< length fs})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of fs = range (\<lambda>c. \<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice_of fs = range (\<lambda>c. \<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
have "sumlist (map (\<lambda> i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0 ..< length fs])
        = finsum V (\<lambda> i. of_int (c i) \<cdot>\<^sub>v fs ! i) {0 ..< length fs}" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0..<length fs]) = (\<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
using  assms
[PROOF STATE]
proof (prove)
using this:
set fs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0..<length fs]) = (\<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
by (subst sumlist_map_as_finsum) (fastforce)+
[PROOF STATE]
proof (state)
this:
M.sumlist (map (\<lambda>i. of_int (?c1 i) \<cdot>\<^sub>v fs ! i) [0..<length fs]) = (\<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (?c1 i) \<cdot>\<^sub>v fs ! i)

goal (1 subgoal):
 1. lattice_of fs = range (\<lambda>c. \<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M.sumlist (map (\<lambda>i. of_int (?c1 i) \<cdot>\<^sub>v fs ! i) [0..<length fs]) = (\<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (?c1 i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
M.sumlist (map (\<lambda>i. of_int (?c1 i) \<cdot>\<^sub>v fs ! i) [0..<length fs]) = (\<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (?c1 i) \<cdot>\<^sub>v fs ! i)

goal (1 subgoal):
 1. lattice_of fs = range (\<lambda>c. \<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
unfolding lattice_of_def
[PROOF STATE]
proof (prove)
using this:
M.sumlist (map (\<lambda>i. of_int (?c1 i) \<cdot>\<^sub>v fs ! i) [0..<length fs]) = (\<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (?c1 i) \<cdot>\<^sub>v fs ! i)

goal (1 subgoal):
 1. range (\<lambda>c. M.sumlist (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0..<length fs])) = range (\<lambda>c. \<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lattice_of fs = range (\<lambda>c. \<Oplus>\<^bsub>V\<^esub>i\<in>{0..<length fs}. of_int (c i) \<cdot>\<^sub>v fs ! i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm020:
  "converse`(A \<inter> B)  =  (converse`A) \<inter> (converse`B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. converse ` (A \<inter> B) = converse ` A \<inter> converse ` B
[PROOF STEP]
by force


[STATEMENT]
lemma connected_contains_Ioo:
  fixes A :: "'a :: linorder_topology set"
  assumes "connected A" "a \<in> A" "b \<in> A" shows "{a <..< b} \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a<..<b} \<subseteq> A
[PROOF STEP]
using connectedD_interval[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> ?z; ?z \<le> b\<rbrakk> \<Longrightarrow> ?z \<in> A

goal (1 subgoal):
 1. {a<..<b} \<subseteq> A
[PROOF STEP]
by (simp add: subset_eq Ball_def less_imp_le)


[STATEMENT]
lemma binomial_le_pow:
  assumes "r \<le> n"
  shows "n choose r \<le> n ^ r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose r \<le> n ^ r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n choose r \<le> n ^ r
[PROOF STEP]
have "n choose r \<le> fact n div fact (n - r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose r \<le> fact n div fact (n - r)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<le> n

goal (1 subgoal):
 1. n choose r \<le> fact n div fact (n - r)
[PROOF STEP]
by (subst binomial_fact_lemma[symmetric]) auto
[PROOF STATE]
proof (state)
this:
n choose r \<le> fact n div fact (n - r)

goal (1 subgoal):
 1. n choose r \<le> n ^ r
[PROOF STEP]
with fact_div_fact_le_pow [OF assms]
[PROOF STATE]
proof (chain)
picking this:
fact n div fact (n - r) \<le> n ^ r
n choose r \<le> fact n div fact (n - r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fact n div fact (n - r) \<le> n ^ r
n choose r \<le> fact n div fact (n - r)

goal (1 subgoal):
 1. n choose r \<le> n ^ r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n choose r \<le> n ^ r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conic_sgn_abs:
  assumes "v \<noteq> 0"
  shows "conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
from \<open>v \<noteq> 0\<close> and proj2_rep_abs2
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> proj2_rep (proj2_abs ?v) = k *\<^sub>R ?v
[PROOF STEP]
obtain j where "j \<noteq> 0" and "proj2_rep (proj2_abs v) = j *\<^sub>R v"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> proj2_rep (proj2_abs ?v) = k *\<^sub>R ?v

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j \<noteq> 0; proj2_rep (proj2_abs v) = j *\<^sub>R v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j \<noteq> 0
proj2_rep (proj2_abs v) = j *\<^sub>R v

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
from \<open>proj2_rep (proj2_abs v) = j *\<^sub>R v\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_rep (proj2_abs v) = j *\<^sub>R v
[PROOF STEP]
have "conic_sgn (proj2_abs v) = sgn (j\<^sup>2 * (v \<bullet> (M *v v)))"
[PROOF STATE]
proof (prove)
using this:
proj2_rep (proj2_abs v) = j *\<^sub>R v

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (j\<^sup>2 * (v \<bullet> (M *v v)))
[PROOF STEP]
unfolding conic_sgn_def
[PROOF STATE]
proof (prove)
using this:
proj2_rep (proj2_abs v) = j *\<^sub>R v

goal (1 subgoal):
 1. sgn (proj2_rep (proj2_abs v) \<bullet> (M *v proj2_rep (proj2_abs v))) = sgn (j\<^sup>2 * (v \<bullet> (M *v v)))
[PROOF STEP]
by (simp add:
      matrix_scaleR_vector_ac
      scaleR_matrix_vector_assoc [symmetric]
      dot_scaleR_mult
      power2_eq_square
      algebra_simps)
[PROOF STATE]
proof (state)
this:
conic_sgn (proj2_abs v) = sgn (j\<^sup>2 * (v \<bullet> (M *v v)))

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conic_sgn (proj2_abs v) = sgn (j\<^sup>2 * (v \<bullet> (M *v v)))

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
have "\<dots> = sgn (j\<^sup>2) * sgn (v \<bullet> (M *v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (j\<^sup>2 * (v \<bullet> (M *v v))) = sgn (j\<^sup>2) * sgn (v \<bullet> (M *v v))
[PROOF STEP]
by (rule sgn_mult)
[PROOF STATE]
proof (state)
this:
sgn (j\<^sup>2 * (v \<bullet> (M *v v))) = sgn (j\<^sup>2) * sgn (v \<bullet> (M *v v))

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sgn (j\<^sup>2 * (v \<bullet> (M *v v))) = sgn (j\<^sup>2) * sgn (v \<bullet> (M *v v))

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
from \<open>j \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
j \<noteq> 0
[PROOF STEP]
have "\<dots> = sgn (v \<bullet> (M *v v))"
[PROOF STATE]
proof (prove)
using this:
j \<noteq> 0

goal (1 subgoal):
 1. sgn (j\<^sup>2) * sgn (v \<bullet> (M *v v)) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
by (simp add: power2_eq_square sgn_mult)
[PROOF STATE]
proof (state)
this:
sgn (j\<^sup>2) * sgn (v \<bullet> (M *v v)) = sgn (v \<bullet> (M *v v))

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
show "conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))"
[PROOF STATE]
proof (prove)
using this:
conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))

goal (1 subgoal):
 1. conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
conic_sgn (proj2_abs v) = sgn (v \<bullet> (M *v v))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vars_minus [simp]: "vars (p1 - p2) \<subseteq> vars p1 \<union> vars p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (p1 - p2) \<subseteq> vars p1 \<union> vars p2
[PROOF STEP]
unfolding minus_linear_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (p1 + - p2) \<subseteq> vars p1 \<union> vars p2
[PROOF STEP]
using vars_plus[of p1 "-p2"] vars_uminus[of p2]
[PROOF STATE]
proof (prove)
using this:
vars (p1 + - p2) \<subseteq> vars p1 \<union> vars (- p2)
vars (- p2) = vars p2

goal (1 subgoal):
 1. vars (p1 + - p2) \<subseteq> vars p1 \<union> vars p2
[PROOF STEP]
by simp


[STATEMENT]
theorem ce_singleton: "{a} \<in> ce_sets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
let ?f = "\<lambda> x y. (abs_of_diff x a) + y"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
have S1: "?f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (+) (abs_of_diff x a)) \<in> PrimRec2
[PROOF STEP]
using const_is_pr_2 [where ?n="a"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. a) \<in> PrimRec2

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

goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (+) (abs_of_diff x a)) \<in> PrimRec2
[PROOF STEP]
have "\<forall> x y. (?f x y = 0) = (x=a \<and> y=0)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (+) (abs_of_diff x a)) \<in> PrimRec2

goal (1 subgoal):
 1. \<forall>x y. (abs_of_diff x a + y = 0) = (x = a \<and> y = 0)
[PROOF STEP]
by (simp add: abs_of_diff_eq)
[PROOF STATE]
proof (state)
this:
\<forall>x y. (abs_of_diff x a + y = 0) = (x = a \<and> y = 0)

goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x y. (abs_of_diff x a + y = 0) = (x = a \<and> y = 0)
[PROOF STEP]
have S2: "{x. \<exists> y. ?f x y = 0 }={a}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (abs_of_diff x a + y = 0) = (x = a \<and> y = 0)

goal (1 subgoal):
 1. {x. \<exists>y. abs_of_diff x a + y = 0} = {a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. \<exists>y. abs_of_diff x a + y = 0} = {a}

goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
have "fn_to_set ?f = {x. \<exists> y. ?f x y = 0 }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {x. \<exists>y. abs_of_diff x a + y = 0}
[PROOF STEP]
by (simp add: fn_to_set_def)
[PROOF STATE]
proof (state)
this:
fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {x. \<exists>y. abs_of_diff x a + y = 0}

goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
with S2
[PROOF STATE]
proof (chain)
picking this:
{x. \<exists>y. abs_of_diff x a + y = 0} = {a}
fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {x. \<exists>y. abs_of_diff x a + y = 0}
[PROOF STEP]
have "fn_to_set ?f = {a}"
[PROOF STATE]
proof (prove)
using this:
{x. \<exists>y. abs_of_diff x a + y = 0} = {a}
fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {x. \<exists>y. abs_of_diff x a + y = 0}

goal (1 subgoal):
 1. fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {a}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {a}

goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (+) (abs_of_diff x a)) \<in> PrimRec2
fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (+) (abs_of_diff x a)) \<in> PrimRec2
fn_to_set (\<lambda>x. (+) (abs_of_diff x a)) = {a}

goal (1 subgoal):
 1. {a} \<in> ce_sets
[PROOF STEP]
by (auto simp add: ce_sets_def)
[PROOF STATE]
proof (state)
this:
{a} \<in> ce_sets

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sample_coprime_e_gt_1:
  assumes "e \<in> set_spmf (sample_coprime N)"
  shows "e > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < e
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
e \<in> set_spmf (sample_coprime N)

goal (1 subgoal):
 1. 1 < e
[PROOF STEP]
by(simp add: sample_coprime_def coprime_set_def)


[STATEMENT]
lemma index_permute_list:
  assumes "\<pi> permutes {..<length xs}" "distinct xs" "x \<in> set xs"
  shows   "index (permute_list \<pi> xs) x = inv \<pi> (index xs x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (permute_list \<pi> xs) x = inv \<pi> (index xs x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. index (permute_list \<pi> xs) x = inv \<pi> (index xs x)
[PROOF STEP]
have *: "inv \<pi> permutes {..<length xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv \<pi> permutes {..<length xs}
[PROOF STEP]
by (rule permutes_inv) fact
[PROOF STATE]
proof (state)
this:
inv \<pi> permutes {..<length xs}

goal (1 subgoal):
 1. index (permute_list \<pi> xs) x = inv \<pi> (index xs x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<pi> permutes {..<length xs}
distinct xs
x \<in> set xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length xs}
distinct xs
x \<in> set xs

goal (1 subgoal):
 1. index (permute_list \<pi> xs) x = inv \<pi> (index xs x)
[PROOF STEP]
using assms permutes_in_image[OF *]
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<length xs}
distinct xs
x \<in> set xs
\<pi> permutes {..<length xs}
distinct xs
x \<in> set xs
(inv \<pi> ?x \<in> {..<length xs}) = (?x \<in> {..<length xs})

goal (1 subgoal):
 1. index (permute_list \<pi> xs) x = inv \<pi> (index xs x)
[PROOF STEP]
by (intro index_distinct_eqI) (simp_all add: permute_list_nth permutes_inverses)
[PROOF STATE]
proof (state)
this:
index (permute_list \<pi> xs) x = inv \<pi> (index xs x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uminus_all[simp]: "ccw (-a) (-b) (-c) \<longleftrightarrow> ccw a b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
have "ccw (-a) (-b) (-c) \<longleftrightarrow> ccw 0 (- (b - a)) (- (c - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw (0::'a) (- (b - a)) (- (c - a))
[PROOF STEP]
using translate_plus[of "-a" a "-b" "-c"]
[PROOF STATE]
proof (prove)
using this:
ccw (- a + a) (- b + a) (- c + a) = ccw (- a) (- b) (- c)

goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw (0::'a) (- (b - a)) (- (c - a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ccw (- a) (- b) (- c) = ccw (0::'a) (- (b - a)) (- (c - a))

goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccw (- a) (- b) (- c) = ccw (0::'a) (- (b - a)) (- (c - a))

goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ccw 0 (b - a) (c - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw (0::'a) (- (b - a)) (- (c - a)) = ccw (0::'a) (b - a) (c - a)
[PROOF STEP]
by (simp del: minus_diff_eq)
[PROOF STATE]
proof (state)
this:
ccw (0::'a) (- (b - a)) (- (c - a)) = ccw (0::'a) (b - a) (c - a)

goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccw (0::'a) (- (b - a)) (- (c - a)) = ccw (0::'a) (b - a) (c - a)

goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ccw a b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw (0::'a) (b - a) (c - a) = ccw a b c
[PROOF STEP]
using translate_plus[of a "-a" b c]
[PROOF STATE]
proof (prove)
using this:
ccw (a + - a) (b + - a) (c + - a) = ccw a b c

goal (1 subgoal):
 1. ccw (0::'a) (b - a) (c - a) = ccw a b c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ccw (0::'a) (b - a) (c - a) = ccw a b c

goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ccw (- a) (- b) (- c) = ccw a b c

goal (1 subgoal):
 1. ccw (- a) (- b) (- c) = ccw a b c
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ccw (- a) (- b) (- c) = ccw a b c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_partitionI:
  assumes "disjoint S"
  assumes "\<Union> S = A"
  shows "S partitions A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S partitions A
[PROOF STEP]
using assms is_partition_def
[PROOF STATE]
proof (prove)
using this:
disjoint S
\<Union> S = A
?S partitions ?A = (disjoint ?S \<and> \<Union> ?S = ?A)

goal (1 subgoal):
 1. S partitions A
[PROOF STEP]
by blast


[STATEMENT]
lemma sin_zero_iff_int2: "sin x = 0 \<longleftrightarrow> (\<exists>i::int. x = of_int i * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
have "sin x = 0 \<longleftrightarrow> (\<exists>i. even i \<and> x = real_of_int i * (pi / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. even i \<and> x = real_of_int i * (pi / 2))
[PROOF STEP]
by (auto simp: sin_zero_iff_int)
[PROOF STATE]
proof (state)
this:
(sin x = 0) = (\<exists>i. even i \<and> x = real_of_int i * (pi / 2))

goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(sin x = 0) = (\<exists>i. even i \<and> x = real_of_int i * (pi / 2))

goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
have "... = (\<exists>j. x = real_of_int (2*j) * (pi / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>i. even i \<and> x = real_of_int i * (pi / 2)) = (\<exists>j. x = real_of_int (2 * j) * (pi / 2))
[PROOF STEP]
using dvd_triv_left
[PROOF STATE]
proof (prove)
using this:
?a dvd ?a * ?b

goal (1 subgoal):
 1. (\<exists>i. even i \<and> x = real_of_int i * (pi / 2)) = (\<exists>j. x = real_of_int (2 * j) * (pi / 2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<exists>i. even i \<and> x = real_of_int i * (pi / 2)) = (\<exists>j. x = real_of_int (2 * j) * (pi / 2))

goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>i. even i \<and> x = real_of_int i * (pi / 2)) = (\<exists>j. x = real_of_int (2 * j) * (pi / 2))

goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
have "... = (\<exists>i::int. x = of_int i * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>j. x = real_of_int (2 * j) * (pi / 2)) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>j. x = real_of_int (2 * j) * (pi / 2)) = (\<exists>i. x = real_of_int i * pi)

goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sin x = 0) = (\<exists>i. x = real_of_int i * pi)

goal (1 subgoal):
 1. (sin x = 0) = (\<exists>i. x = real_of_int i * pi)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(sin x = 0) = (\<exists>i. x = real_of_int i * pi)

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 map_eq_all_nth_conv:
  "map f xs = ys \<longleftrightarrow> length xs = length ys \<and> (\<forall>n < length xs. f (xs ! n) = ys ! n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f xs = ys) = (length xs = length ys \<and> (\<forall>n<length xs. f (xs ! n) = ys ! n))
[PROOF STEP]
apply(induct xs arbitrary: ys)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys. (map f [] = ys) = (length [] = length ys \<and> (\<forall>n<length []. f ([] ! n) = ys ! n))
 2. \<And>a xs ys. (\<And>ys. (map f xs = ys) = (length xs = length ys \<and> (\<forall>n<length xs. f (xs ! n) = ys ! n))) \<Longrightarrow> (map f (a # xs) = ys) = (length (a # xs) = length ys \<and> (\<forall>n<length (a # xs). f ((a # xs) ! n) = ys ! n))
[PROOF STEP]
apply(fastforce simp add: nth_Cons Suc_length_conv split: nat.splits)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma geq_imp_mix_geq_left:
  assumes "x \<succeq>[\<R>] y"
  assumes rpr: "rational_preference (lotteries_on outcomes) \<R>"
  assumes ind: "independent_vnm (lotteries_on outcomes) \<R>"
  assumes "\<alpha> \<in> {0..(1::real)}"
  shows "(mix_pmf \<alpha> y x) \<succeq>[\<R>] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
define \<beta> where
    b: "\<beta> = 1 - \<alpha>"
[PROOF STATE]
proof (state)
this:
\<beta> = 1 - \<alpha>

goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
have "\<beta> \<in> {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<beta> \<in> {0..1}
[PROOF STEP]
using assms(4) b
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> {0..1}
\<beta> = 1 - \<alpha>

goal (1 subgoal):
 1. \<beta> \<in> {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<beta> \<in> {0..1}

goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<beta> \<in> {0..1}
[PROOF STEP]
have "mix_pmf \<beta> x y \<succeq>[\<R>] y"
[PROOF STATE]
proof (prove)
using this:
\<beta> \<in> {0..1}

goal (1 subgoal):
 1. mix_pmf \<beta> x y \<succeq>[\<R>] y
[PROOF STEP]
using geq_imp_mix_geq_right[OF assms] assms(1) geq_imp_mix_geq_right ind rpr
[PROOF STATE]
proof (prove)
using this:
\<beta> \<in> {0..1}
mix_pmf \<alpha> x y \<succeq>[\<R>] y
x \<succeq>[\<R>] y
\<lbrakk>?x \<succeq>[?\<R>] ?y; rational_preference (lotteries_on ?outcomes) ?\<R>; independent_vnm (lotteries_on ?outcomes) ?\<R>; ?\<alpha> \<in> {0..1}\<rbrakk> \<Longrightarrow> mix_pmf ?\<alpha> ?x ?y \<succeq>[?\<R>] ?y
independent_vnm (lotteries_on outcomes) \<R>
rational_preference (lotteries_on outcomes) \<R>

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

goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mix_pmf \<beta> x y \<succeq>[\<R>] y

goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
have "mix_pmf \<beta> x y = mix_pmf \<alpha> y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mix_pmf \<beta> x y = mix_pmf \<alpha> y x
[PROOF STEP]
by (metis assms(4) b pmf_inverse_switch_eqals)
[PROOF STATE]
proof (state)
this:
mix_pmf \<beta> x y = mix_pmf \<alpha> y x

goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mix_pmf \<beta> x y \<succeq>[\<R>] y
mix_pmf \<beta> x y = mix_pmf \<alpha> y x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mix_pmf \<beta> x y \<succeq>[\<R>] y
mix_pmf \<beta> x y = mix_pmf \<alpha> y x

goal (1 subgoal):
 1. mix_pmf \<alpha> y x \<succeq>[\<R>] y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mix_pmf \<alpha> y x \<succeq>[\<R>] y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ind_eq_0_iff: "ind P n = 0 \<longleftrightarrow> n = 0 \<or> \<not>P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ind P n = (0::'a)) = (n = 0 \<or> \<not> P n)
[PROOF STEP]
by (simp add: ind_def)


[STATEMENT]
lemma cartesian_product_binary_intersection_right:
  assumes "C \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "D \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "A \<subseteq> carrier (R\<^bsup>m\<^esup>)"
  shows "cartesian_product A (C \<inter> D) = (cartesian_product A C) \<inter> (cartesian_product A D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A (C \<inter> D) = cartesian_product A C \<inter> cartesian_product A D
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cartesian_product A (C \<inter> D) \<subseteq> cartesian_product A C \<inter> cartesian_product A D
 2. cartesian_product A C \<inter> cartesian_product A D \<subseteq> cartesian_product A (C \<inter> D)
[PROOF STEP]
show "cartesian_product A (C \<inter> D) \<subseteq> cartesian_product A C \<inter> cartesian_product A D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A (C \<inter> D) \<subseteq> cartesian_product A C \<inter> cartesian_product A D
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. \<exists>as\<in>A. \<exists>bs\<in>C \<inter> D. xs = as @ bs} \<subseteq> {xs. \<exists>as\<in>A. \<exists>bs\<in>C. xs = as @ bs} \<inter> {xs. \<exists>as\<in>A. \<exists>bs\<in>D. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product A (C \<inter> D) \<subseteq> cartesian_product A C \<inter> cartesian_product A D

goal (1 subgoal):
 1. cartesian_product A C \<inter> cartesian_product A D \<subseteq> cartesian_product A (C \<inter> D)
[PROOF STEP]
show "cartesian_product A C \<inter> cartesian_product A D \<subseteq> cartesian_product A (C \<inter> D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A C \<inter> cartesian_product A D \<subseteq> cartesian_product A (C \<inter> D)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A C \<inter> cartesian_product A D \<Longrightarrow> x \<in> cartesian_product A (C \<inter> D)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A C \<inter> cartesian_product A D \<Longrightarrow> x \<in> cartesian_product A (C \<inter> D)
[PROOF STEP]
assume A: "x \<in> cartesian_product A C \<inter> cartesian_product A D"
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product A C \<inter> cartesian_product A D

goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A C \<inter> cartesian_product A D \<Longrightarrow> x \<in> cartesian_product A (C \<inter> D)
[PROOF STEP]
show "x \<in> cartesian_product A (C \<inter> D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> cartesian_product A (C \<inter> D)
[PROOF STEP]
apply(rule cartesian_product_memI[of A R m _ n  ])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. A \<subseteq> carrier (R\<^bsup>m\<^esup>)
 2. C \<inter> D \<subseteq> carrier (R\<^bsup>n\<^esup>)
 3. take m x \<in> A
 4. drop m x \<in> C \<inter> D
[PROOF STEP]
apply (simp add: assms(3))
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. C \<inter> D \<subseteq> carrier (R\<^bsup>n\<^esup>)
 2. take m x \<in> A
 3. drop m x \<in> C \<inter> D
[PROOF STEP]
apply (simp add: assms(1) inf.coboundedI1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. take m x \<in> A
 2. drop m x \<in> C \<inter> D
[PROOF STEP]
apply (meson A IntD1 assms(3) cartesian_product_memE(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop m x \<in> C \<inter> D
[PROOF STEP]
by (meson A Int_iff assms(3) cartesian_product_memE(2))
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product A (C \<inter> D)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cartesian_product A C \<inter> cartesian_product A D \<subseteq> cartesian_product A (C \<inter> D)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem rank_eq_dim_image:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  shows "rank A = vec.dim (range (\<lambda>x. A *v x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = vec.dim (range ((*v) A))
[PROOF STEP]
unfolding rank_col_rank col_rank_def col_space_eq'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (range ((*v) A)) = vec.dim (range ((*v) A))
[PROOF STEP]
..


[STATEMENT]
lemma lepoll_cardinal_le: "\<lbrakk>elts A \<lesssim> elts i; Ord i\<rbrakk> \<Longrightarrow> vcard A \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>elts A \<lesssim> elts i; Ord i\<rbrakk> \<Longrightarrow> vcard A \<le> i
[PROOF STEP]
by (metis Ord_Least Ord_linear2 dual_order.trans eqpoll_refl lepoll_imp_Card_le not_less_Ord_Least vcard_def)


[STATEMENT]
lemma dim_col_take_cols:
  assumes "\<And>j. j \<in> set inds \<Longrightarrow> j < dim_col A"
  shows "dim_col (take_cols A inds) = length inds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (take_cols A inds) = length inds
[PROOF STEP]
unfolding take_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (mat_of_cols (dim_row A) (map ((!) (cols A)) (filter (\<lambda>y. y < dim_col A) inds))) = length inds
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?j \<in> set inds \<Longrightarrow> ?j < dim_col A

goal (1 subgoal):
 1. dim_col (mat_of_cols (dim_row A) (map ((!) (cols A)) (filter (\<lambda>y. y < dim_col A) inds))) = length inds
[PROOF STEP]
by auto


[STATEMENT]
lemma plus_gt_both_mono: "x \<succ> y \<Longrightarrow> a \<succ> b \<Longrightarrow> x + a \<succ> y + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<succ> y; a \<succ> b\<rbrakk> \<Longrightarrow> x + a \<succ> y + b
[PROOF STEP]
by (rule gt_trans[OF plus_gt_left_mono plus_gt_right_mono])


[STATEMENT]
lemma cong_imp_coprime:
  "[a = b] (mod m) \<Longrightarrow> coprime a m \<Longrightarrow> coprime b m"
  for a b :: "'a :: {unique_euclidean_semiring, euclidean_semiring_gcd}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[a = b] (mod m); coprime a m\<rbrakk> \<Longrightarrow> coprime b m
[PROOF STEP]
by (auto simp add: coprime_iff_gcd_eq_1 dest: cong_gcd_eq)


[STATEMENT]
lemma mat_ge_trans: assumes "A \<ge>\<^sub>m B" "B \<ge>\<^sub>m C"
  and "A \<in> carrier_mat nr nc" "B \<in> carrier_mat nr nc"
shows "A \<ge>\<^sub>m C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<ge>\<^sub>m C
[PROOF STEP]
using assms ge_trans[of "B $$ (i,j)" "A $$ (i,j)" for i j]
[PROOF STATE]
proof (prove)
using this:
A \<ge>\<^sub>m B
B \<ge>\<^sub>m C
A \<in> carrier_mat nr nc
B \<in> carrier_mat nr nc
\<lbrakk>B $$ (?i3, ?j3) \<le> A $$ (?i3, ?j3); ?z \<le> B $$ (?i3, ?j3)\<rbrakk> \<Longrightarrow> ?z \<le> A $$ (?i3, ?j3)

goal (1 subgoal):
 1. A \<ge>\<^sub>m C
[PROOF STEP]
unfolding mat_ge_def carrier_mat_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i<dim_row A. \<forall>j<dim_col A. B $$ (i, j) \<le> A $$ (i, j)
\<forall>i<dim_row B. \<forall>j<dim_col B. C $$ (i, j) \<le> B $$ (i, j)
A \<in> {m. dim_row m = nr \<and> dim_col m = nc}
B \<in> {m. dim_row m = nr \<and> dim_col m = nc}
\<lbrakk>B $$ (?i3, ?j3) \<le> A $$ (?i3, ?j3); ?z \<le> B $$ (?i3, ?j3)\<rbrakk> \<Longrightarrow> ?z \<le> A $$ (?i3, ?j3)

goal (1 subgoal):
 1. \<forall>i<dim_row A. \<forall>j<dim_col A. C $$ (i, j) \<le> A $$ (i, j)
[PROOF STEP]
by auto


[STATEMENT]
lemma deg_pm_single: "deg_pm (Poly_Mapping.single x k) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
have "keys (Poly_Mapping.single x k) \<subseteq> {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (Poly_Mapping.single x k) \<subseteq> {x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
keys (Poly_Mapping.single x k) \<subseteq> {x}

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
keys (Poly_Mapping.single x k) \<subseteq> {x}

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
have "finite {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {x}

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
keys (Poly_Mapping.single x k) \<subseteq> {x}
finite {x}
[PROOF STEP]
have "deg_pm (Poly_Mapping.single x k) = (\<Sum>y\<in>{x}. lookup (Poly_Mapping.single x k) y)"
[PROOF STATE]
proof (prove)
using this:
keys (Poly_Mapping.single x k) \<subseteq> {x}
finite {x}

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = sum (lookup (Poly_Mapping.single x k)) {x}
[PROOF STEP]
by (rule deg_pm_superset)
[PROOF STATE]
proof (state)
this:
deg_pm (Poly_Mapping.single x k) = sum (lookup (Poly_Mapping.single x k)) {x}

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deg_pm (Poly_Mapping.single x k) = sum (lookup (Poly_Mapping.single x k)) {x}

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
have "... = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (lookup (Poly_Mapping.single x k)) {x} = k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum (lookup (Poly_Mapping.single x k)) {x} = k

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deg_pm (Poly_Mapping.single x k) = k

goal (1 subgoal):
 1. deg_pm (Poly_Mapping.single x k) = k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
deg_pm (Poly_Mapping.single x k) = k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ang_vec_a_scale:
  assumes "k1 \<noteq> 0" and "k2 \<noteq> 0"
  shows "\<angle>a (cor k1 * z1) (cor k2 * z2) = \<angle>a z1 z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<angle>a (cor k1 * z1) (cor k2 * z2) = \<angle>a z1 z2
[PROOF STEP]
using ang_vec_a_scale1[OF assms(1)] ang_vec_a_scale2[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<angle>a (cor k1 * ?z1.0) ?z2.0 = \<angle>a ?z1.0 ?z2.0
\<angle>a ?z1.0 (cor k2 * ?z2.0) = \<angle>a ?z1.0 ?z2.0

goal (1 subgoal):
 1. \<angle>a (cor k1 * z1) (cor k2 * z2) = \<angle>a z1 z2
[PROOF STEP]
by auto


[STATEMENT]
lemma proots_sphere_axis_eq:
  defines "q1\<equiv>[:\<i>,-1:]" and "q2\<equiv>[:\<i>,1:]"
  assumes "p\<noteq>0"
  shows "proots_count p (sphere 0 1 - {- 1}) = proots_count (fcompose p q1 q2) {x. 0 = Im x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p (sphere 0 1 - {- 1}) = proots_count (fcompose p q1 q2) {x. 0 = Im x}
[PROOF STEP]
unfolding q1_def q2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p (sphere 0 1 - {- 1}) = proots_count (fcompose p [:\<i>, - 1:] [:\<i>, 1:]) {x. 0 = Im x}
[PROOF STEP]
proof (rule proots_fcompose_bij_eq[OF _ \<open>p\<noteq>0\<close>])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. bij_betw (\<lambda>x. poly [:\<i>, - 1:] x / poly [:\<i>, 1:] x) {x. 0 = Im x} (sphere 0 1 - {- 1})
 2. \<forall>x\<in>{x. 0 = Im x}. poly [:\<i>, 1:] x \<noteq> 0
 3. max (degree [:\<i>, - 1:]) (degree [:\<i>, 1:]) \<le> 1
 4. \<forall>c. [:\<i>, - 1:] \<noteq> smult c [:\<i>, 1:]
 5. infinite UNIV
[PROOF STEP]
show "\<forall>x\<in>{x. 0 = Im x}. poly [:\<i>, 1:] x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{x. 0 = Im x}. poly [:\<i>, 1:] x \<noteq> 0
[PROOF STEP]
by (simp add: Complex_eq_0 plus_complex.code)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{x. 0 = Im x}. poly [:\<i>, 1:] x \<noteq> 0

goal (4 subgoals):
 1. bij_betw (\<lambda>x. poly [:\<i>, - 1:] x / poly [:\<i>, 1:] x) {x. 0 = Im x} (sphere 0 1 - {- 1})
 2. max (degree [:\<i>, - 1:]) (degree [:\<i>, 1:]) \<le> 1
 3. \<forall>c. [:\<i>, - 1:] \<noteq> smult c [:\<i>, 1:]
 4. infinite UNIV
[PROOF STEP]
show "infinite (UNIV::complex set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
by (simp add: infinite_UNIV_char_0)
[PROOF STATE]
proof (state)
this:
infinite UNIV

goal (3 subgoals):
 1. bij_betw (\<lambda>x. poly [:\<i>, - 1:] x / poly [:\<i>, 1:] x) {x. 0 = Im x} (sphere 0 1 - {- 1})
 2. max (degree [:\<i>, - 1:]) (degree [:\<i>, 1:]) \<le> 1
 3. \<forall>c. [:\<i>, - 1:] \<noteq> smult c [:\<i>, 1:]
[PROOF STEP]
qed (use bij_betw_axis_sphere in auto)


[STATEMENT]
lemma one_le_floor [simp]: "1 \<le> \<lfloor>x\<rfloor> \<longleftrightarrow> 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> \<lfloor>x\<rfloor>) = ((1::'a) \<le> x)
[PROOF STEP]
by (simp add: le_floor_iff)


[STATEMENT]
lemma spair_sigs_alt_spp: "spair_sigs p q = spair_sigs_spp (spp_of p) (spp_of q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spair_sigs p q = spair_sigs_spp (spp_of p) (spp_of q)
[PROOF STEP]
by (simp add: spair_sigs_def spair_sigs_spp_def Let_def fst_spp_of snd_spp_of)


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


[STATEMENT]
lemma prime_sum_div:
  assumes "prime n"
  shows " Esigma n = n +(1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma n = n + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Esigma n = n + 1
[PROOF STEP]
have "1 \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> n
[PROOF STEP]
using assms prime_ge_1_nat
[PROOF STATE]
proof (prove)
using this:
prime n
prime ?p \<Longrightarrow> 1 \<le> ?p

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

goal (1 subgoal):
 1. Esigma n = n + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. Esigma n = n + 1
[PROOF STEP]
using Esigma_properdiv_set assms div_set_prime
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
1 \<le> ?m \<Longrightarrow> Esigma ?m = aliquot_sum ?m + ?m
prime n
prime ?n \<Longrightarrow> properdiv_set ?n = {1}

goal (1 subgoal):
 1. Esigma n = n + 1
[PROOF STEP]
by (simp add: Esigma_properdiv_set aliquot_sum_def assms div_set_prime)
[PROOF STATE]
proof (state)
this:
Esigma n = n + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_cpoly_of_real:
    "poly (cpoly_of pR pI) (of_real x) = Complex (poly pR x) (poly pI x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (cpoly_of pR pI) (complex_of_real x) = Complex (poly pR x) (poly pI x)
[PROOF STEP]
unfolding cpoly_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (map_poly complex_of_real pR + smult \<i> (map_poly complex_of_real pI)) (complex_of_real x) = Complex (poly pR x) (poly pI x)
[PROOF STEP]
by (simp add: Complex_eq)


[STATEMENT]
lemma rel_predD: "\<lbrakk> rel_pred R A B; R x y \<rbrakk> \<Longrightarrow> x \<in> A \<longleftrightarrow> y \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rel_pred R A B; R x y\<rbrakk> \<Longrightarrow> (x \<in> A) = (y \<in> B)
[PROOF STEP]
by(simp add: rel_pred_def rel_fun_def)


[STATEMENT]
lemma finite_linorder_eq_INF_conv: "finite S
  \<Longrightarrow> a = (INF x \<in> S. f x) \<longleftrightarrow> (if S={} then a=top else \<exists>x\<in>S. a=f x \<and> (\<forall>y\<in>S. a \<le> f y))"
  for a :: "_::{complete_lattice,linorder}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> (a = Inf (f ` S)) = (if S = {} then a = top else \<exists>x\<in>S. a = f x \<and> (\<forall>y\<in>S. a \<le> f y))
[PROOF STEP]
by (auto
    simp: INF_greatest INF_lower
    intro: finite_inf_linorder_ne_ex antisym)


[STATEMENT]
theorem gt_trans: "u >\<^sub>t t \<Longrightarrow> t >\<^sub>t s \<Longrightarrow> u >\<^sub>t s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u >\<^sub>t t; t >\<^sub>t s\<rbrakk> \<Longrightarrow> u >\<^sub>t s
[PROOF STEP]
unfolding basic_gt_iff_gt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.kbo_std.gt u t; local.kbo_std.gt t s\<rbrakk> \<Longrightarrow> local.kbo_std.gt u s
[PROOF STEP]
by (rule kbo_std.gt_trans[simplified])


[STATEMENT]
lemma mod_sub_if_z:
  "\<lbrakk>x < z; y < z; 0 \<le> y; 0 \<le> x; 0 \<le> z\<rbrakk> \<Longrightarrow>
    (x - y) mod z = (if y \<le> x then x - y else x - y + z)"
  for x y z :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < z; y < z; 0 \<le> y; 0 \<le> x; 0 \<le> z\<rbrakk> \<Longrightarrow> (x - y) mod z = (if y \<le> x then x - y else x - y + z)
[PROOF STEP]
using mod_pos_pos_trivial [of "x - y + z" z]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> x - y + z; x - y + z < z\<rbrakk> \<Longrightarrow> (x - y + z) mod z = x - y + z

goal (1 subgoal):
 1. \<lbrakk>x < z; y < z; 0 \<le> y; 0 \<le> x; 0 \<le> z\<rbrakk> \<Longrightarrow> (x - y) mod z = (if y \<le> x then x - y else x - y + z)
[PROOF STEP]
by (auto simp add: not_le)


[STATEMENT]
lemma interval_bij_bij_cart: fixes x::"real^'n" assumes "\<forall>i. a$i < b$i \<and> u$i < v$i"
  shows "interval_bij (a,b) (u,v) (interval_bij (u,v) (a,b) x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_bij (a, b) (u, v) (interval_bij (u, v) (a, b) x) = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i. a $ i < b $ i \<and> u $ i < v $ i

goal (1 subgoal):
 1. interval_bij (a, b) (u, v) (interval_bij (u, v) (a, b) x) = x
[PROOF STEP]
by (intro interval_bij_bij) (auto simp: Basis_vec_def inner_axis)


[STATEMENT]
lemma nrows_transpose[simp]: "nrows (transpose_matrix A) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows (transpose_matrix A) = ncols A
[PROOF STEP]
by (simp add: nrows_def ncols_def nonzero_positions_def transpose_matrix_def image_def)


[STATEMENT]
lemma degree_0 [simp]: "degree 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree 0 = 0
[PROOF STEP]
by (rule order_antisym [OF degree_le le0]) simp


[STATEMENT]
lemma is_interval_path_connected: "is_interval S \<Longrightarrow> path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interval S \<Longrightarrow> path_connected S
[PROOF STEP]
by (simp add: convex_imp_path_connected is_interval_convex)


[STATEMENT]
lemma of_nat_eq: "of_nat k = Abs (int k mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat k = Abs (int k mod n)
[PROOF STEP]
apply (induct k)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. of_nat 0 = Abs (int 0 mod n)
 2. \<And>k. of_nat k = Abs (int k mod n) \<Longrightarrow> of_nat (Suc k) = Abs (int (Suc k) mod n)
[PROOF STEP]
apply (simp add: zero_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. of_nat k = Abs (int k mod n) \<Longrightarrow> of_nat (Suc k) = Abs (int (Suc k) mod n)
[PROOF STEP]
apply (simp add: Rep_simps add_def one_def mod_simps ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma complex_cnj_one_iff [simp]: "cnj z = 1 \<longleftrightarrow> z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cnj z = 1) = (z = 1)
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma singular_face_simplex_map:
   "\<lbrakk>1 \<le> p; k \<le> p\<rbrakk>
        \<Longrightarrow> singular_face p k (simplex_map p f c) = simplex_map (p - Suc 0) f (c \<circ> simplical_face k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> p; k \<le> p\<rbrakk> \<Longrightarrow> singular_face p k (simplex_map p f c) = simplex_map (p - Suc 0) f (c \<circ> simplical_face k)
[PROOF STEP]
unfolding simplex_map_def singular_face_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> p; k \<le> p\<rbrakk> \<Longrightarrow> restrict (restrict (f \<circ> c) (standard_simplex p) \<circ> simplical_face k) (standard_simplex (p - Suc 0)) = restrict (f \<circ> (c \<circ> simplical_face k)) (standard_simplex (p - Suc 0))
[PROOF STEP]
by (force simp: simplical_face_in_standard_simplex)


[STATEMENT]
theorem meet_mimimum: "x \<sqinter> y = minimum x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y = minimum x y
[PROOF STEP]
by (rule meet_equality) (rule is_inf_minimum)