[STATEMENT]
lemma positive_proj_trace:
  assumes "projector (P::complex Matrix.mat)"
  and "Complex_Matrix.positive R"
  and "P \<in> carrier_mat n n"
  and "R\<in> carrier_mat n n"
shows "Complex_Matrix.trace (R * P) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
have "Complex_Matrix.trace (R * P) = Complex_Matrix.trace ((P * R) * P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (R * P) = Complex_Matrix.trace (P * R * P)
[PROOF STEP]
using  assms projector_collapse_trace
[PROOF STATE]
proof (prove)
using this:
projector P
Complex_Matrix.positive R
P \<in> carrier_mat n n
R \<in> carrier_mat n n
\<lbrakk>projector ?P; ?P \<in> carrier_mat ?n ?n; ?R \<in> carrier_mat ?n ?n\<rbrakk> \<Longrightarrow> Complex_Matrix.trace (?P * ?R * ?P) = Complex_Matrix.trace (?R * ?P)

goal (1 subgoal):
 1. Complex_Matrix.trace (R * P) = Complex_Matrix.trace (P * R * P)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (R * P) = Complex_Matrix.trace (P * R * P)

goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (R * P) = Complex_Matrix.trace (P * R * P)

goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
have "... = Complex_Matrix.trace ((P * R) * (Complex_Matrix.adjoint P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (P * R * P) = Complex_Matrix.trace (P * R * Complex_Matrix.adjoint P)
[PROOF STEP]
using assms projector_hermitian[of P]
[PROOF STATE]
proof (prove)
using this:
projector P
Complex_Matrix.positive R
P \<in> carrier_mat n n
R \<in> carrier_mat n n
projector P \<Longrightarrow> hermitian P

goal (1 subgoal):
 1. Complex_Matrix.trace (P * R * P) = Complex_Matrix.trace (P * R * Complex_Matrix.adjoint P)
[PROOF STEP]
unfolding hermitian_def
[PROOF STATE]
proof (prove)
using this:
projector P
Complex_Matrix.positive R
P \<in> carrier_mat n n
R \<in> carrier_mat n n
projector P \<Longrightarrow> Complex_Matrix.adjoint P = P

goal (1 subgoal):
 1. Complex_Matrix.trace (P * R * P) = Complex_Matrix.trace (P * R * Complex_Matrix.adjoint P)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (P * R * P) = Complex_Matrix.trace (P * R * Complex_Matrix.adjoint P)

goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (P * R * P) = Complex_Matrix.trace (P * R * Complex_Matrix.adjoint P)

goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
have "... \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (P * R * Complex_Matrix.adjoint P)
[PROOF STEP]
proof (rule positive_trace)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P * R * Complex_Matrix.adjoint P \<in> carrier_mat ?n ?n
 2. Complex_Matrix.positive (P * R * Complex_Matrix.adjoint P)
[PROOF STEP]
show " P * R * Complex_Matrix.adjoint P \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * R * Complex_Matrix.adjoint P \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
projector P
Complex_Matrix.positive R
P \<in> carrier_mat n n
R \<in> carrier_mat n n

goal (1 subgoal):
 1. P * R * Complex_Matrix.adjoint P \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P * R * Complex_Matrix.adjoint P \<in> carrier_mat n n

goal (1 subgoal):
 1. Complex_Matrix.positive (P * R * Complex_Matrix.adjoint P)
[PROOF STEP]
show "Complex_Matrix.positive (P * R * Complex_Matrix.adjoint P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.positive (P * R * Complex_Matrix.adjoint P)
[PROOF STEP]
by (rule positive_close_under_left_right_mult_adjoint[of _ n], (auto simp add: assms))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.positive (P * R * Complex_Matrix.adjoint P)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> Complex_Matrix.trace (P * R * Complex_Matrix.adjoint P)

goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> Complex_Matrix.trace (R * P)

goal (1 subgoal):
 1. 0 \<le> Complex_Matrix.trace (R * P)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 \<le> Complex_Matrix.trace (R * P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_le_iff_nprt_id: "a \<le> 0 \<longleftrightarrow> nprt a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> (0::'a)) = (nprt a = a)
[PROOF STEP]
unfolding le_iff_inf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inf a (0::'a) = a) = (nprt a = a)
[PROOF STEP]
by (simp add: nprt_def inf_commute)


[STATEMENT]
lemma subset_Collect_iff: "B \<subseteq> A \<Longrightarrow> (B \<subseteq> {x \<in> A. P x}) = (\<forall>x \<in> B. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> (B \<subseteq> {x \<in> A. P x}) = (\<forall>x\<in>B. P x)
[PROOF STEP]
by blast


[STATEMENT]
lemma eval_set_filter:
  "Set.filter P {} = {}"
  "P x \<Longrightarrow> Set.filter P (insert x A) = insert x (Set.filter P A)"
  "\<not>P x \<Longrightarrow> Set.filter P (insert x A) = Set.filter P A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Set.filter P {} = {} &&& (P x \<Longrightarrow> Set.filter P (insert x A) = insert x (Set.filter P A)) &&& (\<not> P x \<Longrightarrow> Set.filter P (insert x A) = Set.filter P A)
[PROOF STEP]
unfolding Set.filter_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> {}. P a} = {} &&& (P x \<Longrightarrow> {a \<in> insert x A. P a} = insert x {a \<in> A. P a}) &&& (\<not> P x \<Longrightarrow> {a \<in> insert x A. P a} = {a \<in> A. P a})
[PROOF STEP]
by auto


[STATEMENT]
lemma vector_derivative_circlepath:
  "vector_derivative (circlepath z r) (at x) =
    2 * pi * \<i> * r * exp(2 * of_real pi * \<i> * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (circlepath z r) (at x) = complex_of_real (2 * pi) * \<i> * complex_of_real r * exp (2 * complex_of_real pi * \<i> * complex_of_real x)
[PROOF STEP]
using has_vector_derivative_circlepath vector_derivative_at
[PROOF STATE]
proof (prove)
using this:
(circlepath ?z ?r has_vector_derivative complex_of_real (2 * pi) * \<i> * complex_of_real ?r * exp (2 * complex_of_real pi * \<i> * complex_of_real ?x)) (at ?x within ?X)
(?f has_vector_derivative ?f') (at ?x) \<Longrightarrow> vector_derivative ?f (at ?x) = ?f'

goal (1 subgoal):
 1. vector_derivative (circlepath z r) (at x) = complex_of_real (2 * pi) * \<i> * complex_of_real r * exp (2 * complex_of_real pi * \<i> * complex_of_real x)
[PROOF STEP]
by blast


[STATEMENT]
lemma "((x + z) < (y + z)) = (x < (y::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + z < y + z) = (x < y)
[PROOF STEP]
by arith


[STATEMENT]
lemma word_xor_and_or: "x XOR y = x AND NOT y OR NOT x AND y"
  for x y :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x XOR y = x AND NOT y OR NOT x AND y
[PROOF STEP]
by (fact bit.xor_def)


[STATEMENT]
lemma transpose_vec_mult_scalar:
  fixes A :: "'a :: comm_semiring_0 mat"
  assumes A: "A \<in> carrier_mat nr nc"
    and x: "x \<in> carrier_vec nc"
    and y: "y \<in> carrier_vec nr"
  shows "(transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
have "(transpose_mat A *\<^sub>v y) = vec nc (\<lambda>i. col A i \<bullet> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_mat A *\<^sub>v y = vec nc (\<lambda>i. col A i \<bullet> y)
[PROOF STEP]
unfolding mult_mat_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_row (transpose_mat A)) (\<lambda>i. row (transpose_mat A) i \<bullet> y) = vec nc (\<lambda>i. col A i \<bullet> y)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. vec (dim_row (transpose_mat A)) (\<lambda>i. row (transpose_mat A) i \<bullet> y) = vec nc (\<lambda>i. col A i \<bullet> y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
transpose_mat A *\<^sub>v y = vec nc (\<lambda>i. col A i \<bullet> y)

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
transpose_mat A *\<^sub>v y = vec nc (\<lambda>i. col A i \<bullet> y)

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
have "\<dots> = vec nc (\<lambda>i. y \<bullet> col A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec nc (\<lambda>i. col A i \<bullet> y) = vec nc (\<lambda>i. y \<bullet> col A i)
[PROOF STEP]
by (intro eq_vecI, simp, rule comm_scalar_prod[OF _ y], insert A, auto)
[PROOF STATE]
proof (state)
this:
vec nc (\<lambda>i. col A i \<bullet> y) = vec nc (\<lambda>i. y \<bullet> col A i)

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec nc (\<lambda>i. col A i \<bullet> y) = vec nc (\<lambda>i. y \<bullet> col A i)

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
have "\<dots> \<bullet> x = y \<bullet> vec nr (\<lambda>i. row A i \<bullet> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec nc (\<lambda>i. y \<bullet> col A i) \<bullet> x = y \<bullet> vec nr (\<lambda>i. row A i \<bullet> x)
[PROOF STEP]
by (rule assoc_scalar_prod[OF y A x])
[PROOF STATE]
proof (state)
this:
vec nc (\<lambda>i. y \<bullet> col A i) \<bullet> x = y \<bullet> vec nr (\<lambda>i. row A i \<bullet> x)

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec nc (\<lambda>i. y \<bullet> col A i) \<bullet> x = y \<bullet> vec nr (\<lambda>i. row A i \<bullet> x)

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
have "vec nr (\<lambda>i. row A i \<bullet> x) = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec nr (\<lambda>i. row A i \<bullet> x) = A *\<^sub>v x
[PROOF STEP]
unfolding mult_mat_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec nr (\<lambda>i. row A i \<bullet> x) = vec (dim_row A) (\<lambda>i. row A i \<bullet> x)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. vec nr (\<lambda>i. row A i \<bullet> x) = vec (dim_row A) (\<lambda>i. row A i \<bullet> x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec nr (\<lambda>i. row A i \<bullet> x) = A *\<^sub>v x

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)

goal (1 subgoal):
 1. (transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(transpose_mat A *\<^sub>v y) \<bullet> x = y \<bullet> (A *\<^sub>v x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_fun [code]:
  fixes f g :: "'a::enum \<Rightarrow> 'b::order"
  shows "f \<le> g \<longleftrightarrow> enum_all (\<lambda>x. f x \<le> g x)"
    and "f < g \<longleftrightarrow> f \<le> g \<and> enum_ex (\<lambda>x. f x \<noteq> g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<le> g) = enum_all (\<lambda>x. f x \<le> g x) &&& (f < g) = (f \<le> g \<and> enum_ex (\<lambda>x. f x \<noteq> g x))
[PROOF STEP]
by (simp_all add: fun_eq_iff le_fun_def order_less_le)


[STATEMENT]
lemma segment_bound:
  assumes "x \<in> closed_segment a b"
  shows "norm (x - a) \<le> norm (b - a)" "norm (x - b) \<le> norm (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x - a) \<le> norm (b - a) &&& norm (x - b) \<le> norm (b - a)
[PROOF STEP]
by (metis assms closed_segment_commute dist_commute dist_norm segment_bound1)+


[STATEMENT]
lemma continuous_at_imp_cball:
  assumes "continuous (at x) g"
  assumes "g x > (0::real)"
  obtains r where "r > 0" "\<forall>y \<in> cball x r. g y > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>0 < r; \<forall>y\<in>cball x r. 0 < g y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>0 < r; \<forall>y\<in>cball x r. 0 < g y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
isCont g x
[PROOF STEP]
obtain d where "d>0" "g ` (ball x d) \<subseteq> ball (g x) ((g x)/2)"
[PROOF STATE]
proof (prove)
using this:
isCont g x

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; g ` ball x d \<subseteq> ball (g x) (g x / 2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson assms(2) continuous_at_ball half_gt_zero)
[PROOF STATE]
proof (state)
this:
0 < d
g ` ball x d \<subseteq> ball (g x) (g x / 2)

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>0 < r; \<forall>y\<in>cball x r. 0 < g y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < d
g ` ball x d \<subseteq> ball (g x) (g x / 2)
[PROOF STEP]
have "\<forall>y \<in> cball x (d/2). g y > 0"
[PROOF STATE]
proof (prove)
using this:
0 < d
g ` ball x d \<subseteq> ball (g x) (g x / 2)

goal (1 subgoal):
 1. \<forall>y\<in>cball x (d / 2). 0 < g y
[PROOF STEP]
by (smt assms(2) dist_norm image_subset_iff mem_ball mem_cball pos_half_less real_norm_def)
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>cball x (d / 2). 0 < g y

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>0 < r; \<forall>y\<in>cball x r. 0 < g y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>cball x (d / 2). 0 < g y

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using \<open>0 < d\<close> that half_gt_zero
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>cball x (d / 2). 0 < g y
0 < d
\<lbrakk>0 < ?r; \<forall>y\<in>cball x ?r. 0 < g y\<rbrakk> \<Longrightarrow> thesis
(0::?'a) < ?a \<Longrightarrow> (0::?'a) < ?a / (2::?'a)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_bound:
  fixes f :: "('a, 'b::real_normed_vector) bfun"
  assumes "\<And>x. norm (apply_bfun f x) \<le> b"
  shows "norm f \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm f \<le> b
[PROOF STEP]
using dist_bound[of f 0 b] assms
[PROOF STATE]
proof (prove)
using this:
(\<And>x. dist (apply_bfun f x) (apply_bfun 0 x) \<le> b) \<Longrightarrow> dist f 0 \<le> b
norm (apply_bfun f ?x) \<le> b

goal (1 subgoal):
 1. norm f \<le> b
[PROOF STEP]
by (simp add: dist_norm)


[STATEMENT]
lemma Abs_freeword_conv_freeletter_sum_list:
  "proper_signed_list xs \<Longrightarrow>
    Abs_freeword xs = (\<Sum>x\<leftarrow>xs. apply_sign Abs_freeletter x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_signed_list xs \<Longrightarrow> Abs_freeword xs = sum_list (map (apply_sign Abs_freeletter) xs)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. proper_signed_list [] \<Longrightarrow> Abs_freeword [] = sum_list (map (apply_sign Abs_freeletter) [])
 2. \<And>a xs. \<lbrakk>proper_signed_list xs \<Longrightarrow> Abs_freeword xs = sum_list (map (apply_sign Abs_freeletter) xs); proper_signed_list (a # xs)\<rbrakk> \<Longrightarrow> Abs_freeword (a # xs) = sum_list (map (apply_sign Abs_freeletter) (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
proper_signed_list xs \<Longrightarrow> Abs_freeword xs = sum_list (map (apply_sign Abs_freeletter) xs)
proper_signed_list (x # xs)

goal (2 subgoals):
 1. proper_signed_list [] \<Longrightarrow> Abs_freeword [] = sum_list (map (apply_sign Abs_freeletter) [])
 2. \<And>a xs. \<lbrakk>proper_signed_list xs \<Longrightarrow> Abs_freeword xs = sum_list (map (apply_sign Abs_freeletter) xs); proper_signed_list (a # xs)\<rbrakk> \<Longrightarrow> Abs_freeword (a # xs) = sum_list (map (apply_sign Abs_freeletter) (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
proper_signed_list xs \<Longrightarrow> Abs_freeword xs = sum_list (map (apply_sign Abs_freeletter) xs)
proper_signed_list (x # xs)

goal (1 subgoal):
 1. Abs_freeword (x # xs) = sum_list (map (apply_sign Abs_freeletter) (x # xs))
[PROOF STEP]
using Abs_freeword_Cons[of x] binrelchain_Cons_reduce[of _ x]
[PROOF STATE]
proof (prove)
using this:
proper_signed_list xs \<Longrightarrow> Abs_freeword xs = sum_list (map (apply_sign Abs_freeletter) xs)
proper_signed_list (x # xs)
proper_signed_list (x # ?xs) \<Longrightarrow> Abs_freeword (x # ?xs) = Abs_freeword [x] + Abs_freeword ?xs
binrelchain ?P (x # ?xs) \<Longrightarrow> binrelchain ?P ?xs

goal (1 subgoal):
 1. Abs_freeword (x # xs) = sum_list (map (apply_sign Abs_freeletter) (x # xs))
[PROOF STEP]
by (simp add: Abs_freeword_singleton_conv_apply_sign_freeletter)
[PROOF STATE]
proof (state)
this:
Abs_freeword (x # xs) = sum_list (map (apply_sign Abs_freeletter) (x # xs))

goal (1 subgoal):
 1. proper_signed_list [] \<Longrightarrow> Abs_freeword [] = sum_list (map (apply_sign Abs_freeletter) [])
[PROOF STEP]
qed (simp add: zero_freeword.abs_eq)


[STATEMENT]
lemma image_orthogonal_transformation_cball:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'a"
  assumes "orthogonal_transformation f"
  shows "f ` cball x r = cball (f x) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` cball x r = cball (f x) r
[PROOF STEP]
proof (intro equalityI subsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> f ` cball x r \<Longrightarrow> xa \<in> cball (f x) r
 2. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> f ` cball x r \<Longrightarrow> xa \<in> cball (f x) r
 2. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
assume "y \<in> f ` cball x r"
[PROOF STATE]
proof (state)
this:
y \<in> f ` cball x r

goal (2 subgoals):
 1. \<And>xa. xa \<in> f ` cball x r \<Longrightarrow> xa \<in> cball (f x) r
 2. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
orthogonal_transformation f
y \<in> f ` cball x r
[PROOF STEP]
show "y \<in> cball (f x) r"
[PROOF STATE]
proof (prove)
using this:
orthogonal_transformation f
y \<in> f ` cball x r

goal (1 subgoal):
 1. y \<in> cball (f x) r
[PROOF STEP]
by (auto simp: orthogonal_transformation_isometry)
[PROOF STATE]
proof (state)
this:
y \<in> cball (f x) r

goal (1 subgoal):
 1. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
assume y: "y \<in> cball (f x) r"
[PROOF STATE]
proof (state)
this:
y \<in> cball (f x) r

goal (1 subgoal):
 1. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> cball (f x) r
[PROOF STEP]
obtain z where z: "y = f z"
[PROOF STATE]
proof (prove)
using this:
y \<in> cball (f x) r

goal (1 subgoal):
 1. (\<And>z. y = f z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms orthogonal_transformation_surj
[PROOF STATE]
proof (prove)
using this:
y \<in> cball (f x) r
orthogonal_transformation f
orthogonal_transformation ?f \<Longrightarrow> surj ?f

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

goal (1 subgoal):
 1. \<And>xa. xa \<in> cball (f x) r \<Longrightarrow> xa \<in> f ` cball x r
[PROOF STEP]
with y assms
[PROOF STATE]
proof (chain)
picking this:
y \<in> cball (f x) r
orthogonal_transformation f
y = f z
[PROOF STEP]
show "y \<in> f ` cball x r"
[PROOF STATE]
proof (prove)
using this:
y \<in> cball (f x) r
orthogonal_transformation f
y = f z

goal (1 subgoal):
 1. y \<in> f ` cball x r
[PROOF STEP]
by (auto simp: orthogonal_transformation_isometry)
[PROOF STATE]
proof (state)
this:
y \<in> f ` cball x r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma radical_mult_coprime:
  assumes "coprime a b"
  shows   "radical (a * b) = radical a * radical b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. radical (a * b) = radical a * radical b
[PROOF STEP]
proof (cases "a = 0 \<or> b = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> radical (a * b) = radical a * radical b
 2. \<not> (a = (0::'a) \<or> b = (0::'a)) \<Longrightarrow> radical (a * b) = radical a * radical b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (a = (0::'a) \<or> b = (0::'a))

goal (2 subgoals):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> radical (a * b) = radical a * radical b
 2. \<not> (a = (0::'a) \<or> b = (0::'a)) \<Longrightarrow> radical (a * b) = radical a * radical b
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
coprime a b
\<not> (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
have "prime_factors a \<inter> prime_factors b = {}"
[PROOF STATE]
proof (prove)
using this:
coprime a b
\<not> (a = (0::'a) \<or> b = (0::'a))

goal (1 subgoal):
 1. prime_factors a \<inter> prime_factors b = {}
[PROOF STEP]
using not_prime_unit coprime_common_divisor
[PROOF STATE]
proof (prove)
using this:
coprime a b
\<not> (a = (0::'a) \<or> b = (0::'a))
is_unit ?x \<Longrightarrow> \<not> prime ?x
\<lbrakk>coprime ?a ?b; ?c dvd ?a; ?c dvd ?b\<rbrakk> \<Longrightarrow> is_unit ?c

goal (1 subgoal):
 1. prime_factors a \<inter> prime_factors b = {}
[PROOF STEP]
by (auto simp: prime_factors_dvd)
[PROOF STATE]
proof (state)
this:
prime_factors a \<inter> prime_factors b = {}

goal (2 subgoals):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> radical (a * b) = radical a * radical b
 2. \<not> (a = (0::'a) \<or> b = (0::'a)) \<Longrightarrow> radical (a * b) = radical a * radical b
[PROOF STEP]
hence "\<Prod>(prime_factors a \<union> prime_factors b) = \<Prod>(prime_factors a) * \<Prod>(prime_factors b)"
[PROOF STATE]
proof (prove)
using this:
prime_factors a \<inter> prime_factors b = {}

goal (1 subgoal):
 1. \<Prod>(prime_factors a \<union> prime_factors b) = \<Prod>(prime_factors a) * \<Prod>(prime_factors b)
[PROOF STEP]
by (intro prod.union_disjoint) auto
[PROOF STATE]
proof (state)
this:
\<Prod>(prime_factors a \<union> prime_factors b) = \<Prod>(prime_factors a) * \<Prod>(prime_factors b)

goal (2 subgoals):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> radical (a * b) = radical a * radical b
 2. \<not> (a = (0::'a) \<or> b = (0::'a)) \<Longrightarrow> radical (a * b) = radical a * radical b
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> (a = (0::'a) \<or> b = (0::'a))
\<Prod>(prime_factors a \<union> prime_factors b) = \<Prod>(prime_factors a) * \<Prod>(prime_factors b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (a = (0::'a) \<or> b = (0::'a))
\<Prod>(prime_factors a \<union> prime_factors b) = \<Prod>(prime_factors a) * \<Prod>(prime_factors b)

goal (1 subgoal):
 1. radical (a * b) = radical a * radical b
[PROOF STEP]
by (simp add: radical_def prime_factorization_mult)
[PROOF STATE]
proof (state)
this:
radical (a * b) = radical a * radical b

goal (1 subgoal):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> radical (a * b) = radical a * radical b
[PROOF STEP]
qed auto


[STATEMENT]
lemma sum_list_upt_zip:
  assumes "length xs = length ys"
  shows "(\<Sum>i\<leftarrow>[0..<(length ys)]. f (xs ! i) (ys ! i)) = (\<Sum>(x, y)\<leftarrow>(zip xs ys). f x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<leftarrow>[0..<length ys]. f (xs ! i) (ys ! i)) = sum_list (map2 f xs ys)
[PROOF STEP]
by (simp only: map_upt_zip[OF assms])


[STATEMENT]
lemma vfinite_vsubset:
  assumes "vfinite B" and "A \<subseteq>\<^sub>\<circ> B"
  shows "vfinite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfinite A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vfinite B
A \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. vfinite A
[PROOF STEP]
by (induct arbitrary: A rule: vfinite_induct)
    (simp_all add: less_eq_V_def finite_subset)


[STATEMENT]
lemma absolutely_integrable_mult_Fejer_kernel_reflected_part2:
  assumes f: "f absolutely_integrable_on {-pi..pi}"
    and periodic: "\<And>x. f(x + 2*pi) = f x" and "d \<le> pi"
  shows "(\<lambda>x. Fejer_kernel n x * f(t - x)) absolutely_integrable_on {0..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Fejer_kernel n x * f (t - x)) absolutely_integrable_on {0..d}
[PROOF STEP]
by (rule absolutely_integrable_on_subinterval [OF absolutely_integrable_mult_Fejer_kernel_reflected2]) (auto simp: assms)


[STATEMENT]
lemma divisor_count_upper_bound:
  fixes n :: nat
  shows "divisor_count n \<le> 2 * nat \<lfloor>sqrt n\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
 2. n \<noteq> 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
 2. n \<noteq> 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
have "divisor_count n \<le> 2 * card {d. d dvd n \<and> d \<le> sqrt n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_count n \<le> 2 * card {d. d dvd n \<and> real d \<le> sqrt (real n)}
[PROOF STEP]
by (rule divisor_count_upper_bound_aux)
[PROOF STATE]
proof (state)
this:
divisor_count n \<le> 2 * card {d. d dvd n \<and> real d \<le> sqrt (real n)}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
 2. n \<noteq> 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
divisor_count n \<le> 2 * card {d. d dvd n \<and> real d \<le> sqrt (real n)}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
 2. n \<noteq> 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
have "card {d. d dvd n \<and> d \<le> sqrt n} \<le> card {1..nat \<lfloor>sqrt n\<rfloor>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {d. d dvd n \<and> real d \<le> sqrt (real n)} \<le> card {1..nat \<lfloor>sqrt (real n)\<rfloor>}
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. card {d. d dvd n \<and> real d \<le> sqrt (real n)} \<le> card {1..nat \<lfloor>sqrt (real n)\<rfloor>}
[PROOF STEP]
by (intro card_mono) (auto simp: le_nat_iff le_floor_iff Suc_le_eq intro!: Nat.gr0I)
[PROOF STATE]
proof (state)
this:
card {d. d dvd n \<and> real d \<le> sqrt (real n)} \<le> card {1..nat \<lfloor>sqrt (real n)\<rfloor>}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
 2. n \<noteq> 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {d. d dvd n \<and> real d \<le> sqrt (real n)} \<le> card {1..nat \<lfloor>sqrt (real n)\<rfloor>}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
 2. n \<noteq> 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
have "\<dots> = nat \<lfloor>sqrt n\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {1..nat \<lfloor>sqrt (real n)\<rfloor>} = nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {1..nat \<lfloor>sqrt (real n)\<rfloor>} = nat \<lfloor>sqrt (real n)\<rfloor>

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
 2. n \<noteq> 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> 2 * x \<le> 2 * y) \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> 2 * x \<le> 2 * y) \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>

goal (1 subgoal):
 1. divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> divisor_count n \<le> 2 * nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
qed auto


[STATEMENT]
lemma tendsto_ln [tendsto_intros]: "(f \<longlongrightarrow> a) F \<Longrightarrow> a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. ln (f x)) \<longlongrightarrow> ln a) F"
  for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> a) F; a \<noteq> 0\<rbrakk> \<Longrightarrow> ((\<lambda>x. ln (f x)) \<longlongrightarrow> ln a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_ln])


[STATEMENT]
lemma inj_on_Abs_fset:
  "(\<And> X. X \<in> A \<Longrightarrow> finite X) \<Longrightarrow> inj_on Abs_fset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. X \<in> A \<Longrightarrow> finite X) \<Longrightarrow> inj_on Abs_fset A
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. X \<in> A \<Longrightarrow> finite X) \<Longrightarrow> \<forall>x\<in>A. \<forall>y\<in>A. Abs_fset x = Abs_fset y \<longrightarrow> x = y
[PROOF STEP]
by (auto simp add: Abs_fset_inject)


[STATEMENT]
lemma proots_count_of_root_set:
  assumes "P \<noteq> 0" "R \<subseteq> S" and "\<And>x. x\<in>R \<Longrightarrow> poly P x = 0"
  shows "proots_count P S \<ge> card R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card R \<le> proots_count P S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card R \<le> proots_count P S
[PROOF STEP]
have "card R \<le> card (proots_within P S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card R \<le> card (proots_within P S)
[PROOF STEP]
apply (rule card_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (proots_within P S)
 2. R \<subseteq> proots_within P S
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (proots_within P S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<noteq> 0
R \<subseteq> S
?x \<in> R \<Longrightarrow> poly P ?x = (0::'a)

goal (1 subgoal):
 1. finite (proots_within P S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<subseteq> proots_within P S
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<subseteq> proots_within P S
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> S
?x \<in> R \<Longrightarrow> poly P ?x = (0::'a)

goal (1 subgoal):
 1. R \<subseteq> proots_within P S
[PROOF STEP]
by (auto simp: proots_within_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
card R \<le> card (proots_within P S)

goal (1 subgoal):
 1. card R \<le> proots_count P S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card R \<le> card (proots_within P S)

goal (1 subgoal):
 1. card R \<le> proots_count P S
[PROOF STEP]
have "... \<le> proots_count P S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (proots_within P S) \<le> proots_count P S
[PROOF STEP]
by (rule card_proots_within_leq[OF assms(1)])
[PROOF STATE]
proof (state)
this:
card (proots_within P S) \<le> proots_count P S

goal (1 subgoal):
 1. card R \<le> proots_count P S
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card R \<le> proots_count P S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card R \<le> proots_count P S

goal (1 subgoal):
 1. card R \<le> proots_count P S
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card R \<le> proots_count P S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_real:
  fixes s :: "real set"
  shows "closed s \<longleftrightarrow> (\<forall>x. (\<forall>e>0.  \<exists>x' \<in> s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e) \<longrightarrow> x \<in> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed s = (\<forall>x. (\<forall>e>0. \<exists>x'\<in>s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e) \<longrightarrow> x \<in> s)
[PROOF STEP]
unfolding closed_limpt islimpt_approachable dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. (\<forall>e>0. \<exists>x'\<in>s. x' \<noteq> x \<and> norm (x' - x) < e) \<longrightarrow> x \<in> s) = (\<forall>x. (\<forall>e>0. \<exists>x'\<in>s. x' \<noteq> x \<and> \<bar>x' - x\<bar> < e) \<longrightarrow> x \<in> s)
[PROOF STEP]
by simp


[STATEMENT]
lemma lemma_4_3_1:
  assumes "set_pmf p \<subseteq> W" "integrable (measure_pmf p) w" "bounded ((w :: 'c \<Rightarrow> real) ` W)"
  shows "measure_pmf.expectation p w \<le> \<Squnion>(w ` W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation p w \<le> \<Squnion> (w ` W)
[PROOF STEP]
using assms bounded_has_Sup(1) prob_space_measure_pmf
[PROOF STATE]
proof (prove)
using this:
set_pmf p \<subseteq> W
integrable (measure_pmf p) w
bounded (w ` W)
\<lbrakk>bounded ?S; ?S \<noteq> {}\<rbrakk> \<Longrightarrow> \<forall>x\<in>?S. x \<le> \<Squnion> ?S
prob_space (measure_pmf ?p)

goal (1 subgoal):
 1. measure_pmf.expectation p w \<le> \<Squnion> (w ` W)
[PROOF STEP]
by (fastforce simp: AE_measure_pmf_iff intro!: prob_space.integral_le_const)


[STATEMENT]
lemma dims_Aw':
"dim_row Aw' = prod_list (nths (Tensor.dims Aw) {n. even n})"
"dim_col Aw' = prod_list (nths (Tensor.dims Aw) {n. odd n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row Aw' = prod_list (nths (dims Aw) (Collect even)) &&& dim_col Aw' = prod_list (nths (dims Aw) {n. odd n})
[PROOF STEP]
unfolding Aw'_def' Aw_def'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (A' witness_weights) = prod_list (nths (dims (A witness_weights)) (Collect even)) &&& dim_col (A' witness_weights) = prod_list (nths (dims (A witness_weights)) {n. odd n})
[PROOF STEP]
using dims_A'
[PROOF STATE]
proof (prove)
using this:
dim_row (A' ?ws) = prod_list (nths (dims (A ?ws)) (Collect even))
dim_col (A' ?ws) = prod_list (nths (dims (A ?ws)) {n. odd n})

goal (1 subgoal):
 1. dim_row (A' witness_weights) = prod_list (nths (dims (A witness_weights)) (Collect even)) &&& dim_col (A' witness_weights) = prod_list (nths (dims (A witness_weights)) {n. odd n})
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_less_omega [simp]: "ordinal_of_nat n < \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinal_of_nat n < \<omega>
[PROOF STEP]
apply (rule_tac y="ordinal_of_nat (Suc n)" in order_less_le_trans, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinal_of_nat (Suc n) \<le> \<omega>
[PROOF STEP]
apply (rule nat_le_omega)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma quat_norm_pow_2_alt: "quat_of_real(norm q) ^ 2 = cnj q * q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (quat_of_real (norm q))\<^sup>2 = Quaternions.cnj q * q
[PROOF STEP]
by (simp add: quat_mult_cnj_commute quat_norm_pow_2)


[STATEMENT]
lemma "!!a::int. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |]
      ==> a+a+a+a+a <= l+l+l+l+i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a + b + c + d \<le> i + j + k + l; a \<le> b; b \<le> c; c \<le> d; i \<le> j; j \<le> k; k \<le> l\<rbrakk> \<Longrightarrow> a + a + a + a + a \<le> l + l + l + l + i
[PROOF STEP]
by arith


[STATEMENT]
lemma lemma_interval: "a < x \<Longrightarrow> x < b \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>y. \<bar>x - y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b)"
  for a b x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>y. \<bar>x - y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b
[PROOF STEP]
by (force dest: lemma_interval_lt)


[STATEMENT]
lemma rel_nabla_prop: "rel_nabla R = {} \<longleftrightarrow> (\<forall>P. P \<subseteq> relfdia R P \<longrightarrow> P = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_nabla R = {}) = (\<forall>P. P \<subseteq> relfdia R P \<longrightarrow> P = {})
[PROOF STEP]
by (metis bot.extremum_uniqueI rel_nabla_coinduct_var rel_nabla_unfold)


[STATEMENT]
lemma sum_mset_image_mset_sum_mset_image_mset:
   "sum_mset (image_mset g (sum_mset (image_mset f A))) =
    sum_mset (image_mset (\<lambda>x. sum_mset (image_mset g (f x))) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset g (\<Sum>\<^sub># (image_mset f A))) = (\<Sum>x\<in>#A. \<Sum>\<^sub># (image_mset g (f x)))
[PROOF STEP]
by (induction A) auto


[STATEMENT]
lemma usc_at_mem:
  assumes "usc_at x0 f"
  assumes "x \<longlonglongrightarrow> x0"
  assumes "(f \<circ> x) \<longlonglongrightarrow> A"
  shows "f x0 \<ge> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<le> f x0
[PROOF STEP]
using assms usc_at_def[of x0 f]
[PROOF STATE]
proof (prove)
using this:
usc_at x0 f
x \<longlonglongrightarrow> x0
(f \<circ> x) \<longlonglongrightarrow> A
usc_at x0 f = (\<forall>X l. X \<longlonglongrightarrow> x0 \<and> (f \<circ> X) \<longlonglongrightarrow> l \<longrightarrow> l \<le> f x0)

goal (1 subgoal):
 1. A \<le> f x0
[PROOF STEP]
by blast


[STATEMENT]
lemma extend_Subspace_basis :
  "U \<subseteq> V \<Longrightarrow> basis_for U us \<Longrightarrow> \<exists>vs. basis_for V (vs@us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>U \<subseteq> V; set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us\<rbrakk> \<Longrightarrow> \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
using Span_contains_spanset extend_lin_independent_to_basis
[PROOF STATE]
proof (prove)
using this:
set ?ms \<subseteq> V \<Longrightarrow> set ?ms \<subseteq> RSpan ?ms
\<lbrakk>set ?us \<subseteq> V; R_lin_independent ?us\<rbrakk> \<Longrightarrow> \<exists>vs. set (vs @ ?us) \<subseteq> V \<and> V = RSpan (vs @ ?us) \<and> R_lin_independent (vs @ ?us)

goal (1 subgoal):
 1. \<lbrakk>U \<subseteq> V; set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us\<rbrakk> \<Longrightarrow> \<exists>vs. set (vs @ us) \<subseteq> V \<and> V = RSpan (vs @ us) \<and> R_lin_independent (vs @ us)
[PROOF STEP]
by fast


[STATEMENT]
lemma i_aggregate_commute: "
  \<lbrakk> 0 < a; 0 < b;
    \<And>xs. length xs mod a = 0 \<Longrightarrow> ag (f_aggregate xs a ag) = ag xs;
    \<And>xs. length xs mod b = 0 \<Longrightarrow> ag (f_aggregate xs b ag) = ag xs \<rbrakk> \<Longrightarrow>
  i_aggregate (i_aggregate xs a ag) b ag = i_aggregate (i_aggregate xs b ag) a ag"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; \<And>xs. length xs mod a = 0 \<Longrightarrow> ag (f_aggregate xs a ag) = ag xs; \<And>xs. length xs mod b = 0 \<Longrightarrow> ag (f_aggregate xs b ag) = ag xs\<rbrakk> \<Longrightarrow> i_aggregate (i_aggregate xs a ag) b ag = i_aggregate (i_aggregate xs b ag) a ag
[PROOF STEP]
by (simp add: i_aggregate_assoc mult.commute[of _ b])


[STATEMENT]
lemma L2_set_insert [simp]:
  "\<lbrakk>finite F; a \<notin> F\<rbrakk> \<Longrightarrow>
    L2_set f (insert a F) = sqrt ((f a)\<^sup>2 + (L2_set f F)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite F; a \<notin> F\<rbrakk> \<Longrightarrow> L2_set f (insert a F) = sqrt ((f a)\<^sup>2 + (L2_set f F)\<^sup>2)
[PROOF STEP]
unfolding L2_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite F; a \<notin> F\<rbrakk> \<Longrightarrow> sqrt (\<Sum>i\<in>insert a F. (f i)\<^sup>2) = sqrt ((f a)\<^sup>2 + (sqrt (\<Sum>i\<in>F. (f i)\<^sup>2))\<^sup>2)
[PROOF STEP]
by (simp add: sum_nonneg)


[STATEMENT]
lemma integral_measure_pmf_bind:
  assumes "(\<And>x. \<bar>(f :: 'b \<Rightarrow> real) x\<bar> \<le> B)"
  shows "(\<integral>x. f x \<partial>((measure_pmf M) \<bind> (\<lambda>x. measure_pmf (N x)))) = (\<integral>x. \<integral>y. f y \<partial>N x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (measure_pmf M \<bind> (\<lambda>x. measure_pmf (N x))) f = measure_pmf.expectation M (\<lambda>x. measure_pmf.expectation (N x) f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>f ?x\<bar> \<le> B

goal (1 subgoal):
 1. integral\<^sup>L (measure_pmf M \<bind> (\<lambda>x. measure_pmf (N x))) f = measure_pmf.expectation M (\<lambda>x. measure_pmf.expectation (N x) f)
[PROOF STEP]
by (subst integral_bind[of _ "count_space UNIV" B]) (auto simp: measure_pmf_in_subprob_space)


[STATEMENT]
lemma Digamma_real_mono: "(0::real) < x \<Longrightarrow> x \<le> y \<Longrightarrow> Digamma x \<le> Digamma y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<le> y\<rbrakk> \<Longrightarrow> Digamma x \<le> Digamma y
[PROOF STEP]
by (rule Polygamma_real_mono) simp_all


[STATEMENT]
lemma product_group_subgroup_generated:
  assumes "\<And>i. i \<in> I \<Longrightarrow> subgroup (H i) (G i)" and gp: "\<And>i. i \<in> I \<Longrightarrow> group (G i)"
  shows "product_group I (\<lambda>i. subgroup_generated (G i) (H i))
       = subgroup_generated (product_group I G) (PiE I H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_group I (\<lambda>i. subgroup_generated (G i) (H i)) = subgroup_generated (product_group I G) (Pi\<^sub>E I H)
[PROOF STEP]
proof (rule monoid.equality)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. carrier (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
have [simp]: "\<And>i. i \<in> I \<Longrightarrow> carrier (G i) \<inter> H i = H i" "(\<Pi>\<^sub>E i\<in>I. carrier (G i)) \<inter> Pi\<^sub>E I H = Pi\<^sub>E I H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> carrier (G i) \<inter> H i = H i) &&& (\<Pi>\<^sub>E i\<in>I. carrier (G i)) \<inter> Pi\<^sub>E I H = Pi\<^sub>E I H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> subgroup (H ?i) (G ?i)
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> carrier (G i) \<inter> H i = H i) &&& (\<Pi>\<^sub>E i\<in>I. carrier (G i)) \<inter> Pi\<^sub>E I H = Pi\<^sub>E I H
[PROOF STEP]
by (force simp: subgroup_def)+
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> carrier (G ?i) \<inter> H ?i = H ?i
(\<Pi>\<^sub>E i\<in>I. carrier (G i)) \<inter> Pi\<^sub>E I H = Pi\<^sub>E I H

goal (4 subgoals):
 1. carrier (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
have "(\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) = generate (product_group I G) (Pi\<^sub>E I H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) = generate (product_group I G) (Pi\<^sub>E I H)
[PROOF STEP]
proof (rule group.generateI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Group.group (product_group I G)
 2. subgroup (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) (product_group I G)
 3. Pi\<^sub>E I H \<subseteq> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i))
 4. \<And>K. \<lbrakk>subgroup K (product_group I G); Pi\<^sub>E I H \<subseteq> K\<rbrakk> \<Longrightarrow> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> K
[PROOF STEP]
show "Group.group (product_group I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (product_group I G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> subgroup (H ?i) (G ?i)
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. Group.group (product_group I G)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Group.group (product_group I G)

goal (3 subgoals):
 1. subgroup (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) (product_group I G)
 2. Pi\<^sub>E I H \<subseteq> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i))
 3. \<And>K. \<lbrakk>subgroup K (product_group I G); Pi\<^sub>E I H \<subseteq> K\<rbrakk> \<Longrightarrow> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> K
[PROOF STEP]
show "subgroup (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) (product_group I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) (product_group I G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> subgroup (H ?i) (G ?i)
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. subgroup (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) (product_group I G)
[PROOF STEP]
by (simp add: PiE_subgroup_product_group group.generate_is_subgroup subgroup.subset)
[PROOF STATE]
proof (state)
this:
subgroup (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) (product_group I G)

goal (2 subgoals):
 1. Pi\<^sub>E I H \<subseteq> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i))
 2. \<And>K. \<lbrakk>subgroup K (product_group I G); Pi\<^sub>E I H \<subseteq> K\<rbrakk> \<Longrightarrow> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> K
[PROOF STEP]
show "Pi\<^sub>E I H \<subseteq> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>E I H \<subseteq> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> subgroup (H ?i) (G ?i)
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. Pi\<^sub>E I H \<subseteq> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i))
[PROOF STEP]
by (auto simp: PiE_iff generate.incl)
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E I H \<subseteq> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i))

goal (1 subgoal):
 1. \<And>K. \<lbrakk>subgroup K (product_group I G); Pi\<^sub>E I H \<subseteq> K\<rbrakk> \<Longrightarrow> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> K
[PROOF STEP]
show "(\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> K"
      if "subgroup K (product_group I G)" "Pi\<^sub>E I H \<subseteq> K" for K
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> K
[PROOF STEP]
using assms that group.generate_subgroup_incl
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> subgroup (H ?i) (G ?i)
?i \<in> I \<Longrightarrow> Group.group (G ?i)
subgroup K (product_group I G)
Pi\<^sub>E I H \<subseteq> K
\<lbrakk>Group.group ?G; ?K \<subseteq> ?H; subgroup ?H ?G\<rbrakk> \<Longrightarrow> generate ?G ?K \<subseteq> ?H

goal (1 subgoal):
 1. (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> K
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>subgroup ?K (product_group I G); Pi\<^sub>E I H \<subseteq> ?K\<rbrakk> \<Longrightarrow> (\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) \<subseteq> ?K

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) = generate (product_group I G) (Pi\<^sub>E I H)

goal (4 subgoals):
 1. carrier (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> subgroup (H ?i) (G ?i)
?i \<in> I \<Longrightarrow> Group.group (G ?i)
(\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) = generate (product_group I G) (Pi\<^sub>E I H)
[PROOF STEP]
show "carrier (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) =
        carrier (subgroup_generated (product_group I G) (Pi\<^sub>E I H))"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> subgroup (H ?i) (G ?i)
?i \<in> I \<Longrightarrow> Group.group (G ?i)
(\<Pi>\<^sub>E i\<in>I. generate (G i) (H i)) = generate (product_group I G) (Pi\<^sub>E I H)

goal (1 subgoal):
 1. carrier (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
by (simp add: carrier_subgroup_generated cong: PiE_cong)
[PROOF STATE]
proof (state)
this:
carrier (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (product_group I G) (Pi\<^sub>E I H))

goal (3 subgoals):
 1. (\<otimes>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>)
 2. \<one>\<^bsub>product_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (product_group I G) (Pi\<^sub>E I H)\<^esub>
 3. monoid.more (product_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (product_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
qed auto


[STATEMENT]
lemma integrable_diff[simp, intro]: "integrable M f \<Longrightarrow> integrable M g \<Longrightarrow> integrable M (\<lambda>x. f x - g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. f x - g x)
[PROOF STEP]
by (auto simp: integrable.simps intro: has_bochner_integral_diff)


[STATEMENT]
lemma Limit_eq_Sup_self [simp]: "Limit i \<Longrightarrow> Sup (elts i) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limit i \<Longrightarrow> \<Squnion> elts i = i
[PROOF STEP]
apply (rule order_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Limit i \<Longrightarrow> \<Squnion> elts i \<le> i
 2. Limit i \<Longrightarrow> i \<le> \<Squnion> elts i
[PROOF STEP]
apply (simp add: Limit_def Ord_def Transset_def Sup_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limit i \<Longrightarrow> i \<le> \<Squnion> elts i
[PROOF STEP]
by (metis Limit_def Ord_equality Sup_V_def SUP_le_iff Sup_upper small_elts)


[STATEMENT]
lemma iT_Minus_Plus_commute: "n \<le> k \<Longrightarrow> k \<ominus> (I \<oplus> n) = (k - n) \<ominus> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> k \<Longrightarrow> k \<ominus> (I \<oplus> n) = k - n \<ominus> I
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. n \<le> k \<Longrightarrow> (x \<in> k \<ominus> (I \<oplus> n)) = (x \<in> k - n \<ominus> I)
[PROOF STEP]
apply (simp add: iT_Minus_image_conv iT_Plus_image_conv image_iff Bex_def i_cut_mem_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. n \<le> k \<Longrightarrow> (\<exists>xa. (\<exists>x. x \<in> I \<and> xa = x + n) \<and> xa \<le> k \<and> x = k - xa) = (\<exists>xa. xa \<in> I \<and> xa \<le> k - n \<and> x = k - (n + xa))
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_coeff:
  assumes "ppos a"
      and "ppos b"
    shows "padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite
[PROOF STEP]
let ?a = "Rep_prat a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite
[PROOF STEP]
let ?b = "Rep_prat b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite
[PROOF STEP]
have "(?a / (?a + ?b)) + (?b / (?a + ?b)) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_prat a / (Rep_prat a + Rep_prat b) + Rep_prat b / (Rep_prat a + Rep_prat b) = 1
[PROOF STEP]
by (metis add_divide_distrib add_pos_pos assms(1) assms(2) less_irrefl ppos.rep_eq right_inverse_eq)
[PROOF STATE]
proof (state)
this:
Rep_prat a / (Rep_prat a + Rep_prat b) + Rep_prat b / (Rep_prat a + Rep_prat b) = 1

goal (1 subgoal):
 1. padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Rep_prat a / (Rep_prat a + Rep_prat b) + Rep_prat b / (Rep_prat a + Rep_prat b) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Rep_prat a / (Rep_prat a + Rep_prat b) + Rep_prat b / (Rep_prat a + Rep_prat b) = 1

goal (1 subgoal):
 1. padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite
[PROOF STEP]
by (metis Rep_prat_inject padd.rep_eq pdiv.rep_eq pwrite.rep_eq)
[PROOF STATE]
proof (state)
this:
padd (pdiv a (padd a b)) (pdiv b (padd a b)) = pwrite

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma GreenThm_typeI_divisible:
  assumes gen_division: "gen_division s (cubeImage ` two_chain)"
  shows "integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F(a) \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
let ?F_b' = "partial_vector_derivative (\<lambda>a. F(a) \<bullet> i) j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
have "integral s (\<lambda>x. - ?F_b' x) = two_chain_integral two_chain (\<lambda>a. - ?F_b' a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = two_chain_integral two_chain (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)
[PROOF STEP]
proof (simp add: two_chain_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = (\<Sum>C\<in>two_chain. - integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))
[PROOF STEP]
have "(\<Sum>f\<in>two_chain. integral (cubeImage f) (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)) = integral s (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>f\<in>two_chain. integral (cubeImage f) (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)) = integral s (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)
[PROOF STEP]
by (metis analytically_valid_imp_part_deriv_integrable_on F_anal_valid gen_division two_chain_integral_def two_chain_integral_eq_integral_divisable valid_typeI_div)
[PROOF STATE]
proof (state)
this:
(\<Sum>f\<in>two_chain. integral (cubeImage f) (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)) = integral s (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)

goal (1 subgoal):
 1. - integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = (\<Sum>C\<in>two_chain. - integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>f\<in>two_chain. integral (cubeImage f) (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)) = integral s (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)
[PROOF STEP]
show "- integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = (\<Sum>C\<in>two_chain. - integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>f\<in>two_chain. integral (cubeImage f) (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)) = integral s (partial_vector_derivative (\<lambda>p. F p \<bullet> i) j)

goal (1 subgoal):
 1. - integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = (\<Sum>C\<in>two_chain. - integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))
[PROOF STEP]
by (simp add: sum_negf)
[PROOF STATE]
proof (state)
this:
- integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j) = (\<Sum>C\<in>two_chain. - integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = two_chain_integral two_chain (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = two_chain_integral two_chain (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = two_chain_integral two_chain (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
using GreenThm_typeI_two_chain assms
[PROOF STATE]
proof (prove)
using this:
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = two_chain_integral two_chain (\<lambda>a. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j a)
two_chain_integral two_chain (\<lambda>a. - partial_vector_derivative (\<lambda>x. F x \<bullet> i) j a) = one_chain_line_integral F {i} (two_chain_boundary two_chain)
gen_division s (cubeImage ` two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem obtain_complete:
    obtains TAC::"('Q set option,'L) tree_automaton_rec" where
    "ta_lang TAC = ta_lang TA"
    "complete_tree_automaton TAC A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>TAC. \<lbrakk>ta_lang TAC = ta_lang TA; complete_tree_automaton TAC A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>TAC. \<lbrakk>ta_lang TAC = ta_lang TA; complete_tree_automaton TAC A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from detTA_correct
[PROOF STATE]
proof (chain)
picking this:
det_tree_automaton detTA A
ta_lang detTA = ta_lang TA
[PROOF STEP]
have
      DT: "det_tree_automaton detTA A" and
      [simp]: "ta_lang detTA = ta_lang TA"
[PROOF STATE]
proof (prove)
using this:
det_tree_automaton detTA A
ta_lang detTA = ta_lang TA

goal (1 subgoal):
 1. det_tree_automaton detTA A &&& ta_lang detTA = ta_lang TA
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
det_tree_automaton detTA A
ta_lang detTA = ta_lang TA

goal (1 subgoal):
 1. (\<And>TAC. \<lbrakk>ta_lang TAC = ta_lang TA; complete_tree_automaton TAC A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
interpret dt: det_tree_automaton detTA A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det_tree_automaton detTA A
[PROOF STEP]
using DT
[PROOF STATE]
proof (prove)
using this:
det_tree_automaton detTA A

goal (1 subgoal):
 1. det_tree_automaton detTA A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>TAC. \<lbrakk>ta_lang TAC = ta_lang TA; complete_tree_automaton TAC A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from dt.completeTA_correct
[PROOF STATE]
proof (chain)
picking this:
complete_tree_automaton dt.completeTA A
ta_lang dt.completeTA = ta_lang detTA
[PROOF STEP]
have G:
      "ta_lang (det_tree_automaton.completeTA detTA A) = ta_lang TA"
      "complete_tree_automaton (det_tree_automaton.completeTA detTA A) A"
[PROOF STATE]
proof (prove)
using this:
complete_tree_automaton dt.completeTA A
ta_lang dt.completeTA = ta_lang detTA

goal (1 subgoal):
 1. ta_lang dt.completeTA = ta_lang TA &&& complete_tree_automaton dt.completeTA A
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
ta_lang dt.completeTA = ta_lang TA
complete_tree_automaton dt.completeTA A

goal (1 subgoal):
 1. (\<And>TAC. \<lbrakk>ta_lang TAC = ta_lang TA; complete_tree_automaton TAC A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ta_lang dt.completeTA = ta_lang TA
complete_tree_automaton dt.completeTA A

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (blast intro: that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cis_cnj: "cnj (cis t) = cis (-t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (cis t) = cis (- t)
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma cauchy_schwarz_eq [simp]:
  assumes "v = (l \<cdot>\<^sub>v w)"
  shows "(cmod(\<langle>v|w\<rangle>))\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)
[PROOF STEP]
have "cmod(\<langle>v|w\<rangle>) = cmod(cnj(l) * \<langle>w|w\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod \<langle>v|w\<rangle> = cmod (cnj l * \<langle>w|w\<rangle>)
[PROOF STEP]
using assms inner_prod_distrib_left[of "w" "w" "l"]
[PROOF STATE]
proof (prove)
using this:
v = l \<cdot>\<^sub>v w
dim_vec w = dim_vec w \<Longrightarrow> \<langle>l \<cdot>\<^sub>v w|w\<rangle> = cnj l * \<langle>w|w\<rangle>

goal (1 subgoal):
 1. cmod \<langle>v|w\<rangle> = cmod (cnj l * \<langle>w|w\<rangle>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod \<langle>v|w\<rangle> = cmod (cnj l * \<langle>w|w\<rangle>)

goal (1 subgoal):
 1. (cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod \<langle>v|w\<rangle> = cmod (cnj l * \<langle>w|w\<rangle>)
[PROOF STEP]
have "cmod(\<langle>v|w\<rangle>)^2 = cmod(l)^2 * \<langle>w|w\<rangle> * \<langle>w|w\<rangle>"
[PROOF STATE]
proof (prove)
using this:
cmod \<langle>v|w\<rangle> = cmod (cnj l * \<langle>w|w\<rangle>)

goal (1 subgoal):
 1. complex_of_real ((cmod \<langle>v|w\<rangle>)\<^sup>2) = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle> * \<langle>w|w\<rangle>
[PROOF STEP]
using complex_norm_square inner_prod_cnj[of "w" "w"]
[PROOF STATE]
proof (prove)
using this:
cmod \<langle>v|w\<rangle> = cmod (cnj l * \<langle>w|w\<rangle>)
complex_of_real ((cmod ?z)\<^sup>2) = ?z * cnj ?z
dim_vec w = dim_vec w \<Longrightarrow> \<langle>w|w\<rangle> = cnj \<langle>w|w\<rangle>

goal (1 subgoal):
 1. complex_of_real ((cmod \<langle>v|w\<rangle>)\<^sup>2) = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle> * \<langle>w|w\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real ((cmod \<langle>v|w\<rangle>)\<^sup>2) = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle> * \<langle>w|w\<rangle>

goal (1 subgoal):
 1. (cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
complex_of_real ((cmod \<langle>v|w\<rangle>)\<^sup>2) = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle> * \<langle>w|w\<rangle>

goal (1 subgoal):
 1. (cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)
[PROOF STEP]
have "\<langle>v|v\<rangle> = cmod(l)^2 * \<langle>w|w\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>v|v\<rangle> = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle>
[PROOF STEP]
using assms complex_norm_square inner_prod_distrib_left[of "w" "v" "l"]
inner_prod_distrib_right[of "w" "w" "l"]
[PROOF STATE]
proof (prove)
using this:
v = l \<cdot>\<^sub>v w
complex_of_real ((cmod ?z)\<^sup>2) = ?z * cnj ?z
dim_vec w = dim_vec v \<Longrightarrow> \<langle>l \<cdot>\<^sub>v w|v\<rangle> = cnj l * \<langle>w|v\<rangle>
dim_vec w = dim_vec w \<Longrightarrow> \<langle>w|l \<cdot>\<^sub>v w\<rangle> = l * \<langle>w|w\<rangle>

goal (1 subgoal):
 1. \<langle>v|v\<rangle> = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<langle>v|v\<rangle> = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle>

goal (1 subgoal):
 1. (cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
complex_of_real ((cmod \<langle>v|w\<rangle>)\<^sup>2) = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle> * \<langle>w|w\<rangle>
\<langle>v|v\<rangle> = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
complex_of_real ((cmod \<langle>v|w\<rangle>)\<^sup>2) = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle> * \<langle>w|w\<rangle>
\<langle>v|v\<rangle> = complex_of_real ((cmod l)\<^sup>2) * \<langle>w|w\<rangle>

goal (1 subgoal):
 1. (cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)
[PROOF STEP]
by (metis Re_complex_of_real)
[PROOF STATE]
proof (state)
this:
(cmod \<langle>v|w\<rangle>)\<^sup>2 = Re (\<langle>v|v\<rangle> * \<langle>w|w\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_divide_lower:
  fixes q :: "'a::floor_ceiling"
  shows "q > 0 \<Longrightarrow> (of_int \<lceil>p / q\<rceil> - 1) * q < p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < q \<Longrightarrow> (of_int \<lceil>p / q\<rceil> - (1::'a)) * q < p
[PROOF STEP]
by (meson ceiling_eq_iff pos_less_divide_eq)


[STATEMENT]
lemma ntcf_lcomp_Hom_component_ArrVal_vdomain[cat_cs_simps]:
  assumes "\<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>" and "b \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>"
  shows "\<D>\<^sub>\<circ> (ntcf_lcomp_Hom_component \<phi> a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (ntcf_lcomp_Hom_component \<phi> a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (ntcf_lcomp_Hom_component \<phi> a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b
[PROOF STEP]
interpret \<phi>: is_ntcf \<alpha> \<AA> \<CC> \<FF> \<GG> \<phi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (ntcf_lcomp_Hom_component \<phi> a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (ntcf_lcomp_Hom_component \<phi> a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
b \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (ntcf_lcomp_Hom_component \<phi> a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b
[PROOF STEP]
unfolding ntcf_lcomp_Hom_component_def \<phi>.ntcf_NTDGCod
[PROOF STATE]
proof (prove)
using this:
\<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
b \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (ntcf_Hom_component \<phi> (ntcf_id (dghm_id \<CC>)) a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b
[PROOF STEP]
by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (ntcf_lcomp_Hom_component \<phi> a b\<lparr>ArrVal\<rparr>) = Hom \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>) b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_frontier_eq_empty:
    fixes S :: "'n::euclidean_space set"
    shows "rel_frontier S = {} \<longleftrightarrow> affine S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_frontier S = {}) = affine S
[PROOF STEP]
unfolding rel_frontier_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (closure S - rel_interior S = {}) = affine S
[PROOF STEP]
using rel_interior_subset_closure
[PROOF STATE]
proof (prove)
using this:
rel_interior ?S \<subseteq> closure ?S

goal (1 subgoal):
 1. (closure S - rel_interior S = {}) = affine S
[PROOF STEP]
by (auto simp add: rel_interior_eq_closure [symmetric])


[STATEMENT]
lemma (in group) set_mult_union:
  "A <#> (B \<union> C) = (A <#> B) \<union> (A <#> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A <#> B \<union> C = (A <#> B) \<union> (A <#> C)
[PROOF STEP]
unfolding set_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>h\<in>A. \<Union>k\<in>B \<union> C. {h \<otimes> k}) = (\<Union>h\<in>A. \<Union>k\<in>B. {h \<otimes> k}) \<union> (\<Union>h\<in>A. \<Union>k\<in>C. {h \<otimes> k})
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_divide_unit_factor_both:
  fixes   f g :: "'a::division_ring fps"
  assumes "subdegree g \<le> subdegree f"
  shows   "unit_factor f / unit_factor g = unit_factor (f / g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor f / unit_factor g = unit_factor (f / g)
[PROOF STEP]
using   assms fps_divide_unit_factor_both'[of g f] fps_divide_subdegree[of f g]
[PROOF STATE]
proof (prove)
using this:
subdegree g \<le> subdegree f
subdegree g \<le> subdegree f \<Longrightarrow> unit_factor f / unit_factor g = fps_shift (subdegree f - subdegree g) (f / g)
\<lbrakk>f \<noteq> 0; g \<noteq> 0; subdegree g \<le> subdegree f\<rbrakk> \<Longrightarrow> subdegree (f / g) = subdegree f - subdegree g

goal (1 subgoal):
 1. unit_factor f / unit_factor g = unit_factor (f / g)
[PROOF STEP]
by      (cases "f=0 \<or> g=0") auto


[STATEMENT]
lemma finite_enumerate_step: "\<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> enumerate S n < enumerate S (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n)
[PROOF STEP]
proof (induction n arbitrary: S)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>finite S; Suc 0 < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)
 2. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
finite S
Suc 0 < card S

goal (2 subgoals):
 1. \<And>S. \<lbrakk>finite S; Suc 0 < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)
 2. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S
Suc 0 < card S
[PROOF STEP]
have "enumerate S 0 \<le> enumerate S (Suc 0)"
[PROOF STATE]
proof (prove)
using this:
finite S
Suc 0 < card S

goal (1 subgoal):
 1. wellorder_class.enumerate S 0 \<le> wellorder_class.enumerate S (Suc 0)
[PROOF STEP]
by (simp add: Least_le enumerate.simps(1) finite_enumerate_in_set)
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate S 0 \<le> wellorder_class.enumerate S (Suc 0)

goal (2 subgoals):
 1. \<And>S. \<lbrakk>finite S; Suc 0 < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)
 2. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate S 0 \<le> wellorder_class.enumerate S (Suc 0)

goal (2 subgoals):
 1. \<And>S. \<lbrakk>finite S; Suc 0 < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)
 2. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
have "enumerate (S - {enumerate S 0}) 0 \<in> S - {enumerate S 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0 \<in> S - {wellorder_class.enumerate S 0}
[PROOF STEP]
by (metis 0 Suc_lessD Suc_less_eq card_Suc_Diff1 enumerate_in_set finite_enumerate_in_set)
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0 \<in> S - {wellorder_class.enumerate S 0}

goal (2 subgoals):
 1. \<And>S. \<lbrakk>finite S; Suc 0 < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)
 2. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0 \<in> S - {wellorder_class.enumerate S 0}
[PROOF STEP]
have "enumerate S 0 \<noteq> enumerate (S - {enumerate S 0}) 0"
[PROOF STATE]
proof (prove)
using this:
wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0 \<in> S - {wellorder_class.enumerate S 0}

goal (1 subgoal):
 1. wellorder_class.enumerate S 0 \<noteq> wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate S 0 \<noteq> wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0

goal (2 subgoals):
 1. \<And>S. \<lbrakk>finite S; Suc 0 < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)
 2. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wellorder_class.enumerate S 0 \<le> wellorder_class.enumerate S (Suc 0)
wellorder_class.enumerate S 0 \<noteq> wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
wellorder_class.enumerate S 0 \<le> wellorder_class.enumerate S (Suc 0)
wellorder_class.enumerate S 0 \<noteq> wellorder_class.enumerate (S - {wellorder_class.enumerate S 0}) 0

goal (1 subgoal):
 1. wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)
[PROOF STEP]
by (simp add: enumerate_Suc')
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate S 0 < wellorder_class.enumerate S (Suc 0)

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite ?S; Suc n < card ?S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate ?S n < wellorder_class.enumerate ?S (Suc n)
finite S
Suc (Suc n) < card S

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. \<lbrakk>finite S; Suc n < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S n < wellorder_class.enumerate S (Suc n); finite S; Suc (Suc n) < card S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite ?S; Suc n < card ?S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate ?S n < wellorder_class.enumerate ?S (Suc n)
finite S
Suc (Suc n) < card S
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?S; Suc n < card ?S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate ?S n < wellorder_class.enumerate ?S (Suc n)
finite S
Suc (Suc n) < card S

goal (1 subgoal):
 1. wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))
[PROOF STEP]
by (simp add: enumerate_Suc' finite_enumerate_in_set)
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate S (Suc n) < wellorder_class.enumerate S (Suc (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvds_eq_abseq:
  fixes k :: int
  shows "l dvd k \<and> k dvd l \<longleftrightarrow> \<bar>l\<bar> = \<bar>k\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l dvd k \<and> k dvd l) = (\<bar>l\<bar> = \<bar>k\<bar>)
[PROOF STEP]
by (metis dvd_if_abs_eq lcm.commute lcm_proj1_iff_int)


[STATEMENT]
lemma basis_card_eq_dim: "B \<subseteq> V \<Longrightarrow> V \<subseteq> span B \<Longrightarrow> independent B \<Longrightarrow> card B = dim V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> V; V \<subseteq> span B; independent B\<rbrakk> \<Longrightarrow> card B = dim V
[PROOF STEP]
using dim_eq_card[of B V] span_mono[of B V] span_minimal[OF _ subspace_span, of V B]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>span B = span V; independent B\<rbrakk> \<Longrightarrow> dim V = card B
B \<subseteq> V \<Longrightarrow> span B \<subseteq> span V
V \<subseteq> span B \<Longrightarrow> span V \<subseteq> span B

goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> V; V \<subseteq> span B; independent B\<rbrakk> \<Longrightarrow> card B = dim V
[PROOF STEP]
by auto


[STATEMENT]
lemma unit_ball_vol_0 [simp]: "unit_ball_vol 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_ball_vol 0 = 1
[PROOF STEP]
using unit_ball_vol_even[of 0]
[PROOF STATE]
proof (prove)
using this:
unit_ball_vol (real (2 * 0)) = pi ^ 0 / fact 0

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