[STATEMENT]
theorem Sleator_Tarjan: "T_mtf n \<le> (\<Sum>i<n. 2*c_A i + p_A i - f_A i) - n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
have "(\<Sum>i<n. t_mtf i) \<le> (\<Sum>i<n. 2*c_A i - 1 + p_A i - f_A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum t_mtf {..<n} \<le> (\<Sum>i<n. 2 * c_A i - 1 + p_A i - f_A i)
[PROOF STEP]
by(rule potential[where p=Phi,OF phi0 phi_pos mtf_ub])
[PROOF STATE]
proof (state)
this:
sum t_mtf {..<n} \<le> (\<Sum>i<n. 2 * c_A i - 1 + p_A i - f_A i)

goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum t_mtf {..<n} \<le> (\<Sum>i<n. 2 * c_A i - 1 + p_A i - f_A i)

goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
have "\<dots> = (\<Sum>i<n. (2*c_A i + p_A i - f_A i) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. 2 * c_A i - 1 + p_A i - f_A i) = (\<Sum>i<n. 2 * c_A i + p_A i - f_A i - 1)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. 2 * c_A i - 1 + p_A i - f_A i) = (\<Sum>i<n. 2 * c_A i + p_A i - f_A i - 1)

goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. 2 * c_A i - 1 + p_A i - f_A i) = (\<Sum>i<n. 2 * c_A i + p_A i - f_A i - 1)

goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
have "\<dots> = (\<Sum>i<n. 2*c_A i + p_A i - f_A i) - n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. 2 * c_A i + p_A i - f_A i - 1) = (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
by(simp add: sumr_diff_mult_const2[symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. 2 * c_A i + p_A i - f_A i - 1) = (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n

goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum t_mtf {..<n} \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum t_mtf {..<n} \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n

goal (1 subgoal):
 1. T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n
[PROOF STEP]
by(simp add: T_mtf_def)
[PROOF STATE]
proof (state)
this:
T_mtf n \<le> (\<Sum>i<n. 2 * c_A i + p_A i - f_A i) - int n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trace_adjoint_element_ineq:
  fixes A :: "complex mat"
  assumes rindex: "i \<in> {0 ..< dim_row A}"
     and  cindex: "j \<in> {0 ..< dim_col A}"
  shows "(norm(A $$ (i,j)))\<^sup>2 \<le> trace (A * adjoint A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real ((cmod (A $$ (i, j)))\<^sup>2) \<le> trace (A * adjoint A)
[PROOF STEP]
proof (simp add: trace_adjoint_eq_u less_eq_complex_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
have ineqi: "(cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2)
[PROOF STEP]
using cindex member_le_sum[of j " {0 ..< dim_col A}" "\<lambda> x. (cmod (A $$ (i, x)))\<^sup>2"]
[PROOF STATE]
proof (prove)
using this:
j \<in> {0..<dim_col A}
\<lbrakk>j \<in> {0..<dim_col A}; \<And>x. x \<in> {0..<dim_col A} - {j} \<Longrightarrow> 0 \<le> (cmod (A $$ (i, x)))\<^sup>2; finite {0..<dim_col A}\<rbrakk> \<Longrightarrow> (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_col A. (cmod (A $$ (i, x)))\<^sup>2)

goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2)

goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2)

goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
have ineqj: "\<dots> \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2) \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
using rindex member_le_sum[of i " {0 ..< dim_row A}" "\<lambda> x. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2"]
[PROOF STATE]
proof (prove)
using this:
i \<in> {0..<dim_row A}
\<lbrakk>i \<in> {0..<dim_row A}; \<And>x. x \<in> {0..<dim_row A} - {i} \<Longrightarrow> 0 \<le> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2); finite {0..<dim_row A}\<rbrakk> \<Longrightarrow> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2) \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)

goal (1 subgoal):
 1. (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2) \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
by (simp add: sum_nonneg)
[PROOF STATE]
proof (state)
this:
(\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2) \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)

goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2) \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
show "(cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2) \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)

goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
using ineqi
[PROOF STATE]
proof (prove)
using this:
(\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2) \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
(cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>xa = 0..<dim_col A. (cmod (A $$ (i, xa)))\<^sup>2)

goal (1 subgoal):
 1. (cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(cmod (A $$ (i, j)))\<^sup>2 \<le> (\<Sum>x = 0..<dim_row A. \<Sum>xa = 0..<dim_col A. (cmod (A $$ (x, xa)))\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p1mod22k': "(1 + 2 * b) mod (2 * 2 ^ n) = 1 + 2 * (b mod 2 ^ n)"
  for b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + 2 * b) mod (2 * 2 ^ n) = 1 + 2 * (b mod 2 ^ n)
[PROOF STEP]
by (rule pos_zmod_mult_2) simp


[STATEMENT]
lemma poly_eval_plus: "poly_eval a (p + q) = poly_eval a p + poly_eval a q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_eval a (p + q) = poly_eval a p + poly_eval a q
[PROOF STEP]
by (simp only: poly_eval_def poly_subst_plus lookup_add)


[STATEMENT]
lemma sum_split: "(r1::nat) < r2 \<Longrightarrow> (\<Sum>l = 0..<r1. ((f l)::(('a::prime_card) mod_ring)))
                                         +(\<Sum>l = r1..<r2. f l) = (\<Sum>l = 0..<r2. f l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r1 < r2 \<Longrightarrow> sum f {0..<r1} + sum f {r1..<r2} = sum f {0..<r2}
[PROOF STEP]
by (meson less_or_eq_imp_le sum.atLeastLessThan_concat zero_le)


[STATEMENT]
theorem summatory_divisor_count_asymptotics':
  "(\<lambda>x. sum_upto (\<lambda>n. real (divisor_count n)) x) =o
     (\<lambda>x. x * ln x + (2 * euler_mascheroni - 1) * x) +o O(\<lambda>x. sqrt x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. real (divisor_count n)) \<in> (\<lambda>x. x * ln x + (2 * euler_mascheroni - 1) * x) +o O(sqrt)
[PROOF STEP]
using summatory_divisor_count_asymptotics
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. sum_upto (\<lambda>n. real (divisor_count n)) x - (x * ln x + (2 * euler_mascheroni - 1) * x)) \<in> O(sqrt)

goal (1 subgoal):
 1. sum_upto (\<lambda>n. real (divisor_count n)) \<in> (\<lambda>x. x * ln x + (2 * euler_mascheroni - 1) * x) +o O(sqrt)
[PROOF STEP]
by (subst set_minus_plus [symmetric]) (simp_all add: fun_diff_def)


[STATEMENT]
lemma quasinorm_sum_zerospace:
  "{f + g |f g. f \<in> zero_space\<^sub>N N1 \<and> g \<in> zero_space\<^sub>N N2} \<subseteq> zero_space\<^sub>N (N1 +\<^sub>N N2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f + g |f g. f \<in> zero_space\<^sub>N N1 \<and> g \<in> zero_space\<^sub>N N2} \<subseteq> zero_space\<^sub>N (N1 +\<^sub>N N2)
[PROOF STEP]
proof (auto, unfold zero_spaceN_iff)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>eNorm N1 f = 0; eNorm N2 g = 0\<rbrakk> \<Longrightarrow> eNorm (N1 +\<^sub>N N2) (f + g) = 0
[PROOF STEP]
fix f g
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>eNorm N1 f = 0; eNorm N2 g = 0\<rbrakk> \<Longrightarrow> eNorm (N1 +\<^sub>N N2) (f + g) = 0
[PROOF STEP]
assume H: "eNorm N1 f = 0" "eNorm N2 g = 0"
[PROOF STATE]
proof (state)
this:
eNorm N1 f = 0
eNorm N2 g = 0

goal (1 subgoal):
 1. \<And>f g. \<lbrakk>eNorm N1 f = 0; eNorm N2 g = 0\<rbrakk> \<Longrightarrow> eNorm (N1 +\<^sub>N N2) (f + g) = 0
[PROOF STEP]
have "Inf {eNorm N1 f1 + eNorm N2 f2| f1 f2. f + g = f1 + f2} \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {eNorm N1 f1 + eNorm N2 f2 |f1 f2. f + g = f1 + f2} \<le> 0
[PROOF STEP]
by (rule Inf_lower, auto, rule exI[of _ f], auto simp add: H)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {eNorm N1 f1 + eNorm N2 f2 |f1 f2. f + g = f1 + f2} \<le> 0

goal (1 subgoal):
 1. \<And>f g. \<lbrakk>eNorm N1 f = 0; eNorm N2 g = 0\<rbrakk> \<Longrightarrow> eNorm (N1 +\<^sub>N N2) (f + g) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Sqinter> {eNorm N1 f1 + eNorm N2 f2 |f1 f2. f + g = f1 + f2} \<le> 0
[PROOF STEP]
show "eNorm (N1 +\<^sub>N N2) (f + g) = 0"
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> {eNorm N1 f1 + eNorm N2 f2 |f1 f2. f + g = f1 + f2} \<le> 0

goal (1 subgoal):
 1. eNorm (N1 +\<^sub>N N2) (f + g) = 0
[PROOF STEP]
unfolding quasinorm_sum(1)
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> {eNorm N1 f1 + eNorm N2 f2 |f1 f2. f + g = f1 + f2} \<le> 0

goal (1 subgoal):
 1. \<Sqinter> {eNorm N1 f1 + eNorm N2 f2 |f1 f2. f + g = f1 + f2} = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eNorm (N1 +\<^sub>N N2) (f + g) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_inverse_power_to_inf:
  fixes a :: real and n :: nat
  assumes "n > 1" "a > 0"
  shows   "((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
0 < a
[PROOF STEP]
have "real_of_int (-int n) < -1"
[PROOF STATE]
proof (prove)
using this:
1 < n
0 < a

goal (1 subgoal):
 1. real_of_int (- int n) < - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int (- int n) < - 1

goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
note has_integral_powr_to_inf[OF this \<open>a > 0\<close>]
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr real_of_int (- int n)) has_integral - (a powr (real_of_int (- int n) + 1)) / (real_of_int (- int n) + 1)) {a..}

goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr real_of_int (- int n)) has_integral - (a powr (real_of_int (- int n) + 1)) / (real_of_int (- int n) + 1)) {a..}

goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
have "- (a powr (real_of_int (- int n) + 1)) / (real_of_int (- int n) + 1) =
                 1 / (real (n - 1) * a powr (real (n - 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (a powr (real_of_int (- int n) + 1)) / (real_of_int (- int n) + 1) = 1 / (real (n - 1) * a powr real (n - 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < n
0 < a

goal (1 subgoal):
 1. - (a powr (real_of_int (- int n) + 1)) / (real_of_int (- int n) + 1) = 1 / (real (n - 1) * a powr real (n - 1))
[PROOF STEP]
by (simp add: field_split_simps powr_add [symmetric] of_nat_diff)
[PROOF STATE]
proof (state)
this:
- (a powr (real_of_int (- int n) + 1)) / (real_of_int (- int n) + 1) = 1 / (real (n - 1) * a powr real (n - 1))

goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (a powr (real_of_int (- int n) + 1)) / (real_of_int (- int n) + 1) = 1 / (real (n - 1) * a powr real (n - 1))

goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
0 < a
[PROOF STEP]
have "a powr (real (n - 1)) = a ^ (n - 1)"
[PROOF STATE]
proof (prove)
using this:
1 < n
0 < a

goal (1 subgoal):
 1. a powr real (n - 1) = a ^ (n - 1)
[PROOF STEP]
by (intro powr_realpow)
[PROOF STATE]
proof (state)
this:
a powr real (n - 1) = a ^ (n - 1)

goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. x powr real_of_int (- int n)) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. x powr real_of_int (- int n)) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}

goal (1 subgoal):
 1. ((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}
[PROOF STEP]
by (rule has_integral_eq [rotated])
       (insert assms, simp_all add: powr_minus powr_realpow field_split_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. 1 / x ^ n) has_integral 1 / (real (n - 1) * a ^ (n - 1))) {a..}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma floor_has_real_derivative:
  fixes f :: "real \<Rightarrow> 'a::{floor_ceiling,order_topology}"
  assumes "isCont f x"
    and "f x \<notin> \<int>"
  shows "((\<lambda>x. floor (f x)) has_real_derivative 0) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. real_of_int \<lfloor>f x\<rfloor>) has_real_derivative 0) (at x)
[PROOF STEP]
proof (subst DERIV_cong_ev[OF refl _ refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in nhds x. real_of_int \<lfloor>f x\<rfloor> = ?g x
 2. (?g has_real_derivative 0) (at x)
[PROOF STEP]
show "((\<lambda>_. floor (f x)) has_real_derivative 0) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>xa. real_of_int \<lfloor>f x\<rfloor>) has_real_derivative 0) (at x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>xa. real_of_int \<lfloor>f x\<rfloor>) has_real_derivative 0) (at x)

goal (1 subgoal):
 1. \<forall>\<^sub>F xa in nhds x. real_of_int \<lfloor>f xa\<rfloor> = real_of_int \<lfloor>f x\<rfloor>
[PROOF STEP]
have "\<forall>\<^sub>F y in at x. \<lfloor>f y\<rfloor> = \<lfloor>f x\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. \<lfloor>f y\<rfloor> = \<lfloor>f x\<rfloor>
[PROOF STEP]
by (rule eventually_floor_eq[OF assms[unfolded continuous_at]])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x. \<lfloor>f y\<rfloor> = \<lfloor>f x\<rfloor>

goal (1 subgoal):
 1. \<forall>\<^sub>F xa in nhds x. real_of_int \<lfloor>f xa\<rfloor> = real_of_int \<lfloor>f x\<rfloor>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at x. \<lfloor>f y\<rfloor> = \<lfloor>f x\<rfloor>
[PROOF STEP]
show "\<forall>\<^sub>F y in nhds x. real_of_int \<lfloor>f y\<rfloor> = real_of_int \<lfloor>f x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at x. \<lfloor>f y\<rfloor> = \<lfloor>f x\<rfloor>

goal (1 subgoal):
 1. \<forall>\<^sub>F y in nhds x. real_of_int \<lfloor>f y\<rfloor> = real_of_int \<lfloor>f x\<rfloor>
[PROOF STEP]
unfolding eventually_at_filter
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> UNIV \<longrightarrow> \<lfloor>f xa\<rfloor> = \<lfloor>f x\<rfloor>

goal (1 subgoal):
 1. \<forall>\<^sub>F y in nhds x. real_of_int \<lfloor>f y\<rfloor> = real_of_int \<lfloor>f x\<rfloor>
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in nhds x. real_of_int \<lfloor>f y\<rfloor> = real_of_int \<lfloor>f x\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_cblinfun_code[code]:
  \<comment> \<open>Code equation for computing the range of an operator \<^term>\<open>A\<close>.
      Returns the columns of the matrix representation of \<^term>\<open>A\<close>.\<close>
  fixes A :: "'a::onb_enum \<Rightarrow>\<^sub>C\<^sub>L 'b::onb_enum"
  shows "range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
define dA dB
    where "dA = length (canonical_basis :: 'a list)"
      and "dB = length (canonical_basis :: 'b list)"
[PROOF STATE]
proof (state)
this:
dA = length canonical_basis
dB = length canonical_basis

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
have carrier_A: "mat_of_cblinfun A \<in> carrier_mat dB dA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun A \<in> carrier_mat dB dA
[PROOF STEP]
unfolding mat_of_cblinfun_def dA_def dB_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (length canonical_basis) (length canonical_basis) (\<lambda>(i, j). crepresentation (set canonical_basis) (A *\<^sub>V canonical_basis ! j) (canonical_basis ! i)) \<in> carrier_mat (length canonical_basis) (length canonical_basis)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun A \<in> carrier_mat dB dA

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
have "range_cblinfun_code A = A *\<^sub>S SPAN (unit_vecs dA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range_cblinfun_code A = A *\<^sub>S SPAN (unit_vecs dA)
[PROOF STEP]
unfolding range_cblinfun_code_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>S \<top> = A *\<^sub>S SPAN (unit_vecs dA)
[PROOF STEP]
by (metis dA_def top_ccsubspace_code)
[PROOF STATE]
proof (state)
this:
range_cblinfun_code A = A *\<^sub>S SPAN (unit_vecs dA)

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
range_cblinfun_code A = A *\<^sub>S SPAN (unit_vecs dA)

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
have "\<dots> = SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>S SPAN (unit_vecs dA) = SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA])
[PROOF STEP]
unfolding apply_cblinfun_code dA_def[symmetric] Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPAN (map ((*\<^sub>v) (mat_of_cblinfun A)) (filter (\<lambda>v. dim_vec v = dA) (unit_vecs dA))) = SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA])
[PROOF STEP]
apply (subst filter_True)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>set (unit_vecs dA). dim_vec x = dA
 2. SPAN (map ((*\<^sub>v) (mat_of_cblinfun A)) (unit_vecs dA)) = SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA])
[PROOF STEP]
apply (meson carrier_vecD subset_code(1) unit_vecs_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPAN (map ((*\<^sub>v) (mat_of_cblinfun A)) (unit_vecs dA)) = SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA])
[PROOF STEP]
by (simp add: unit_vecs_def o_def)
[PROOF STATE]
proof (state)
this:
A *\<^sub>S SPAN (unit_vecs dA) = SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA])

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>S SPAN (unit_vecs dA) = SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA])

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
have "\<dots> = SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA]) = SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA])
[PROOF STEP]
apply (subst map_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> mat_of_cblinfun A *\<^sub>v unit_vec dA x = ?g x
 2. SPAN (map ?g [0..<dA]) = SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA]) = SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA])

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
SPAN (map (\<lambda>i. mat_of_cblinfun A *\<^sub>v unit_vec dA i) [0..<dA]) = SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA])

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
have "\<dots> = SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA])
[PROOF STEP]
apply (subst map_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x = ?g x
 2. SPAN (map ?g [0..<dA]) = SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA])
[PROOF STEP]
apply (subst col_mult2[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> mat_of_cblinfun A \<in> carrier_mat (?nr2 x) (?n2 x)
 2. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> 1\<^sub>m dA \<in> carrier_mat (?n2 x) (?nc2 x)
 3. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> x < ?nc2 x
 4. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> col (mat_of_cblinfun A * 1\<^sub>m dA) x = ?g2 x x
 5. SPAN (map (\<lambda>x. ?g2 x x) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA])
[PROOF STEP]
apply (rule carrier_A)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> 1\<^sub>m dA \<in> carrier_mat dA (?nc2 x)
 2. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> x < ?nc2 x
 3. \<And>x. x \<in> set [0..<dA] \<Longrightarrow> col (mat_of_cblinfun A * 1\<^sub>m dA) x = ?g2 x x
 4. SPAN (map (\<lambda>x. ?g2 x x) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA])

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
SPAN (map (\<lambda>x. mat_of_cblinfun A *\<^sub>v col (1\<^sub>m dA) x) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA])

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
have "\<dots> = SPAN (cols (mat_of_cblinfun A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA]) = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
unfolding cols_def dA_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A)) [0..<dim_col (mat_of_cblinfun A)])
[PROOF STEP]
apply (subst right_mult_one_mat[OF carrier_A])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPAN (map (col (mat_of_cblinfun A)) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A)) [0..<dim_col (mat_of_cblinfun A)])
[PROOF STEP]
using carrier_A
[PROOF STATE]
proof (prove)
using this:
mat_of_cblinfun A \<in> carrier_mat dB dA

goal (1 subgoal):
 1. SPAN (map (col (mat_of_cblinfun A)) [0..<dA]) = SPAN (map (col (mat_of_cblinfun A)) [0..<dim_col (mat_of_cblinfun A)])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
SPAN (map (col (mat_of_cblinfun A * 1\<^sub>m dA)) [0..<dA]) = SPAN (cols (mat_of_cblinfun A))

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))

goal (1 subgoal):
 1. range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
range_cblinfun_code A = SPAN (cols (mat_of_cblinfun A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bound_mult_of_nat: "bound (a * of_nat n) \<le> bound a * bound (of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (a * of_nat n) \<le> bound a * bound (of_nat n)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
bound (a * of_nat n) \<le> bound a * bound (of_nat n)

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
have "bound (a * of_nat (Suc n)) = bound (a + a * of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (a * of_nat (Suc n)) = bound (a + a * of_nat n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
bound (a * of_nat (Suc n)) = bound (a + a * of_nat n)

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound (a * of_nat (Suc n)) = bound (a + a * of_nat n)

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
have "... \<le> bound a + bound (a * of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound (a + a * of_nat n) \<le> bound a + bound (a * of_nat n)
[PROOF STEP]
by (rule bound_plus)
[PROOF STATE]
proof (state)
this:
bound (a + a * of_nat n) \<le> bound a + bound (a * of_nat n)

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound (a + a * of_nat n) \<le> bound a + bound (a * of_nat n)

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
have "... \<le> bound a + bound a * bound (of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound a + bound (a * of_nat n) \<le> bound a + bound a * bound (of_nat n)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
bound (a * of_nat n) \<le> bound a * bound (of_nat n)

goal (1 subgoal):
 1. bound a + bound (a * of_nat n) \<le> bound a + bound a * bound (of_nat n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bound a + bound (a * of_nat n) \<le> bound a + bound a * bound (of_nat n)

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound a + bound (a * of_nat n) \<le> bound a + bound a * bound (of_nat n)

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
have "... = bound a * (1 + bound (of_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound a + bound a * bound (of_nat n) = bound a * (1 + bound (of_nat n))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
bound a + bound a * bound (of_nat n) = bound a * (1 + bound (of_nat n))

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound a + bound a * bound (of_nat n) = bound a * (1 + bound (of_nat n))

goal (2 subgoals):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
 2. \<And>n. bound (a * of_nat n) \<le> bound a * bound (of_nat n) \<Longrightarrow> bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
have "... \<le> bound a * (bound (1 + of_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound a * (1 + bound (of_nat n)) \<le> bound a * bound ((1::'a) + of_nat n)
[PROOF STEP]
proof (rule mult_le_mono2)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 + bound (of_nat n) \<le> bound ((1::'a) + of_nat n)
[PROOF STEP]
show "1 + bound(of_nat n) \<le> bound (1 + of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + bound (of_nat n) \<le> bound ((1::'a) + of_nat n)
[PROOF STEP]
using bound_one
[PROOF STATE]
proof (prove)
using this:
1 \<le> bound (1::'a)

goal (1 subgoal):
 1. 1 + bound (of_nat n) \<le> bound ((1::'a) + of_nat n)
[PROOF STEP]
using bound_plus
[PROOF STATE]
proof (prove)
using this:
1 \<le> bound (1::'a)
bound (?a + ?b) \<le> bound ?a + bound ?b

goal (1 subgoal):
 1. 1 + bound (of_nat n) \<le> bound ((1::'a) + of_nat n)
[PROOF STEP]
unfolding bound_plus_of_nat[OF one_ge_zero]
[PROOF STATE]
proof (prove)
using this:
1 \<le> bound (1::'a)
bound (?a + ?b) \<le> bound ?a + bound ?b

goal (1 subgoal):
 1. 1 + bound (of_nat n) \<le> bound (1::'a) + bound (of_nat n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 + bound (of_nat n) \<le> bound ((1::'a) + of_nat n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bound a * (1 + bound (of_nat n)) \<le> bound a * bound ((1::'a) + of_nat n)

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

goal (1 subgoal):
 1. bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bound (a * of_nat (Suc n)) \<le> bound a * bound (of_nat (Suc n))

goal (1 subgoal):
 1. bound (a * of_nat 0) \<le> bound a * bound (of_nat 0)
[PROOF STEP]
qed simp


[STATEMENT]
lemma eventually_at_to_0:
  "eventually P (at a) \<longleftrightarrow> eventually (\<lambda>x. P (x + a)) (at 0)"
  for a ::  "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (at a) = (\<forall>\<^sub>F x in at (0::'a). P (x + a))
[PROOF STEP]
unfolding at_to_0[of a]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (filtermap (\<lambda>x. x + a) (at (0::'a))) = (\<forall>\<^sub>F x in at (0::'a). P (x + a))
[PROOF STEP]
by (simp add: eventually_filtermap)


[STATEMENT]
lemma matrix_sum_mult_left_right:
  fixes A B :: "complex mat"
  assumes dg: "(\<And>k. k < l \<Longrightarrow> g k \<in> carrier_mat m m) "
    and dA: "A \<in> carrier_mat m m" and dB: "B \<in> carrier_mat m m"
  shows "matrix_sum m (\<lambda>k. A * g k * B) l = A * matrix_sum m g l * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum m (\<lambda>k. A * g k * B) l = A * matrix_sum m g l * B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_sum m (\<lambda>k. A * g k * B) l = A * matrix_sum m g l * B
[PROOF STEP]
have eq: "A * matrix_sum m g l = matrix_sum m (\<lambda>k. A * g k) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * matrix_sum m g l = matrix_sum m (\<lambda>k. A * g k) l
[PROOF STEP]
using matrix_sum_distrib_left assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?P \<in> carrier_mat ?d ?d; \<And>k. k < ?n \<Longrightarrow> ?f k \<in> carrier_mat ?d ?d\<rbrakk> \<Longrightarrow> matrix_sum ?d (\<lambda>k. ?P * ?f k) ?n = ?P * matrix_sum ?d ?f ?n
?k2 < l \<Longrightarrow> g ?k2 \<in> carrier_mat m m
A \<in> carrier_mat m m
B \<in> carrier_mat m m

goal (1 subgoal):
 1. A * matrix_sum m g l = matrix_sum m (\<lambda>k. A * g k) l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * matrix_sum m g l = matrix_sum m (\<lambda>k. A * g k) l

goal (1 subgoal):
 1. matrix_sum m (\<lambda>k. A * g k * B) l = A * matrix_sum m g l * B
[PROOF STEP]
have "A * matrix_sum m g l * B = matrix_sum m (\<lambda>k. A * g k * B) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * matrix_sum m g l * B = matrix_sum m (\<lambda>k. A * g k * B) l
[PROOF STEP]
apply (subst eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum m (\<lambda>k. A * g k) l * B = matrix_sum m (\<lambda>k. A * g k * B) l
[PROOF STEP]
using matrix_sum_mult_right[of l "\<lambda>k. A * g k"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k. k < l \<Longrightarrow> A * g k \<in> carrier_mat ?d ?d; ?A \<in> carrier_mat ?d ?d\<rbrakk> \<Longrightarrow> matrix_sum ?d (\<lambda>k. A * g k * ?A) l = matrix_sum ?d (\<lambda>k. A * g k) l * ?A
?k2 < l \<Longrightarrow> g ?k2 \<in> carrier_mat m m
A \<in> carrier_mat m m
B \<in> carrier_mat m m

goal (1 subgoal):
 1. matrix_sum m (\<lambda>k. A * g k) l * B = matrix_sum m (\<lambda>k. A * g k * B) l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * matrix_sum m g l * B = matrix_sum m (\<lambda>k. A * g k * B) l

goal (1 subgoal):
 1. matrix_sum m (\<lambda>k. A * g k * B) l = A * matrix_sum m g l * B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A * matrix_sum m g l * B = matrix_sum m (\<lambda>k. A * g k * B) l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A * matrix_sum m g l * B = matrix_sum m (\<lambda>k. A * g k * B) l

goal (1 subgoal):
 1. matrix_sum m (\<lambda>k. A * g k * B) l = A * matrix_sum m g l * B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum m (\<lambda>k. A * g k * B) l = A * matrix_sum m g l * B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem ln_upper_1: "0<x \<Longrightarrow> ln(x::real) \<le> x - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln x \<le> x - 1
[PROOF STEP]
by (rule ln_le_minus_one)


[STATEMENT]
theorem take_induct[rule_format]: "
  \<lbrakk> P (s \<down> 0);
    \<And>n.  \<lbrakk> Suc n < length s; P (s \<down> n) \<rbrakk> \<Longrightarrow> P ( s \<down> Suc n);
    i < length s\<rbrakk>
  \<Longrightarrow> P (s \<down> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P (s \<down> 0); \<And>n. \<lbrakk>Suc n < length s; P (s \<down> n)\<rbrakk> \<Longrightarrow> P (s \<down> Suc n); i < length s\<rbrakk> \<Longrightarrow> P (s \<down> i)
[PROOF STEP]
by (induct i, simp+)


[STATEMENT]
lemma ivl_integral_has_vderiv_on_subset_segment:
  fixes f :: "real \<Rightarrow> 'a::banach"
  assumes "continuous_on (closed_segment a b) f"
    and "c \<in> closed_segment a b"
  shows "((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
have "(closed_segment c a) \<subseteq> (closed_segment a b)" "(closed_segment c b) \<subseteq> (closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment c a \<subseteq> closed_segment a b &&& closed_segment c b \<subseteq> closed_segment a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on (closed_segment a b) f
c \<in> closed_segment a b

goal (1 subgoal):
 1. closed_segment c a \<subseteq> closed_segment a b &&& closed_segment c b \<subseteq> closed_segment a b
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl split: if_splits)
[PROOF STATE]
proof (state)
this:
closed_segment c a \<subseteq> closed_segment a b
closed_segment c b \<subseteq> closed_segment a b

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed_segment c a \<subseteq> closed_segment a b
closed_segment c b \<subseteq> closed_segment a b
[PROOF STEP]
have "((\<lambda>u. ivl_integral c u f) has_vderiv_on f) ((closed_segment c a) \<union> (closed_segment c b))"
[PROOF STATE]
proof (prove)
using this:
closed_segment c a \<subseteq> closed_segment a b
closed_segment c b \<subseteq> closed_segment a b

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment c a \<union> closed_segment c b)
[PROOF STEP]
by (auto intro!: has_vderiv_on_union_closed ivl_integral_has_vderiv_on assms
      intro: continuous_on_subset)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment c a \<union> closed_segment c b)

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment c a \<union> closed_segment c b)

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
have "(closed_segment c a) \<union> (closed_segment c b) = (closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment c a \<union> closed_segment c b = closed_segment a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on (closed_segment a b) f
c \<in> closed_segment a b

goal (1 subgoal):
 1. closed_segment c a \<union> closed_segment c b = closed_segment a b
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl split: if_splits)
[PROOF STATE]
proof (state)
this:
closed_segment c a \<union> closed_segment c b = closed_segment a b

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>u. ivl_integral c u f) has_vderiv_on f) (closed_segment a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compactin_Union:
   "\<lbrakk>finite \<F>; \<And>S. S \<in> \<F> \<Longrightarrow> compactin X S\<rbrakk> \<Longrightarrow> compactin X (\<Union>\<F>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite \<F>; \<And>S. S \<in> \<F> \<Longrightarrow> compactin X S\<rbrakk> \<Longrightarrow> compactin X (\<Union> \<F>)
[PROOF STEP]
by (induction rule: finite_induct) (simp_all add: compactin_Un)


[STATEMENT]
lemma Derivation_append: "Derivation a (D@E) c = (\<exists> b. Derivation a D b \<and> Derivation b E c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Derivation a (D @ E) c = (\<exists>b. Derivation a D b \<and> Derivation b E c)
[PROOF STEP]
proof(induct D arbitrary: a c E)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a c E. Derivation a ([] @ E) c = (\<exists>b. Derivation a [] b \<and> Derivation b E c)
 2. \<And>a D aa c E. (\<And>a c E. Derivation a (D @ E) c = (\<exists>b. Derivation a D b \<and> Derivation b E c)) \<Longrightarrow> Derivation aa ((a # D) @ E) c = (\<exists>b. Derivation aa (a # D) b \<and> Derivation b E c)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a c E. Derivation a ([] @ E) c = (\<exists>b. Derivation a [] b \<and> Derivation b E c)
 2. \<And>a D aa c E. (\<And>a c E. Derivation a (D @ E) c = (\<exists>b. Derivation a D b \<and> Derivation b E c)) \<Longrightarrow> Derivation aa ((a # D) @ E) c = (\<exists>b. Derivation aa (a # D) b \<and> Derivation b E c)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Derivation a ([] @ E) c = (\<exists>b. Derivation a [] b \<and> Derivation b E c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Derivation a ([] @ E) c = (\<exists>b. Derivation a [] b \<and> Derivation b E c)

goal (1 subgoal):
 1. \<And>a D aa c E. (\<And>a c E. Derivation a (D @ E) c = (\<exists>b. Derivation a D b \<and> Derivation b E c)) \<Longrightarrow> Derivation aa ((a # D) @ E) c = (\<exists>b. Derivation aa (a # D) b \<and> Derivation b E c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a D aa c E. (\<And>a c E. Derivation a (D @ E) c = (\<exists>b. Derivation a D b \<and> Derivation b E c)) \<Longrightarrow> Derivation aa ((a # D) @ E) c = (\<exists>b. Derivation aa (a # D) b \<and> Derivation b E c)
[PROOF STEP]
case (Cons d D)
[PROOF STATE]
proof (state)
this:
Derivation ?a (D @ ?E) ?c = (\<exists>b. Derivation ?a D b \<and> Derivation b ?E ?c)

goal (1 subgoal):
 1. \<And>a D aa c E. (\<And>a c E. Derivation a (D @ E) c = (\<exists>b. Derivation a D b \<and> Derivation b E c)) \<Longrightarrow> Derivation aa ((a # D) @ E) c = (\<exists>b. Derivation aa (a # D) b \<and> Derivation b E c)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Derivation ?a (D @ ?E) ?c = (\<exists>b. Derivation ?a D b \<and> Derivation b ?E ?c)

goal (1 subgoal):
 1. Derivation a ((d # D) @ E) c = (\<exists>b. Derivation a (d # D) b \<and> Derivation b E c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Derivation a ((d # D) @ E) c = (\<exists>b. Derivation a (d # D) b \<and> Derivation b E c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_at_right_field:
  "eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)"
  for x :: "'a::{linordered_field, linorder_topology}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (at_right x) = (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)
[PROOF STEP]
using linordered_field_no_ub[rule_format, of x]
[PROOF STATE]
proof (prove)
using this:
Ex ((<) x)

goal (1 subgoal):
 1. eventually P (at_right x) = (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)
[PROOF STEP]
by (auto simp: eventually_at_right)


[STATEMENT]
lemma mask_lem: "(bl_to_bin (True # replicate n False)) = bl_to_bin (replicate n True) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl_to_bin (True # replicate n False) = bl_to_bin (replicate n True) + 1
[PROOF STEP]
apply (unfold bl_to_bin_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl_to_bin_aux (True # replicate n False) 0 = bl_to_bin_aux (replicate n True) 0 + 1
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bl_to_bin_aux (True # replicate 0 False) 0 = bl_to_bin_aux (replicate 0 True) 0 + 1
 2. \<And>n. bl_to_bin_aux (True # replicate n False) 0 = bl_to_bin_aux (replicate n True) 0 + 1 \<Longrightarrow> bl_to_bin_aux (True # replicate (Suc n) False) 0 = bl_to_bin_aux (replicate (Suc n) True) 0 + 1
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. bl_to_bin_aux (True # replicate n False) 0 = bl_to_bin_aux (replicate n True) 0 + 1 \<Longrightarrow> bl_to_bin_aux (True # replicate (Suc n) False) 0 = bl_to_bin_aux (replicate (Suc n) True) 0 + 1
[PROOF STEP]
apply (simp only: Suc_eq_plus1 replicate_add append_Cons [symmetric] bl_to_bin_aux_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. bl_to_bin_aux (True # replicate n False) 0 = bl_to_bin_aux (replicate n True) 0 + 1 \<Longrightarrow> bl_to_bin_aux (replicate 1 False) (bl_to_bin_aux (replicate n True) 0 + 1) = bl_to_bin_aux (replicate 1 True) (bl_to_bin_aux (replicate n True) 0) + 1
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poincare_distance_refl [simp]:
  assumes "u \<in> unit_disc"
  shows "poincare_distance u u = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_distance u u = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc

goal (1 subgoal):
 1. poincare_distance u u = 0
[PROOF STEP]
using poincare_distance_satisfies_pred[OF assms assms]
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
poincare_distance_pred u u (poincare_distance u u)

goal (1 subgoal):
 1. poincare_distance u u = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma arcsin_le_arcsin: "- 1 \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> arcsin x \<le> arcsin y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> x; x \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> arcsin x \<le> arcsin y
[PROOF STEP]
using arcsin_le_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<bar>?x\<bar> \<le> 1; \<bar>?y\<bar> \<le> 1\<rbrakk> \<Longrightarrow> (arcsin ?x \<le> arcsin ?y) = (?x \<le> ?y)

goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> x; x \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> arcsin x \<le> arcsin y
[PROOF STEP]
by auto


[STATEMENT]
lemma NSsummable_rabs_comparison_test:
  "\<exists>N. \<forall>n. N \<le> n \<longrightarrow> \<bar>f n\<bar> \<le> g n \<Longrightarrow> NSsummable g \<Longrightarrow> NSsummable (\<lambda>k. \<bar>f k\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>N. \<forall>n\<ge>N. \<bar>f n\<bar> \<le> g n; NSsummable g\<rbrakk> \<Longrightarrow> NSsummable (\<lambda>k. \<bar>f k\<bar>)
[PROOF STEP]
by (rule NSsummable_comparison_test) auto


[STATEMENT]
lemma image_mset_Diff:
  assumes "B \<subseteq># A"
  shows   "image_mset f (A - B) = image_mset f A - image_mset f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (A - B) = image_mset f A - image_mset f B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. image_mset f (A - B) = image_mset f A - image_mset f B
[PROOF STEP]
have "image_mset f (A - B + B) = image_mset f (A - B) + image_mset f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (A - B + B) = image_mset f (A - B) + image_mset f B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
image_mset f (A - B + B) = image_mset f (A - B) + image_mset f B

goal (1 subgoal):
 1. image_mset f (A - B) = image_mset f A - image_mset f B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
image_mset f (A - B + B) = image_mset f (A - B) + image_mset f B

goal (1 subgoal):
 1. image_mset f (A - B) = image_mset f A - image_mset f B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq># A
[PROOF STEP]
have "A - B + B = A"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq># A

goal (1 subgoal):
 1. A - B + B = A
[PROOF STEP]
by (simp add: subset_mset.diff_add)
[PROOF STATE]
proof (state)
this:
A - B + B = A

goal (1 subgoal):
 1. image_mset f (A - B) = image_mset f A - image_mset f B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
image_mset f A = image_mset f (A - B) + image_mset f B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
image_mset f A = image_mset f (A - B) + image_mset f B

goal (1 subgoal):
 1. image_mset f (A - B) = image_mset f A - image_mset f B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
image_mset f (A - B) = image_mset f A - image_mset f B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma codegree_normalized_altX:
  assumes "x \<in> X" and "x' \<in> X"
  shows "codegree_normalized x x' Y = card (neighbors_ss x Y \<inter> neighbors_ss x' Y) / card Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codegree_normalized x x' Y = real (card (neighbors_ss x Y \<inter> neighbors_ss x' Y)) / real (card Y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codegree_normalized x x' Y = real (card (neighbors_ss x Y \<inter> neighbors_ss x' Y)) / real (card Y)
[PROOF STEP]
have "((neighbors_ss x Y) \<inter> (neighbors_ss x' Y)) = neighborhood x \<inter> neighborhood x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neighbors_ss x Y \<inter> neighbors_ss x' Y = neighborhood x \<inter> neighborhood x'
[PROOF STEP]
using neighbors_ss_eq_neighborhoodX assms
[PROOF STATE]
proof (prove)
using this:
?v \<in> X \<Longrightarrow> neighborhood ?v = neighbors_ss ?v Y
x \<in> X
x' \<in> X

goal (1 subgoal):
 1. neighbors_ss x Y \<inter> neighbors_ss x' Y = neighborhood x \<inter> neighborhood x'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
neighbors_ss x Y \<inter> neighbors_ss x' Y = neighborhood x \<inter> neighborhood x'

goal (1 subgoal):
 1. codegree_normalized x x' Y = real (card (neighbors_ss x Y \<inter> neighbors_ss x' Y)) / real (card Y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
neighbors_ss x Y \<inter> neighbors_ss x' Y = neighborhood x \<inter> neighborhood x'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
neighbors_ss x Y \<inter> neighbors_ss x' Y = neighborhood x \<inter> neighborhood x'

goal (1 subgoal):
 1. codegree_normalized x x' Y = real (card (neighbors_ss x Y \<inter> neighbors_ss x' Y)) / real (card Y)
[PROOF STEP]
unfolding codegree_normalized_def
[PROOF STATE]
proof (prove)
using this:
neighbors_ss x Y \<inter> neighbors_ss x' Y = neighborhood x \<inter> neighborhood x'

goal (1 subgoal):
 1. real (codegree x x') / real (card Y) = real (card (neighbors_ss x Y \<inter> neighbors_ss x' Y)) / real (card Y)
[PROOF STEP]
using codegree_def codegree_neighbors
[PROOF STATE]
proof (prove)
using this:
neighbors_ss x Y \<inter> neighbors_ss x' Y = neighborhood x \<inter> neighborhood x'
codegree ?v ?u \<equiv> card {x \<in> V. vert_adj ?v x \<and> vert_adj ?u x}
codegree ?v ?u = card (neighborhood ?v \<inter> neighborhood ?u)

goal (1 subgoal):
 1. real (codegree x x') / real (card Y) = real (card (neighbors_ss x Y \<inter> neighbors_ss x' Y)) / real (card Y)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
codegree_normalized x x' Y = real (card (neighbors_ss x Y \<inter> neighbors_ss x' Y)) / real (card Y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gcd_scm: "VARS a b x y
 {0<A \<and> 0<B \<and> a=A \<and> b=B \<and> x=B \<and> y=A}
 WHILE  a \<noteq> b
 INV {0<a \<and> 0<b \<and> gcd A B = gcd a b \<and> 2*A*B = a*x + b*y}
 DO IF a<b THEN (b := b-a; x := x+y) ELSE (a := a-b; y := y+x) FI OD
 {a = gcd A B \<and> 2*A*B = a*(x+y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A}
WHILE a \<noteq> b INV {0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y}  VAR {0}
DO IF a < b THEN b := b - a; x := x + y  ELSE a := a - b; y := y + x FI OD
{a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)}
[PROOF STEP]
proof casified_vcg
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a b x y. 0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A \<Longrightarrow> 0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 3. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
case while
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>a b x y. 0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A \<Longrightarrow> 0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 3. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>a b x y. 0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A \<Longrightarrow> 0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 3. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
case precondition
[PROOF STATE]
proof (state)
this:
0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A

goal (3 subgoals):
 1. \<And>a b x y. 0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A \<Longrightarrow> 0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 3. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < A \<and> 0 < B \<and> a = A \<and> b = B \<and> x = B \<and> y = A

goal (1 subgoal):
 1. 0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y

goal (2 subgoals):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
case invariant
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
case cond
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
case vc
[PROOF STATE]
proof (state)
this:
(0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b

goal (2 subgoals):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b \<Longrightarrow> (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
 2. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> a \<noteq> b

goal (1 subgoal):
 1. (a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))
[PROOF STEP]
by (simp add: distribs gcd_diff_r linorder_not_less gcd_diff_l)
[PROOF STATE]
proof (state)
this:
(a < b \<longrightarrow> 0 < a \<and> 0 < b - a \<and> Arith2.gcd A B = Arith2.gcd a (b - a) \<and> 2 * A * B = a * (x + y) + (b - a) * y) \<and> (\<not> a < b \<longrightarrow> 0 < a - b \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd (a - b) b \<and> 2 * A * B = (a - b) * x + b * (y + x))

goal (1 subgoal):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
case postcondition
[PROOF STATE]
proof (state)
this:
(0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b

goal (1 subgoal):
 1. \<And>a b x y. (0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b \<Longrightarrow> a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(0 < a \<and> 0 < b \<and> Arith2.gcd A B = Arith2.gcd a b \<and> 2 * A * B = a * x + b * y) \<and> \<not> a \<noteq> b

goal (1 subgoal):
 1. a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)
[PROOF STEP]
by (simp add: distribs gcd_nnn)
[PROOF STATE]
proof (state)
this:
a = Arith2.gcd A B \<and> 2 * A * B = a * (x + y)

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(0 < ?a2 \<and> 0 < ?b2 \<and> Arith2.gcd A B = Arith2.gcd ?a2 ?b2 \<and> 2 * A * B = ?a2 * ?x2 + ?b2 * ?y2) \<and> \<not> ?a2 \<noteq> ?b2 \<Longrightarrow> ?a2 = Arith2.gcd A B \<and> 2 * A * B = ?a2 * (?x2 + ?y2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem zorder_hurwitz_zeta:
  assumes "a > 0"
  shows   "zorder (hurwitz_zeta a) 1 = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zorder (hurwitz_zeta a) 1 = - 1
[PROOF STEP]
proof (rule zorder_eqI[of UNIV])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. open UNIV
 2. 1 \<in> UNIV
 3. ?g holomorphic_on UNIV
 4. ?g 1 \<noteq> 0
 5. \<And>w. \<lbrakk>w \<in> UNIV; w \<noteq> 1\<rbrakk> \<Longrightarrow> hurwitz_zeta a w = ?g w * (w - 1) powr of_int (- 1)
[PROOF STEP]
fix w :: complex
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. open UNIV
 2. 1 \<in> UNIV
 3. ?g holomorphic_on UNIV
 4. ?g 1 \<noteq> 0
 5. \<And>w. \<lbrakk>w \<in> UNIV; w \<noteq> 1\<rbrakk> \<Longrightarrow> hurwitz_zeta a w = ?g w * (w - 1) powr of_int (- 1)
[PROOF STEP]
assume "w \<in> UNIV" "w \<noteq> 1"
[PROOF STATE]
proof (state)
this:
w \<in> UNIV
w \<noteq> 1

goal (5 subgoals):
 1. open UNIV
 2. 1 \<in> UNIV
 3. ?g holomorphic_on UNIV
 4. ?g 1 \<noteq> 0
 5. \<And>w. \<lbrakk>w \<in> UNIV; w \<noteq> 1\<rbrakk> \<Longrightarrow> hurwitz_zeta a w = ?g w * (w - 1) powr of_int (- 1)
[PROOF STEP]
thus "hurwitz_zeta a w = (pre_zeta a w * (w - 1) + a powr (1 - w)) * (w - 1) powr (of_int (-1))"
[PROOF STATE]
proof (prove)
using this:
w \<in> UNIV
w \<noteq> 1

goal (1 subgoal):
 1. hurwitz_zeta a w = (pre_zeta a w * (w - 1) + complex_of_real a powr (1 - w)) * (w - 1) powr of_int (- 1)
[PROOF STEP]
apply (subst (1) powr_of_int)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>w \<in> UNIV; w \<noteq> 1\<rbrakk> \<Longrightarrow> w - 1 \<noteq> 0
 2. \<lbrakk>w \<in> UNIV; w \<noteq> 1\<rbrakk> \<Longrightarrow> hurwitz_zeta a w = (pre_zeta a w * (w - 1) + complex_of_real a powr (1 - w)) * (if 0 \<le> - 1 then (w - 1) ^ nat (- 1) else inverse ((w - 1) ^ nat (- (- 1))))
[PROOF STEP]
by (auto simp add: hurwitz_zeta_def field_simps)
[PROOF STATE]
proof (state)
this:
hurwitz_zeta a w = (pre_zeta a w * (w - 1) + complex_of_real a powr (1 - w)) * (w - 1) powr of_int (- 1)

goal (4 subgoals):
 1. open UNIV
 2. 1 \<in> UNIV
 3. (\<lambda>w. pre_zeta a w * (w - 1) + complex_of_real a powr (1 - w)) holomorphic_on UNIV
 4. pre_zeta a 1 * (1 - 1) + complex_of_real a powr (1 - 1) \<noteq> 0
[PROOF STEP]
qed (insert assms, auto intro!: holomorphic_intros)


[STATEMENT]
lemma polytope_imp_bounded:
  fixes S :: "'a::real_normed_vector set"
  shows "polytope S \<Longrightarrow> bounded S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polytope S \<Longrightarrow> bounded S
[PROOF STEP]
by (simp add: compact_imp_bounded polytope_imp_compact)


[STATEMENT]
lemma extend_fun: "\<lbrakk> f \<in> A \<rightarrow> B; B \<subseteq> B1 \<rbrakk> \<Longrightarrow> f \<in> A \<rightarrow> B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; B \<subseteq> B1\<rbrakk> \<Longrightarrow> f \<in> A \<rightarrow> B1
[PROOF STEP]
apply (simp add:Pi_def restrict_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; B \<subseteq> B1\<rbrakk> \<Longrightarrow> \<forall>x. x \<in> A \<longrightarrow> f x \<in> B1
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; B \<subseteq> B1\<rbrakk> \<Longrightarrow> x \<in> A \<longrightarrow> f x \<in> B1
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. x \<in> A \<longrightarrow> f x \<in> B; B \<subseteq> B1; x \<in> A\<rbrakk> \<Longrightarrow> f x \<in> B1
[PROOF STEP]
apply (simp add:subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Suc0_div_pow2_eq: "Suc 0 div 2 ^ i = (if i = 0 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 div 2 ^ i = (if i = 0 then 1 else 0)
[PROOF STEP]
by (induct i) (auto simp: div_mult2_eq)


[STATEMENT]
lemma gcd_factorial_commute: "gcd_factorial a b = gcd_factorial b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd_factorial a b = gcd_factorial b a
[PROOF STEP]
by (simp add: gcd_factorial_def multiset_inter_commute)


[STATEMENT]
lemma div_add1_eq_if: "0 < m \<Longrightarrow>
  (a + b) div (m::nat) = a div m + b div m + (
    if a mod m + b mod m < m then 0 else Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> (a + b) div m = a div m + b div m + (if a mod m + b mod m < m then 0 else Suc 0)
[PROOF STEP]
apply (simp only: div_add1_eq[of a b])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> a div m + b div m + (a mod m + b mod m) div m = a div m + b div m + (if a mod m + b mod m < m then 0 else Suc 0)
[PROOF STEP]
apply (rule arg_cong[of "(a mod m + b mod m) div m"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> (a mod m + b mod m) div m = (if a mod m + b mod m < m then 0 else Suc 0)
[PROOF STEP]
apply (clarsimp simp: linorder_not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m \<le> a mod m + b mod m\<rbrakk> \<Longrightarrow> (a mod m + b mod m) div m = Suc 0
[PROOF STEP]
apply (rule le_less_imp_div[of "Suc 0" m "a mod m + b mod m"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m \<le> a mod m + b mod m\<rbrakk> \<Longrightarrow> a mod m + b mod m < Suc (Suc 0) * m
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m \<le> a mod m + b mod m\<rbrakk> \<Longrightarrow> a mod m + b mod m < m + m
[PROOF STEP]
apply (simp only: add_less_mono[OF mod_less_divisor mod_less_divisor])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sup_eq_if:
  fixes a :: "'a::{lattice_ab_group_add,linorder}"
  shows "sup a (- a) = (if a < 0 then - a else a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup a (- a) = (if a < (0::'a) then - a else a)
[PROOF STEP]
using add_le_cancel_right [of a a "- a", symmetric, simplified]
    and add_le_cancel_right [of "-a" a a, symmetric, simplified]
[PROOF STATE]
proof (prove)
using this:
(a \<le> - a) = (a \<le> (0::'a))
(- a \<le> a) = ((0::'a) \<le> a)

goal (1 subgoal):
 1. sup a (- a) = (if a < (0::'a) then - a else a)
[PROOF STEP]
by (auto simp: sup_max max.absorb1 max.absorb2)


[STATEMENT]
lemma finite_permutations_of_multiset [simp]: "finite (permutations_of_multiset A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (permutations_of_multiset A)
[PROOF STEP]
proof (rule finite_subset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. permutations_of_multiset A \<subseteq> ?B
 2. finite ?B
[PROOF STEP]
show "permutations_of_multiset A \<subseteq> {xs. set xs \<subseteq> set_mset A \<and> length xs = size A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_multiset A \<subseteq> {xs. set xs \<subseteq> set_mset A \<and> length xs = size A}
[PROOF STEP]
by (auto simp: permutations_of_multiset_def)
[PROOF STATE]
proof (state)
this:
permutations_of_multiset A \<subseteq> {xs. set xs \<subseteq> set_mset A \<and> length xs = size A}

goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> set_mset A \<and> length xs = size A}
[PROOF STEP]
show "finite {xs. set xs \<subseteq> set_mset A \<and> length xs = size A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> set_mset A \<and> length xs = size A}
[PROOF STEP]
by (rule finite_lists_length_eq) simp_all
[PROOF STATE]
proof (state)
this:
finite {xs. set xs \<subseteq> set_mset A \<and> length xs = size A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power_both_sides :
  assumes Ah : "(A::real) \<ge>0"
  assumes Bh : "(B::real) \<ge>0"
  shows "(A\<le>B) = (A^2\<le>B^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<le> B) = (A\<^sup>2 \<le> B\<^sup>2)
[PROOF STEP]
using Ah Bh
[PROOF STATE]
proof (prove)
using this:
0 \<le> A
0 \<le> B

goal (1 subgoal):
 1. (A \<le> B) = (A\<^sup>2 \<le> B\<^sup>2)
[PROOF STEP]
by (meson power2_le_imp_le power_mono)


[STATEMENT]
lemma cycle_enter_leave_same:
  assumes "cycle G p"
  shows "card (set [(x', y) \<leftarrow> cycle_edges p. x' = x]) = card (set [(x', y) \<leftarrow> cycle_edges p. y = x])"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cycle G p

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
case (cycle v)
[PROOF STATE]
proof (state)
this:
path G v p v
p \<noteq> []
distinct p

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
from distinct_cycle_edges[OF assms]
[PROOF STATE]
proof (chain)
picking this:
distinct (cycle_edges p)
[PROOF STEP]
have "?lhs = length [x' \<leftarrow> map fst (cycle_edges p). x' = x]"
[PROOF STATE]
proof (prove)
using this:
distinct (cycle_edges p)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = length (filter (\<lambda>x'. x' = x) (map fst (cycle_edges p)))
[PROOF STEP]
by(subst distinct_card; simp add: filter_map o_def split_def)
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = length (filter (\<lambda>x'. x' = x) (map fst (cycle_edges p)))

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = length (filter (\<lambda>x'. x' = x) (map fst (cycle_edges p)))

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
have "\<dots> = (if x \<in> set p then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>x'. x' = x) (map fst (cycle_edges p))) = (if x \<in> set p then 1 else 0)
[PROOF STEP]
using cycle
[PROOF STATE]
proof (prove)
using this:
path G v p v
p \<noteq> []
distinct p

goal (1 subgoal):
 1. length (filter (\<lambda>x'. x' = x) (map fst (cycle_edges p))) = (if x \<in> set p then 1 else 0)
[PROOF STEP]
by(auto simp add: cycle_edges_def filter_empty_conv length_filter_conv_card card_eq_1_iff in_set_conv_nth dest: nth_eq_iff_index_eq)
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x'. x' = x) (map fst (cycle_edges p))) = (if x \<in> set p then 1 else 0)

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x'. x' = x) (map fst (cycle_edges p))) = (if x \<in> set p then 1 else 0)

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
have "\<dots> = length [y \<leftarrow> map snd (cycle_edges p). y = x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x \<in> set p then 1 else 0) = length (filter (\<lambda>y. y = x) (map snd (cycle_edges p)))
[PROOF STEP]
using cycle
[PROOF STATE]
proof (prove)
using this:
path G v p v
p \<noteq> []
distinct p

goal (1 subgoal):
 1. (if x \<in> set p then 1 else 0) = length (filter (\<lambda>y. y = x) (map snd (cycle_edges p)))
[PROOF STEP]
apply(auto simp add: cycle_edges_def filter_empty_conv Suc_length_conv intro!: exI[where x=x])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path G v p v; p \<noteq> []; distinct p; x \<in> set p\<rbrakk> \<Longrightarrow> filter (\<lambda>y. y = x) (rotate1 p) = [x]
[PROOF STEP]
apply(drule split_list_first)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path G v p v; p \<noteq> []; distinct p; \<exists>ys zs. p = ys @ x # zs \<and> x \<notin> set ys\<rbrakk> \<Longrightarrow> filter (\<lambda>y. y = x) (rotate1 p) = [x]
[PROOF STEP]
apply(auto dest: split_list_first simp add: append_eq_Cons_conv rotate1_append filter_empty_conv split: if_split_asm dest: in_set_tlD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(if x \<in> set p then 1 else 0) = length (filter (\<lambda>y. y = x) (map snd (cycle_edges p)))

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if x \<in> set p then 1 else 0) = length (filter (\<lambda>y. y = x) (map snd (cycle_edges p)))

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>y. y = x) (map snd (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
using distinct_cycle_edges[OF assms]
[PROOF STATE]
proof (prove)
using this:
distinct (cycle_edges p)

goal (1 subgoal):
 1. length (filter (\<lambda>y. y = x) (map snd (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
by(subst distinct_card; simp add: filter_map o_def split_def)
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>y. y = x) (map snd (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))

goal (1 subgoal):
 1. \<And>v. \<lbrakk>path G v p v; p \<noteq> []; distinct p\<rbrakk> \<Longrightarrow> card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x', y). x' = x) (cycle_edges p))) = card (set (filter (\<lambda>(x', y). y = x) (cycle_edges p)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basis_list_imp_lin_indpt_list: assumes "basis_list fs" shows "lin_indpt_list fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt_list fs
[PROOF STEP]
using basis_list_basis[OF assms] assms
[PROOF STATE]
proof (prove)
using this:
distinct fs
lin_indpt (set fs)
basis (set fs)
basis_list fs

goal (1 subgoal):
 1. lin_indpt_list fs
[PROOF STEP]
unfolding lin_indpt_list_def basis_list_def
[PROOF STATE]
proof (prove)
using this:
distinct fs
lin_indpt (set fs)
basis (set fs)
set fs \<subseteq> carrier_vec n \<and> length fs = n \<and> carrier_vec n \<subseteq> local.span (set fs)

goal (1 subgoal):
 1. set fs \<subseteq> carrier_vec n \<and> distinct fs \<and> lin_indpt (set fs)
[PROOF STEP]
by auto


[STATEMENT]
lemma llength_ldropn [simp]: "llength (ldropn n xs) = llength xs - enat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llength (ldropn n xs) = llength xs - enat n
[PROOF STEP]
proof(induct n arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. llength (ldropn 0 xs) = llength xs - enat 0
 2. \<And>n xs. (\<And>xs. llength (ldropn n xs) = llength xs - enat n) \<Longrightarrow> llength (ldropn (Suc n) xs) = llength xs - enat (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs. llength (ldropn 0 xs) = llength xs - enat 0
 2. \<And>n xs. (\<And>xs. llength (ldropn n xs) = llength xs - enat n) \<Longrightarrow> llength (ldropn (Suc n) xs) = llength xs - enat (Suc n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llength (ldropn 0 xs) = llength xs - enat 0
[PROOF STEP]
by(simp add: zero_enat_def[symmetric])
[PROOF STATE]
proof (state)
this:
llength (ldropn 0 xs) = llength xs - enat 0

goal (1 subgoal):
 1. \<And>n xs. (\<And>xs. llength (ldropn n xs) = llength xs - enat n) \<Longrightarrow> llength (ldropn (Suc n) xs) = llength xs - enat (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n xs. (\<And>xs. llength (ldropn n xs) = llength xs - enat n) \<Longrightarrow> llength (ldropn (Suc n) xs) = llength xs - enat (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
llength (ldropn n ?xs) = llength ?xs - enat n

goal (1 subgoal):
 1. \<And>n xs. (\<And>xs. llength (ldropn n xs) = llength xs - enat n) \<Longrightarrow> llength (ldropn (Suc n) xs) = llength xs - enat (Suc n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
llength (ldropn n ?xs) = llength ?xs - enat n

goal (1 subgoal):
 1. llength (ldropn (Suc n) xs) = llength xs - enat (Suc n)
[PROOF STEP]
by(cases xs)(simp_all add: eSuc_enat[symmetric])
[PROOF STATE]
proof (state)
this:
llength (ldropn (Suc n) xs) = llength xs - enat (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zeta_zero_reflect:
  assumes "Re s \<in> {0<..<1}" and "zeta s = 0"
  shows   "zeta (1 - s) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zeta (1 - s) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. zeta (1 - s) = 0
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Re s \<in> {0<..<1}
zeta s = 0
[PROOF STEP]
have "rGamma s \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
Re s \<in> {0<..<1}
zeta s = 0

goal (1 subgoal):
 1. rGamma s \<noteq> 0
[PROOF STEP]
by (auto simp: rGamma_eq_zero_iff elim!: nonpos_Ints_cases)
[PROOF STATE]
proof (state)
this:
rGamma s \<noteq> 0

goal (1 subgoal):
 1. zeta (1 - s) = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rGamma s \<noteq> 0

goal (1 subgoal):
 1. zeta (1 - s) = 0
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Re s \<in> {0<..<1}
zeta s = 0
[PROOF STEP]
have "s \<noteq> 0" and "s \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
Re s \<in> {0<..<1}
zeta s = 0

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

goal (1 subgoal):
 1. zeta (1 - s) = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rGamma s \<noteq> 0
s \<noteq> 0
s \<noteq> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rGamma s \<noteq> 0
s \<noteq> 0
s \<noteq> 1

goal (1 subgoal):
 1. zeta (1 - s) = 0
[PROOF STEP]
using zeta_reflect[of s] and assms
[PROOF STATE]
proof (prove)
using this:
rGamma s \<noteq> 0
s \<noteq> 0
s \<noteq> 1
\<lbrakk>s \<noteq> 0; s \<noteq> 1\<rbrakk> \<Longrightarrow> rGamma s * zeta (1 - s) = 2 * complex_of_real (2 * pi) powr - s * cos (s * complex_of_real pi / 2) * zeta s
Re s \<in> {0<..<1}
zeta s = 0

goal (1 subgoal):
 1. zeta (1 - s) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zeta (1 - s) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma forall_2: "(\<forall>i::2. P i) \<longleftrightarrow> P 1 \<and> P 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i. P i) = (P 1 \<and> P 2)
[PROOF STEP]
by (metis exhaust_2)


[STATEMENT]
lemma det_multrow:
  assumes k: "k < n" and A: "A \<in> carrier_mat n n"
  shows "det (multrow k a A) = a * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
have "multrow k a A = multrow_mat n k a * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multrow k a A = multrow_mat n k a * A
[PROOF STEP]
by (rule multrow_mat[OF A])
[PROOF STATE]
proof (state)
this:
multrow k a A = multrow_mat n k a * A

goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multrow k a A = multrow_mat n k a * A

goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
have "det (multrow_mat n k a * A) = det (multrow_mat n k a) * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (multrow_mat n k a * A) = det (multrow_mat n k a) * det A
[PROOF STEP]
by (rule det_mult[OF _ A], auto)
[PROOF STATE]
proof (state)
this:
det (multrow_mat n k a * A) = det (multrow_mat n k a) * det A

goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (multrow_mat n k a * A) = det (multrow_mat n k a) * det A

goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
have "det (multrow_mat n k a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (multrow_mat n k a) = a
[PROOF STEP]
by (rule det_multrow_mat[OF k])
[PROOF STATE]
proof (state)
this:
det (multrow_mat n k a) = a

goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (multrow k a A) = a * det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (multrow k a A) = a * det A

goal (1 subgoal):
 1. det (multrow k a A) = a * det A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (multrow k a A) = a * det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_sum_gt_comp:
  assumes "finite I"
and "\<And>i. i \<in> I \<Longrightarrow> (0::real) \<le> f i"
and "j\<in> I"
and "c < f j"
shows "c < sum f I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
have "c < f j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < f j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i
j \<in> I
c < f j

goal (1 subgoal):
 1. c < f j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c < f j

goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c < f j

goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
have "... \<le> f j + sum f (I -{j})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f j \<le> f j + sum f (I - {j})
[PROOF STEP]
by (smt (z3) DiffD1 assms(2) sum_nonneg)
[PROOF STATE]
proof (state)
this:
f j \<le> f j + sum f (I - {j})

goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f j \<le> f j + sum f (I - {j})

goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
have "... = sum f I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f j + sum f (I - {j}) = sum f I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i
j \<in> I
c < f j

goal (1 subgoal):
 1. f j + sum f (I - {j}) = sum f I
[PROOF STEP]
by (simp add: sum_diff1)
[PROOF STATE]
proof (state)
this:
f j + sum f (I - {j}) = sum f I

goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
c < sum f I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c < sum f I

goal (1 subgoal):
 1. c < sum f I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
c < sum f I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_smult_distr_right:
shows "vec_smult (\<alpha> + \<beta>) as = vec_plus (vec_smult \<alpha> as) (vec_smult \<beta> as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_smult (\<alpha> + \<beta>) as = vec_plus (vec_smult \<alpha> as) (vec_smult \<beta> as)
[PROOF STEP]
unfolding vec_smult_def vec_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((*) (\<alpha> + \<beta>)) as = map2 (+) (map ((*) \<alpha>) as) (map ((*) \<beta>) as)
[PROOF STEP]
by (induction as; simp add: distrib_right)


[STATEMENT]
lemma rel_interior_ereal_semiline:
  fixes a :: ereal
  shows "rel_interior {y. a \<le> ereal y} = {y. a < ereal y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
proof (cases a)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>r. a = ereal r \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
 2. a = \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
 3. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
case (real r)
[PROOF STATE]
proof (state)
this:
a = ereal r

goal (3 subgoals):
 1. \<And>r. a = ereal r \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
 2. a = \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
 3. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = ereal r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = ereal r

goal (1 subgoal):
 1. rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
using rel_interior_real_semiline[of r]
[PROOF STATE]
proof (prove)
using this:
a = ereal r
rel_interior {r..} = {r<..}

goal (1 subgoal):
 1. rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
by (simp add: atLeast_def greaterThan_def)
[PROOF STATE]
proof (state)
this:
rel_interior {y. a \<le> ereal y} = {y. a < ereal y}

goal (2 subgoals):
 1. a = \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
 2. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
 2. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
case PInf
[PROOF STATE]
proof (state)
this:
a = \<infinity>

goal (2 subgoals):
 1. a = \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
 2. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = \<infinity>

goal (1 subgoal):
 1. rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
using rel_interior_empty
[PROOF STATE]
proof (prove)
using this:
a = \<infinity>
rel_interior {} = {}

goal (1 subgoal):
 1. rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior {y. a \<le> ereal y} = {y. a < ereal y}

goal (1 subgoal):
 1. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
case MInf
[PROOF STATE]
proof (state)
this:
a = - \<infinity>

goal (1 subgoal):
 1. a = - \<infinity> \<Longrightarrow> rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = - \<infinity>

goal (1 subgoal):
 1. rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
using rel_interior_UNIV
[PROOF STATE]
proof (prove)
using this:
a = - \<infinity>
rel_interior UNIV = UNIV

goal (1 subgoal):
 1. rel_interior {y. a \<le> ereal y} = {y. a < ereal y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior {y. a \<le> ereal y} = {y. a < ereal y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_not_gt_iff_eq_length:
  assumes "length s > 0" and "strict_prefix (butlast s) t"
  shows "(\<not> (length s < length t)) = (length s = length t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> length s < length t) = (length s = length t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<not> length s < length t) = (length s = length t)
[PROOF STEP]
have "(\<not> (length s < length t)) = ((length t < length s) \<or> (length s = length t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> length s < length t) = (length t < length s \<or> length s = length t)
[PROOF STEP]
by (metis not_less_iff_gr_or_eq)
[PROOF STATE]
proof (state)
this:
(\<not> length s < length t) = (length t < length s \<or> length s = length t)

goal (1 subgoal):
 1. (\<not> length s < length t) = (length s = length t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<not> length s < length t) = (length t < length s \<or> length s = length t)

goal (1 subgoal):
 1. (\<not> length s < length t) = (length s = length t)
[PROOF STEP]
have "... = (length s = length t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length t < length s \<or> length s = length t) = (length s = length t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < length s
strict_prefix (butlast s) t

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

goal (1 subgoal):
 1. (\<not> length s < length t) = (length s = length t)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<not> length s < length t) = (length s = length t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<not> length s < length t) = (length s = length t)

goal (1 subgoal):
 1. (\<not> length s < length t) = (length s = length t)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<not> length s < length t) = (length s = length t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_restrict_Int:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: banach"
  shows "((\<lambda>x. if x \<in> S then f x else 0) has_integral i) T \<longleftrightarrow> (f has_integral i) (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral i) T = (f has_integral i) (S \<inter> T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral i) T = (f has_integral i) (S \<inter> T)
[PROOF STEP]
have "((\<lambda>x. if x \<in> T then if x \<in> S then f x else 0 else 0) has_integral i) UNIV =
        ((\<lambda>x. if x \<in> S \<inter> T then f x else 0) has_integral i) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> T then if x \<in> S then f x else (0::'b) else (0::'b)) has_integral i) UNIV = ((\<lambda>x. if x \<in> S \<inter> T then f x else (0::'b)) has_integral i) UNIV
[PROOF STEP]
by (rule has_integral_cong) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<in> T then if x \<in> S then f x else (0::'b) else (0::'b)) has_integral i) UNIV = ((\<lambda>x. if x \<in> S \<inter> T then f x else (0::'b)) has_integral i) UNIV

goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral i) T = (f has_integral i) (S \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. if x \<in> T then if x \<in> S then f x else (0::'b) else (0::'b)) has_integral i) UNIV = ((\<lambda>x. if x \<in> S \<inter> T then f x else (0::'b)) has_integral i) UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. if x \<in> T then if x \<in> S then f x else (0::'b) else (0::'b)) has_integral i) UNIV = ((\<lambda>x. if x \<in> S \<inter> T then f x else (0::'b)) has_integral i) UNIV

goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral i) T = (f has_integral i) (S \<inter> T)
[PROOF STEP]
using has_integral_restrict_UNIV
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. if x \<in> T then if x \<in> S then f x else (0::'b) else (0::'b)) has_integral i) UNIV = ((\<lambda>x. if x \<in> S \<inter> T then f x else (0::'b)) has_integral i) UNIV
((\<lambda>x. if x \<in> ?s then ?f x else (0::?'a)) has_integral ?i) UNIV = (?f has_integral ?i) ?s

goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral i) T = (f has_integral i) (S \<inter> T)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if x \<in> S then f x else (0::'b)) has_integral i) T = (f has_integral i) (S \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed