[STATEMENT]
lemma bouncing_ball_dyn: "g < 0 \<Longrightarrow> h \<ge> 0 \<Longrightarrow>
  (\<lambda>s. s$1 = h \<and> s$2 = 0) \<le>
  |LOOP (
    (EVOL (\<phi> g) (\<lambda> s. s$1 \<ge> 0) T) ;
    (IF (\<lambda> s. s$1 = 0) THEN (2 ::= (\<lambda>s. - s$2)) ELSE skip))
  INV (\<lambda>s. 0 \<le> s$1 \<and>2 * g * s$1 = 2 * g * h + s$2 * s$2)]
  (\<lambda>s. 0 \<le> s$1 \<and> s$1 \<le> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> (\<lambda>s. s $ 1 = h \<and> s $ 2 = 0) \<le> |LOOP EVOL (\<lambda>t s. \<chi>i. if i = 1 then g * t\<^sup>2 / 2 + s $ 2 * t + s $ 1 else g * t + s $ 2) (\<lambda>s. 0 \<le> s $ 1) T ; (IF (\<lambda>s. s $ 1 = 0) THEN (2 ::= (\<lambda>s. - s $ 2)) ELSE skip) INV (\<lambda>s. 0 \<le> s $ 1 \<and> 2 * g * s $ 1 = 2 * g * h + s $ 2 * s $ 2) ] (\<lambda>s. 0 \<le> s $ 1 \<and> s $ 1 \<le> h)
[PROOF STEP]
by (rule fbox_loopI) (auto simp: bb_real_arith)

\<comment> \<open>Verified with the flow. \<close>


[STATEMENT]
lemma bigo_const_mult2: "O(\<lambda>x. c * f x) \<le> O(f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O(\<lambda>x. c * f x) \<subseteq> O(f)
[PROOF STEP]
by (rule bigo_elt_subset, rule bigo_const_mult1)


[STATEMENT]
lemma of_bool_square: "(of_bool x)\<^sup>2 = ((of_bool x)::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_bool x)\<^sup>2 = of_bool x
[PROOF STEP]
by (cases x, auto)


[STATEMENT]
lemma lookup_pm_of_idx_pm:
  "lookup (pm_of_idx_pm xs f) = (\<lambda>x. lookup f (Min {i. i < length xs \<and> xs ! i = x}) when x \<in> set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (pm_of_idx_pm xs f) = (\<lambda>x. lookup f (Min {i. i < length xs \<and> xs ! i = x}) when x \<in> set xs)
[PROOF STEP]
unfolding pm_of_idx_pm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (Abs_poly_mapping (\<lambda>x. lookup f (Min {i. i < length xs \<and> xs ! i = x}) when x \<in> set xs)) = (\<lambda>x. lookup f (Min {i. i < length xs \<and> xs ! i = x}) when x \<in> set xs)
[PROOF STEP]
by (rule Abs_poly_mapping_inverse, simp)


[STATEMENT]
lemma is_zariski_open_empty [simp]: "is_zariski_open {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zariski_open {}
[PROOF STEP]
using UNIV is_zariski_open_def generated_topology_is_topology topological_space.open_empty
[PROOF STATE]
proof (prove)
using this:
generated_topology ?S ?B ?S
is_zariski_open ?U \<equiv> generated_topology Spec {U. \<exists>\<aa>. ideal \<aa> R (+) (\<cdot>) \<zero> \<one> \<and> U = Spec\<setminus>\<V> \<aa>} ?U
topological_space ?S (generated_topology ?S ?B)
topological_space ?S ?is_open \<Longrightarrow> ?is_open {}

goal (1 subgoal):
 1. is_zariski_open {}
[PROOF STEP]
by simp


[STATEMENT]
lemma intersperseE:
  assumes "\<sigma> permutes ({..<n})"
  assumes "length as + length bs = n"
  shows "length (intersperse \<sigma> as bs) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (intersperse \<sigma> as bs) = n
[PROOF STEP]
by (metis assms(2) intersperse_def length_append length_permute_list)


[STATEMENT]
lemma is_aligned_to_bl:
  "is_aligned (w :: 'a :: len word) n = (True \<notin> set (drop (size w - n) (to_bl w)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_aligned w n = (True \<notin> set (drop (size w - n) (to_bl w)))
[PROOF STEP]
by (simp add: is_aligned_mask eq_zero_set_bl bl_and_mask word_size)


[STATEMENT]
lemma abs_moebius_mu: "abs (moebius_mu n :: 'a :: linordered_idom) = ind squarefree n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>moebius_mu n\<bar> = ind squarefree n
[PROOF STEP]
by (auto simp: ind_def moebius_mu_def)


[STATEMENT]
lemma inorder_update_splay:
  "sorted1(inorder t) \<Longrightarrow> inorder(update x y t) = upd_list x y (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted1 (inorder t) \<Longrightarrow> inorder (update x y t) = upd_list x y (inorder t)
[PROOF STEP]
using inorder_splay[of x t, symmetric] sorted_splay[of t x]
[PROOF STATE]
proof (prove)
using this:
inorder t = inorder (Splay_Map.splay x t)
\<lbrakk>sorted1 (inorder t); Splay_Map.splay x t = \<langle>?l, ?a, ?r\<rangle>\<rbrakk> \<Longrightarrow> Sorted_Less.sorted (map fst (inorder ?l) @ x # map fst (inorder ?r))

goal (1 subgoal):
 1. sorted1 (inorder t) \<Longrightarrow> inorder (update x y t) = upd_list x y (inorder t)
[PROOF STEP]
by(auto simp: upd_list_simps upd_list_Cons upd_list_snoc neq_Leaf_iff split: tree.split)


[STATEMENT]
lemma mtx_circ_flow_eq: "exp (t *\<^sub>R A) *\<^sub>V s = \<phi> t s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (t *\<^sub>R A) *\<^sub>V s = \<phi> t s
[PROOF STEP]
apply(rule local_flow.eq_solution[OF local_flow_sq_mtx_linear, symmetric, of _ "\<lambda>s. UNIV"], simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. \<phi> a s) \<in> Sols (\<lambda>t. (*\<^sub>V) A) (\<lambda>s. UNIV) UNIV 0 s
[PROOF STEP]
apply(rule ivp_solsI, simp_all add: sq_mtx_vec_mult_eq vec_eq_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>i. (i = 2 \<longrightarrow>  D (\<lambda>x. s $ 2 * cos x - s $ 1 * sin x) = (\<lambda>x. \<Sum>j\<in>UNIV. (if j = 1 then - 1 else ((\<lambda>x. 0)(2 := 0)) j) * (if j = 1 then s $ 1 * cos x + s $ 2 * sin x else - s $ 1 * sin x + s $ 2 * cos x)) on UNIV) \<and> (i \<noteq> 2 \<longrightarrow> (i = 1 \<longrightarrow>  D (\<lambda>x. s $ 1 * cos x + s $ 2 * sin x) = (\<lambda>x. \<Sum>j\<in>UNIV. (if j = 1 then 0 else ((\<lambda>x. 0)(2 := 1)) j) * (if j = 1 then s $ 1 * cos x + s $ 2 * sin x else - s $ 1 * sin x + s $ 2 * cos x)) on UNIV) \<and> (i \<noteq> 1 \<longrightarrow>  D (\<lambda>x. s $ 2 * cos x - s $ 1 * sin x) = (\<lambda>x. 0) on UNIV))
 2. \<forall>i. i \<noteq> 1 \<longrightarrow> s $ 2 = s $ i
[PROOF STEP]
unfolding UNIV_2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>i. (i = 2 \<longrightarrow>  D (\<lambda>x. s $ 2 * cos x - s $ 1 * sin x) = (\<lambda>x. \<Sum>j\<in>insert 1 (skip 2). (if j = 1 then - 1 else ((\<lambda>x. 0)(2 := 0)) j) * (if j = 1 then s $ 1 * cos x + s $ 2 * sin x else - s $ 1 * sin x + s $ 2 * cos x)) on UNIV) \<and> (i \<noteq> 2 \<longrightarrow> (i = 1 \<longrightarrow>  D (\<lambda>x. s $ 1 * cos x + s $ 2 * sin x) = (\<lambda>x. \<Sum>j\<in>insert 1 (skip 2). (if j = 1 then 0 else ((\<lambda>x. 0)(2 := 1)) j) * (if j = 1 then s $ 1 * cos x + s $ 2 * sin x else - s $ 1 * sin x + s $ 2 * cos x)) on UNIV) \<and> (i \<noteq> 1 \<longrightarrow>  D (\<lambda>x. s $ 2 * cos x - s $ 1 * sin x) = (\<lambda>x. 0) on UNIV))
 2. \<forall>i. i \<noteq> 1 \<longrightarrow> s $ 2 = s $ i
[PROOF STEP]
using exhaust_2
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2

goal (2 subgoals):
 1. \<forall>i. (i = 2 \<longrightarrow>  D (\<lambda>x. s $ 2 * cos x - s $ 1 * sin x) = (\<lambda>x. \<Sum>j\<in>insert 1 (skip 2). (if j = 1 then - 1 else ((\<lambda>x. 0)(2 := 0)) j) * (if j = 1 then s $ 1 * cos x + s $ 2 * sin x else - s $ 1 * sin x + s $ 2 * cos x)) on UNIV) \<and> (i \<noteq> 2 \<longrightarrow> (i = 1 \<longrightarrow>  D (\<lambda>x. s $ 1 * cos x + s $ 2 * sin x) = (\<lambda>x. \<Sum>j\<in>insert 1 (skip 2). (if j = 1 then 0 else ((\<lambda>x. 0)(2 := 1)) j) * (if j = 1 then s $ 1 * cos x + s $ 2 * sin x else - s $ 1 * sin x + s $ 2 * cos x)) on UNIV) \<and> (i \<noteq> 1 \<longrightarrow>  D (\<lambda>x. s $ 2 * cos x - s $ 1 * sin x) = (\<lambda>x. 0) on UNIV))
 2. \<forall>i. i \<noteq> 1 \<longrightarrow> s $ 2 = s $ i
[PROOF STEP]
by (force intro!: poly_derivatives simp: matrix_vector_mult_def)+


[STATEMENT]
lemma "\<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace>
          \<lbrace>\<acute>Abr = ''Break''\<rbrace> \<bullet> WHILE True
          INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace>
          DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break''
               ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1
               FI
          OD
          \<lbrace>\<acute>S = a * b\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace> \<lbrace>\<acute>Abr = ''Break''\<rbrace>\<bullet>WHILE True INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace> DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break'' ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 FI OD \<lbrace>\<acute>S = a * b\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b
 2. \<And>M S. \<lbrakk>S = M * b; True\<rbrakk> \<Longrightarrow> (M = a \<longrightarrow> S = a * b) \<and> (M \<noteq> a \<longrightarrow> S + b = (M + 1) * b)
 3. \<And>M S. \<lbrakk>S = M * b; \<not> True\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in prob_space) indep_vars_sum:
  fixes X :: "'i \<Rightarrow> 'a \<Rightarrow> real"
  assumes I: "finite I" "i \<notin> I" and indep: "indep_vars (\<lambda>_. borel) X (insert i I)"
  shows "indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
have "indep_var
    borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i}))
    borel ((\<lambda>f. \<Sum>i\<in>I. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_var borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>{i}. X i \<omega>)) borel ((\<lambda>f. sum f I) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>I. X i \<omega>))
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
finite I
i \<notin> I

goal (1 subgoal):
 1. indep_var borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>{i}. X i \<omega>)) borel ((\<lambda>f. sum f I) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>I. X i \<omega>))
[PROOF STEP]
by (intro indep_var_compose[OF indep_var_restrict[OF indep]] ) auto
[PROOF STATE]
proof (state)
this:
indep_var borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>{i}. X i \<omega>)) borel ((\<lambda>f. sum f I) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>I. X i \<omega>))

goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
indep_var borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>{i}. X i \<omega>)) borel ((\<lambda>f. sum f I) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>I. X i \<omega>))

goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
have "((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i})) = X i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f. f i) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>{i}. X i \<omega>) = X i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>f. f i) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>{i}. X i \<omega>) = X i

goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>f. f i) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>{i}. X i \<omega>) = X i

goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
have "((\<lambda>f. \<Sum>i\<in>I. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I)) = (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f. sum f I) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>I. X i \<omega>) = (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
by (auto cong: rev_conj_cong)
[PROOF STATE]
proof (state)
this:
(\<lambda>f. sum f I) \<circ> (\<lambda>\<omega>. \<lambda>i\<in>I. X i \<omega>) = (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)

goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
indep_var borel (X i) borel (\<lambda>a. \<Sum>i\<in>I. X i a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
indep_var borel (X i) borel (\<lambda>a. \<Sum>i\<in>I. X i a)

goal (1 subgoal):
 1. indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_berlekamp_basis_eq: "(set (berlekamp_basis u))
  = (Poly \<circ> list_of_vec)` (set (find_base_vectors (berlekamp_resulting_mat u)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (berlekamp_basis u) = (Poly \<circ> list_of_vec) ` set (find_base_vectors (berlekamp_resulting_mat u))
[PROOF STEP]
by (auto simp add: image_def o_def berlekamp_basis_def)


[STATEMENT]
lemma rel_interior_sum_gen:
  fixes S :: "'a \<Rightarrow> 'n::euclidean_space set"
  assumes "\<And>i. i\<in>I \<Longrightarrow> convex (S i)"
  shows "rel_interior (sum S I) = sum (\<lambda>i. rel_interior (S i)) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (sum S I) = (\<Sum>i\<in>I. rel_interior (S i))
[PROOF STEP]
using rel_interior_sum rel_interior_sing[of "0"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex ?S; convex ?T\<rbrakk> \<Longrightarrow> rel_interior (?S + ?T) = rel_interior ?S + rel_interior ?T
rel_interior {0::?'b1} = {0::?'b1}
?i \<in> I \<Longrightarrow> convex (S ?i)

goal (1 subgoal):
 1. rel_interior (sum S I) = (\<Sum>i\<in>I. rel_interior (S i))
[PROOF STEP]
by (subst sum_set_cond_linear[of convex], auto simp add: convex_set_plus)


[STATEMENT]
lemma exists_basis: "\<exists>X::'a::{field}^'n^'n. is_basis (set_of_vector X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>X. is_basis (set_of_vector X)
[PROOF STEP]
using is_basis_cart_basis'
[PROOF STATE]
proof (prove)
using this:
is_basis (set_of_vector cart_basis')

goal (1 subgoal):
 1. \<exists>X. is_basis (set_of_vector X)
[PROOF STEP]
by auto


[STATEMENT]
lemma ide_char\<^sub>S\<^sub>C:
    assumes "arr f"
    shows "ide f \<longleftrightarrow> Dom f = Cod f \<and> Fun f = (\<lambda>x \<in> Dom f. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ide f = (Dom f = Cod f \<and> Fun f = (\<lambda>x\<in>Dom f. x))
[PROOF STEP]
using assms mkIde_as_mkArr mkArr_Fun Fun_ide in_homE ide_cod mkArr_Fun mkIde_set
[PROOF STATE]
proof (prove)
using this:
arr f
setp ?A \<Longrightarrow> mkArr ?A ?A (\<lambda>x. x) = mkIde ?A
arr ?f \<Longrightarrow> mkArr (Dom ?f) (Cod ?f) (Fun ?f) = ?f
ide ?a \<Longrightarrow> Fun ?a = (\<lambda>x\<in>local.set ?a. x)
\<lbrakk>\<guillemotleft>?f : ?a \<rightarrow> ?b\<guillemotright>; \<lbrakk>arr ?f; local.dom ?f = ?a; cod ?f = ?b\<rbrakk> \<Longrightarrow> ?T\<rbrakk> \<Longrightarrow> ?T
arr ?f \<Longrightarrow> ide (cod ?f)
arr ?f \<Longrightarrow> mkArr (Dom ?f) (Cod ?f) (Fun ?f) = ?f
ide ?a \<Longrightarrow> mkIde (local.set ?a) = ?a

goal (1 subgoal):
 1. ide f = (Dom f = Cod f \<and> Fun f = (\<lambda>x\<in>Dom f. x))
[PROOF STEP]
by (metis ide_char)


[STATEMENT]
lemma Riemann_lebesgue_sin_half:
  assumes "f absolutely_integrable_on {-pi..pi}"
  shows "(\<lambda>n. LINT x|lebesgue_on {-pi..pi}. sin ((real n + 1/2) * x) * f x) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {- pi..pi}. sin ((real n + 1 / 2) * x) * f x) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (simp add: algebra_simps sin_add)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))) \<longlonglongrightarrow> 0
[PROOF STEP]
let ?INT = "integral\<^sup>L (lebesgue_on {-pi..pi})"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))) \<longlonglongrightarrow> 0
[PROOF STEP]
let ?f = "(\<lambda>n. ?INT (\<lambda>x. sin(n * x) * cos(1/2 * x) * f x) +
                 ?INT (\<lambda>x. cos(n * x) * sin(1/2 * x) * f x))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))) \<longlonglongrightarrow> 0
[PROOF STEP]
show "(\<lambda>n. ?INT (\<lambda>x. f x * (cos (x * real n) * sin (x/2)) + f x * (sin (x * real n) * cos (x/2)))) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> 0
 2. \<forall>\<^sub>F x in sequentially. ?f x = LINT xa|lebesgue_on {- pi..pi}. f xa * (cos (xa * real x) * sin (xa / 2)) + f xa * (sin (xa * real x) * cos (xa / 2))
[PROOF STEP]
have sin: "(\<lambda>x. sin (1/2 * x) * f x) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sin (1 / 2 * x) * f x) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by (intro absolutely_integrable_sin_product assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. sin (1 / 2 * x) * f x) absolutely_integrable_on {- pi..pi}

goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> 0
 2. \<forall>\<^sub>F x in sequentially. ?f x = LINT xa|lebesgue_on {- pi..pi}. f xa * (cos (xa * real x) * sin (xa / 2)) + f xa * (sin (xa * real x) * cos (xa / 2))
[PROOF STEP]
have cos: "(\<lambda>x. cos (1/2 * x) * f x) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. cos (1 / 2 * x) * f x) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by (intro absolutely_integrable_cos_product assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. cos (1 / 2 * x) * f x) absolutely_integrable_on {- pi..pi}

goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> 0
 2. \<forall>\<^sub>F x in sequentially. ?f x = LINT xa|lebesgue_on {- pi..pi}. f xa * (cos (xa * real x) * sin (xa / 2)) + f xa * (sin (xa * real x) * cos (xa / 2))
[PROOF STEP]
show "\<forall>\<^sub>F n in sequentially. ?f n = ?INT (\<lambda>x. f x * (cos (x * real n) * sin (x/2)) + f x * (sin (x * real n) * cos (x/2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (LINT x|lebesgue_on {- pi..pi}. sin (real n * x) * cos (1 / 2 * x) * f x) + (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * sin (1 / 2 * x) * f x) = LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))
[PROOF STEP]
unfolding mult.assoc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (LINT x|lebesgue_on {- pi..pi}. sin (real n * x) * (cos (1 / 2 * x) * f x)) + (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * (sin (1 / 2 * x) * f x)) = LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * (cos (1 / 2 * xa) * f xa)) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * (sin (1 / 2 * xa) * f xa)) = LINT xa|lebesgue_on {- pi..pi}. f xa * (cos (xa * real x) * sin (xa / 2)) + f xa * (sin (xa * real x) * cos (xa / 2))
[PROOF STEP]
apply (subst Bochner_Integration.integral_add [symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. integrable (lebesgue_on {- pi..pi}) (\<lambda>xa. sin (real x * xa) * (cos (1 / 2 * xa) * f xa))
 2. \<And>x. integrable (lebesgue_on {- pi..pi}) (\<lambda>xa. cos (real x * xa) * (sin (1 / 2 * xa) * f xa))
 3. \<And>x. LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * (cos (1 / 2 * xa) * f xa) + cos (real x * xa) * (sin (1 / 2 * xa) * f xa) = LINT xa|lebesgue_on {- pi..pi}. f xa * (cos (xa * real x) * sin (xa / 2)) + f xa * (sin (xa * real x) * cos (xa / 2))
[PROOF STEP]
apply (safe intro!: cos absolutely_integrable_sin_product sin absolutely_integrable_cos_product absolutely_integrable_imp_integrable)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. {- pi..pi} \<in> sets lebesgue
 2. \<And>x. {- pi..pi} \<in> sets lebesgue
 3. \<And>x. LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * (cos (1 / 2 * xa) * f xa) + cos (real x * xa) * (sin (1 / 2 * xa) * f xa) = LINT xa|lebesgue_on {- pi..pi}. f xa * (cos (xa * real x) * sin (xa / 2)) + f xa * (sin (xa * real x) * cos (xa / 2))
[PROOF STEP]
apply (auto simp: algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (LINT x|lebesgue_on {- pi..pi}. sin (real n * x) * cos (1 / 2 * x) * f x) + (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * sin (1 / 2 * x) * f x) = LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))

goal (1 subgoal):
 1. (\<lambda>n. (LINT x|lebesgue_on {- pi..pi}. sin (real n * x) * cos (1 / 2 * x) * f x) + (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * sin (1 / 2 * x) * f x)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "?f \<longlonglongrightarrow> 0 + 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * cos (1 / 2 * xa) * f xa) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * sin (1 / 2 * xa) * f xa)) \<longlonglongrightarrow> 0 + 0
[PROOF STEP]
unfolding mult.assoc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * (cos (1 / 2 * xa) * f xa)) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * (sin (1 / 2 * xa) * f xa))) \<longlonglongrightarrow> 0 + 0
[PROOF STEP]
by (intro tendsto_add Riemann_lebesgue_sin Riemann_lebesgue_cos sin cos)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * cos (1 / 2 * xa) * f xa) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * sin (1 / 2 * xa) * f xa)) \<longlonglongrightarrow> 0 + 0

goal (1 subgoal):
 1. (\<lambda>n. (LINT x|lebesgue_on {- pi..pi}. sin (real n * x) * cos (1 / 2 * x) * f x) + (LINT x|lebesgue_on {- pi..pi}. cos (real n * x) * sin (1 / 2 * x) * f x)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * cos (1 / 2 * xa) * f xa) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * sin (1 / 2 * xa) * f xa)) \<longlonglongrightarrow> 0 + 0
[PROOF STEP]
show "?f \<longlonglongrightarrow> (0::real)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * cos (1 / 2 * xa) * f xa) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * sin (1 / 2 * xa) * f xa)) \<longlonglongrightarrow> 0 + 0

goal (1 subgoal):
 1. (\<lambda>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * cos (1 / 2 * xa) * f xa) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * sin (1 / 2 * xa) * f xa)) \<longlonglongrightarrow> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (LINT xa|lebesgue_on {- pi..pi}. sin (real x * xa) * cos (1 / 2 * xa) * f xa) + (LINT xa|lebesgue_on {- pi..pi}. cos (real x * xa) * sin (1 / 2 * xa) * f xa)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. LINT x|lebesgue_on {- pi..pi}. f x * (cos (x * real n) * sin (x / 2)) + f x * (sin (x * real n) * cos (x / 2))) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lsc_hull_of_convex_agrees:
  fixes f :: "'a::euclidean_space \<Rightarrow> ereal"
  assumes "convex_on UNIV f"
  shows "\<forall>x. (f x = (lsc_hull f) x) | x : rel_frontier (domain f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f x = lsc_hull f x \<or> x \<in> rel_frontier (domain f)
[PROOF STEP]
by (metis DiffI assms lsc_hull_of_convex_agrees_onRI lsc_hull_of_convex_agrees_outside rel_frontier_def)


[STATEMENT]
lemma beta_C_meta_3[PLM]:
    assumes "IsProperInXYZ \<phi>"
    shows "[\<lparr>\<^bold>\<lambda>\<^sup>3 (\<lambda> x y z. \<phi> (x\<^sup>P) (y\<^sup>P) (z\<^sup>P)), x\<^sup>P, y\<^sup>P, z\<^sup>P\<rparr> \<^bold>\<equiv> \<phi> (x\<^sup>P) (y\<^sup>P) (z\<^sup>P) in v]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<lparr>\<^bold>\<lambda>\<^sup>3 (\<lambda>x y z. \<phi> (x\<^sup>P) (y\<^sup>P) (z\<^sup>P)),x\<^sup>P,y\<^sup>P,z\<^sup>P\<rparr> \<^bold>\<equiv> \<phi> (x\<^sup>P) (y\<^sup>P) (z\<^sup>P) in v]
[PROOF STEP]
using lambda_predicates_2_3[OF assms, axiom_instance]
[PROOF STATE]
proof (prove)
using this:
[\<lparr>\<^bold>\<lambda>\<^sup>3 (\<lambda>x y z. \<phi> (x\<^sup>P) (y\<^sup>P) (z\<^sup>P)),?x1\<^sup>P,?y1\<^sup>P,?z1\<^sup>P\<rparr> \<^bold>\<equiv> \<phi> (?x1\<^sup>P) (?y1\<^sup>P) (?z1\<^sup>P) in ?v]

goal (1 subgoal):
 1. [\<lparr>\<^bold>\<lambda>\<^sup>3 (\<lambda>x y z. \<phi> (x\<^sup>P) (y\<^sup>P) (z\<^sup>P)),x\<^sup>P,y\<^sup>P,z\<^sup>P\<rparr> \<^bold>\<equiv> \<phi> (x\<^sup>P) (y\<^sup>P) (z\<^sup>P) in v]
[PROOF STEP]
by auto


[STATEMENT]
lemma nn_integral_indicator_singleton'[simp]:
  assumes [measurable]: "{y} \<in> sets M"
  shows "(\<integral>\<^sup>+x. ennreal (f x * indicator {y} x) \<partial>M) = f y * emeasure M {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x * indicat_real {y} x) \<partial>M = ennreal (f y) * emeasure M {y}
[PROOF STEP]
by (subst nn_integral_set_ennreal[symmetric]) (simp)


[STATEMENT]
lemma LIMSEQ_less_Ex:
   "\<lbrakk> X \<longlonglongrightarrow> (x::real); x < y \<rbrakk> \<Longrightarrow> \<exists>n. X n < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<longlonglongrightarrow> x; x < y\<rbrakk> \<Longrightarrow> \<exists>n. X n < y
[PROOF STEP]
by (meson LIMSEQ_le_const not_less)


[STATEMENT]
lemma (in B1_algebra) one_plus_star:  "x\<^sup>\<star> = (1 + x)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star> = ((1::'a) + x)\<^sup>\<star>
[PROOF STEP]
by (metis C11_var R add_idem' mult_onel mult_oner)


[STATEMENT]
lemma singular_relboundary_add:
   "\<lbrakk>singular_relboundary p X S a; singular_relboundary p X S b\<rbrakk> \<Longrightarrow> singular_relboundary p X S (a+b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>singular_relboundary p X S a; singular_relboundary p X S b\<rbrakk> \<Longrightarrow> singular_relboundary p X S (a + b)
[PROOF STEP]
unfolding singular_relboundary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>d. singular_chain (Suc p) X d \<and> (chain_boundary (Suc p) d, a) \<in> mod_subset p (subtopology X S); \<exists>d. singular_chain (Suc p) X d \<and> (chain_boundary (Suc p) d, b) \<in> mod_subset p (subtopology X S)\<rbrakk> \<Longrightarrow> \<exists>d. singular_chain (Suc p) X d \<and> (chain_boundary (Suc p) d, a + b) \<in> mod_subset p (subtopology X S)
[PROOF STEP]
by (metis chain_boundary_add mod_subset_add singular_chain_add)


[STATEMENT]
lemma sums_alternating_upper_lower:
  fixes a :: "nat \<Rightarrow> real"
  assumes mono: "\<And>n. a (Suc n) \<le> a n"
    and a_pos: "\<And>n. 0 \<le> a n"
    and "a \<longlonglongrightarrow> 0"
  shows "\<exists>l. ((\<forall>n. (\<Sum>i<2*n. (- 1)^i*a i) \<le> l) \<and> (\<lambda> n. \<Sum>i<2*n. (- 1)^i*a i) \<longlonglongrightarrow> l) \<and>
             ((\<forall>n. l \<le> (\<Sum>i<2*n + 1. (- 1)^i*a i)) \<and> (\<lambda> n. \<Sum>i<2*n + 1. (- 1)^i*a i) \<longlonglongrightarrow> l)"
  (is "\<exists>l. ((\<forall>n. ?f n \<le> l) \<and> _) \<and> ((\<forall>n. l \<le> ?g n) \<and> _)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. ((\<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> l) \<and> (\<lambda>n. \<Sum>i<2 * n. (- 1) ^ i * a i) \<longlonglongrightarrow> l) \<and> (\<forall>n. l \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<and> (\<lambda>n. \<Sum>i<2 * n + 1. (- 1) ^ i * a i) \<longlonglongrightarrow> l
[PROOF STEP]
proof (rule nested_sequence_unique)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc n. (- 1) ^ i * a i)
 2. \<forall>n. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
 3. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
 4. (\<lambda>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<longlonglongrightarrow> 0
[PROOF STEP]
have fg_diff: "\<And>n. ?f n - ?g n = - a (2 * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i) = - a (2 * n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * ?n. (- 1) ^ i * a i) - (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i) = - a (2 * ?n)

goal (4 subgoals):
 1. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc n. (- 1) ^ i * a i)
 2. \<forall>n. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
 3. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
 4. (\<lambda>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<longlonglongrightarrow> 0
[PROOF STEP]
show "\<forall>n. ?f n \<le> ?f (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc n. (- 1) ^ i * a i)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc n. (- 1) ^ i * a i)
[PROOF STEP]
show "?f n \<le> ?f (Suc n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc n. (- 1) ^ i * a i)
[PROOF STEP]
using mono[of "2*n"]
[PROOF STATE]
proof (prove)
using this:
a (Suc (2 * n)) \<le> a (2 * n)

goal (1 subgoal):
 1. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc n. (- 1) ^ i * a i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * ?n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc ?n. (- 1) ^ i * a i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * Suc n. (- 1) ^ i * a i)

goal (3 subgoals):
 1. \<forall>n. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
 2. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
 3. (\<lambda>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<longlonglongrightarrow> 0
[PROOF STEP]
show "\<forall>n. ?g (Suc n) \<le> ?g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
show "?g (Suc n) \<le> ?g n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
using mono[of "Suc (2*n)"]
[PROOF STATE]
proof (prove)
using this:
a (Suc (Suc (2 * n))) \<le> a (Suc (2 * n))

goal (1 subgoal):
 1. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * Suc ?n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>n. (\<Sum>i<2 * Suc n + 1. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)

goal (2 subgoals):
 1. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
 2. (\<lambda>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<longlonglongrightarrow> 0
[PROOF STEP]
show "\<forall>n. ?f n \<le> ?g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
show "?f n \<le> ?g n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
using fg_diff a_pos
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<2 * ?n. (- 1) ^ i * a i) - (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i) = - a (2 * ?n)
0 \<le> a ?n

goal (1 subgoal):
 1. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * ?n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * ?n + 1. (- 1) ^ i * a i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) \<le> (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<longlonglongrightarrow> 0
[PROOF STEP]
show "(\<lambda>n. ?f n - ?g n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding fg_diff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - a (2 * n)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (rule LIMSEQ_I)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. norm (- a (2 * n) - 0) < r
[PROOF STEP]
fix r :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. norm (- a (2 * n) - 0) < r
[PROOF STEP]
assume "0 < r"
[PROOF STATE]
proof (state)
this:
0 < r

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. norm (- a (2 * n) - 0) < r
[PROOF STEP]
with \<open>a \<longlonglongrightarrow> 0\<close>[THEN LIMSEQ_D]
[PROOF STATE]
proof (chain)
picking this:
0 < ?r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. norm (a n - 0) < ?r
0 < r
[PROOF STEP]
obtain N where "\<And> n. n \<ge> N \<Longrightarrow> norm (a n - 0) < r"
[PROOF STATE]
proof (prove)
using this:
0 < ?r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. norm (a n - 0) < ?r
0 < r

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> norm (a n - 0) < r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> norm (a ?n - 0) < r

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. norm (- a (2 * n) - 0) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> ?n \<Longrightarrow> norm (a ?n - 0) < r
[PROOF STEP]
have "\<forall>n \<ge> N. norm (- a (2 * n) - 0) < r"
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> norm (a ?n - 0) < r

goal (1 subgoal):
 1. \<forall>n\<ge>N. norm (- a (2 * n) - 0) < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N. norm (- a (2 * n) - 0) < r

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. norm (- a (2 * n) - 0) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<ge>N. norm (- a (2 * n) - 0) < r
[PROOF STEP]
show "\<exists>N. \<forall>n \<ge> N. norm (- a (2 * n) - 0) < r"
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>N. norm (- a (2 * n) - 0) < r

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (- a (2 * n) - 0) < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. norm (- a (2 * n) - 0) < r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<2 * n. (- 1) ^ i * a i) - (\<Sum>i<2 * n + 1. (- 1) ^ i * a i)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma islimpt_iff_eventually: "x islimpt S \<longleftrightarrow> \<not> eventually (\<lambda>y. y \<notin> S) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = (\<not> (\<forall>\<^sub>F y in at x. y \<notin> S))
[PROOF STEP]
unfolding islimpt_def eventually_at_topological
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>T. x \<in> T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x)) = (\<nexists>Sa. open Sa \<and> x \<in> Sa \<and> (\<forall>xa\<in>Sa. xa \<noteq> x \<longrightarrow> xa \<in> UNIV \<longrightarrow> xa \<notin> S))
[PROOF STEP]
by auto


[STATEMENT]
lemma cnj_mult [simp]: "cnj (x * y) = cnj y * cnj x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quaternions.cnj (x * y) = Quaternions.cnj y * Quaternions.cnj x
[PROOF STEP]
by (simp add: quat_eq_iff)


[STATEMENT]
lemma w_method_via_h_framework_lists_2_completeness :
  fixes M1 :: "('a::linorder,'b::linorder,'c::linorder) fsm"
  fixes M2 :: "('d,'b,'c) fsm"
  assumes "observable M1"
  and     "observable M2"
  and     "minimal M1"
  and     "minimal M2"
  and     "size_r M1 \<le> m"
  and     "size M2 \<le> m"
  and     "inputs M2 = inputs M1"
  and     "outputs M2 = outputs M1"
shows "(L M1 = L M2) \<longleftrightarrow> list_all (passes_test_case M2 (initial M2)) (w_method_via_h_framework_2_lists M1 m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (w_method_via_h_framework_2_lists M1 m)
[PROOF STEP]
using h_framework_static_with_empty_graph_lists_completeness[OF assms, where dist_fun="(\<lambda> k q . distinguishing_set_reduced M1)", OF _ distinguishing_set_reduced_finite]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (distinguishing_set_reduced M1) \<inter> Prefix_Tree.set (distinguishing_set_reduced M1) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_empty_graph_lists M1 (\<lambda>k q. distinguishing_set_reduced M1) m)

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (w_method_via_h_framework_2_lists M1 m)
[PROOF STEP]
using distinguishing_set_reduced_distinguishes[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (distinguishing_set_reduced M1) \<inter> Prefix_Tree.set (distinguishing_set_reduced M1) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_empty_graph_lists M1 (\<lambda>k q. distinguishing_set_reduced M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (distinguishing_set_reduced M1). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (w_method_via_h_framework_2_lists M1 m)
[PROOF STEP]
unfolding w_method_via_h_framework_2_lists_def h_framework_static_with_empty_graph_lists_def w_method_via_h_framework_2_def
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (distinguishing_set_reduced M1) \<inter> Prefix_Tree.set (distinguishing_set_reduced M1) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_empty_graph M1 (\<lambda>k q. distinguishing_set_reduced M1) m)))
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (distinguishing_set_reduced M1). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_empty_graph M1 (\<lambda>k q. distinguishing_set_reduced M1) m)))
[PROOF STEP]
by blast


[STATEMENT]
lemma removeAll_overshadow_filter:
  "removeAll x (filter (\<lambda>xa. xa \<notin> A - {x}) xs) = removeAll x (filter (\<lambda> xa. xa \<notin> A) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. removeAll x (filter (\<lambda>xa. xa \<notin> A - {x}) xs) = removeAll x (filter (\<lambda>xa. xa \<notin> A) xs)
[PROOF STEP]
apply (simp add: removeAll_filter_not_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>xa. (xa \<in> A \<longrightarrow> xa = x) \<and> x \<noteq> xa) xs = filter (\<lambda>xa. xa \<notin> A \<and> x \<noteq> xa) xs
[PROOF STEP]
apply (rule filter_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. xs = xs
 2. \<And>xa. xa \<in> set xs \<Longrightarrow> ((xa \<in> A \<longrightarrow> xa = x) \<and> x \<noteq> xa) = (xa \<notin> A \<and> x \<noteq> xa)
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> set xs \<Longrightarrow> ((xa \<in> A \<longrightarrow> xa = x) \<and> x \<noteq> xa) = (xa \<notin> A \<and> x \<noteq> xa)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fps_XD'_funpow_affine:
  fixes G H :: "real fps"
  assumes [simp]: "fps_deriv G = 1"
  defines "S \<equiv> \<lambda>n i. fps_const (real (Stirling n i))"
  shows "(fps_XD' G ^^ n) H =
           (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
proof (induction n arbitrary: H)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>H. (fps_XD' G ^^ 0) H = (\<Sum>m\<le>0. S 0 m * G ^ m * (fps_deriv ^^ m) H)
 2. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>H. (fps_XD' G ^^ 0) H = (\<Sum>m\<le>0. S 0 m * G ^ m * (fps_deriv ^^ m) H)
 2. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_XD' G ^^ 0) H = (\<Sum>m\<le>0. S 0 m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
by (simp add: S_def)
[PROOF STATE]
proof (state)
this:
(fps_XD' G ^^ 0) H = (\<Sum>m\<le>0. S 0 m * G ^ m * (fps_deriv ^^ m) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
case (Suc n H)
[PROOF STATE]
proof (state)
this:
(fps_XD' G ^^ n) ?H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) ?H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
have "(\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H) =
        (\<Sum>i\<le>n. of_nat (Suc i) * S n (Suc i) *  G ^ Suc i * (fps_deriv ^^ Suc i) H) +
        (\<Sum>i\<le>n. S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H)"
    (is "_ = sum (\<lambda>i. ?f (Suc i)) \<dots> + ?S2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H) = (\<Sum>i\<le>n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) + (\<Sum>i\<le>n. S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H)
[PROOF STEP]
by (subst sum.atMost_Suc_shift) (simp_all add: sum.distrib algebra_simps fps_of_nat S_def
          fps_const_add [symmetric] fps_const_mult [symmetric] del: fps_const_add fps_const_mult)
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H) = (\<Sum>i\<le>n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) + (\<Sum>i\<le>n. S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H) = (\<Sum>i\<le>n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) + (\<Sum>i\<le>n. S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
have "sum (\<lambda>i. ?f (Suc i)) {..n} = sum (\<lambda>i. ?f (Suc i)) {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H)
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
have "\<dots> = ?f 0 + \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = of_nat 0 * S n 0 * G ^ 0 * (fps_deriv ^^ 0) H + (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = of_nat 0 * S n 0 * G ^ 0 * (fps_deriv ^^ 0) H + (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = of_nat 0 * S n 0 * G ^ 0 * (fps_deriv ^^ 0) H + (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
have "\<dots> = sum ?f {..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat 0 * S n 0 * G ^ 0 * (fps_deriv ^^ 0) H + (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>a\<le>n. of_nat a * S n a * G ^ a * (fps_deriv ^^ a) H)
[PROOF STEP]
by (subst sum.atMost_shift [symmetric]) simp_all
[PROOF STATE]
proof (state)
this:
of_nat 0 * S n 0 * G ^ 0 * (fps_deriv ^^ 0) H + (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>a\<le>n. of_nat a * S n a * G ^ a * (fps_deriv ^^ a) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat 0 * S n 0 * G ^ 0 * (fps_deriv ^^ 0) H + (\<Sum>i<n. of_nat (Suc i) * S n (Suc i) * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>a\<le>n. of_nat a * S n a * G ^ a * (fps_deriv ^^ a) H)

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
have "\<dots> + ?S2 = (\<Sum>x\<le>n. fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<le>n. of_nat a * S n a * G ^ a * (fps_deriv ^^ a) H) + (\<Sum>i\<le>n. S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>x\<le>n. fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H))
[PROOF STEP]
unfolding sum.distrib [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<le>n. of_nat x * S n x * G ^ x * (fps_deriv ^^ x) H + S n x * G ^ Suc x * (fps_deriv ^^ Suc x) H) = (\<Sum>x\<le>n. fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H))
[PROOF STEP]
proof (rule sum.cong, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {..n} = {..n}
 2. \<And>x. x \<in> {..n} \<Longrightarrow> of_nat x * S n x * G ^ x * (fps_deriv ^^ x) H + S n x * G ^ Suc x * (fps_deriv ^^ Suc x) H = fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H)
[PROOF STEP]
case (2 i)
[PROOF STATE]
proof (state)
this:
i \<in> {..n}

goal (2 subgoals):
 1. {..n} = {..n}
 2. \<And>x. x \<in> {..n} \<Longrightarrow> of_nat x * S n x * G ^ x * (fps_deriv ^^ x) H + S n x * G ^ Suc x * (fps_deriv ^^ Suc x) H = fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
i \<in> {..n}

goal (1 subgoal):
 1. of_nat i * S n i * G ^ i * (fps_deriv ^^ i) H + S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H = fps_XD' G (S n i * G ^ i * (fps_deriv ^^ i) H)
[PROOF STEP]
unfolding fps_XD'_prod fps_XD'_power
[PROOF STATE]
proof (prove)
using this:
i \<in> {..n}

goal (1 subgoal):
 1. of_nat i * S n i * G ^ i * (fps_deriv ^^ i) H + S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H = (fps_XD' G (S n i) * G ^ i + S n i * (of_nat i * G ^ (i - 1) * fps_XD' G G)) * (fps_deriv ^^ i) H + S n i * G ^ i * fps_XD' G ((fps_deriv ^^ i) H)
[PROOF STEP]
by (cases i) (auto simp: fps_XD'_prod fps_XD'_power_Suc algebra_simps of_nat_diff S_def fps_XD'_def)
[PROOF STATE]
proof (state)
this:
of_nat i * S n i * G ^ i * (fps_deriv ^^ i) H + S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H = fps_XD' G (S n i * G ^ i * (fps_deriv ^^ i) H)

goal (1 subgoal):
 1. {..n} = {..n}
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<le>n. of_nat a * S n a * G ^ a * (fps_deriv ^^ a) H) + (\<Sum>i\<le>n. S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>x\<le>n. fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H))

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<le>n. of_nat a * S n a * G ^ a * (fps_deriv ^^ a) H) + (\<Sum>i\<le>n. S n i * G ^ Suc i * (fps_deriv ^^ Suc i) H) = (\<Sum>x\<le>n. fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H))

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
have "\<dots> = (fps_XD' G ^^ Suc n) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<le>n. fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H)) = (fps_XD' G ^^ Suc n) H
[PROOF STEP]
by (simp add: Suc.IH fps_XD'_sum)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<le>n. fps_XD' G (S n x * G ^ x * (fps_deriv ^^ x) H)) = (fps_XD' G ^^ Suc n) H

goal (1 subgoal):
 1. \<And>n H. (\<And>H. (fps_XD' G ^^ n) H = (\<Sum>m\<le>n. S n m * G ^ m * (fps_deriv ^^ m) H)) \<Longrightarrow> (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H) = (fps_XD' G ^^ Suc n) H
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H) = (fps_XD' G ^^ Suc n) H

goal (1 subgoal):
 1. (fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(fps_XD' G ^^ Suc n) H = (\<Sum>m\<le>Suc n. S (Suc n) m * G ^ m * (fps_deriv ^^ m) H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cauchy_Binet:
  "det (A*B) = (\<Sum>I\<in>{I. I\<subseteq>{0..<m} \<and> card I=n}. det (submatrix A UNIV I) * det (submatrix B I UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
let ?f="(\<lambda>I. (\<lambda>i. if i<n then sorted_list_of_set I ! i else i))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
let ?setI = "{I. I \<subseteq> {0..<m} \<and> card I = n}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
have inj_on: "inj_on ?f ?setI"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
proof (rule inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; y \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; (\<lambda>i. if i < n then sorted_list_of_set x ! i else i) = (\<lambda>i. if i < n then sorted_list_of_set y ! i else i)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix I J
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; y \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; (\<lambda>i. if i < n then sorted_list_of_set x ! i else i) = (\<lambda>i. if i < n then sorted_list_of_set y ! i else i)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume I: "I \<in> ?setI" and J: "J \<in> ?setI" and fI_fJ: "?f I = ?f J"
[PROOF STATE]
proof (state)
this:
I \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}
J \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}
(\<lambda>i. if i < n then sorted_list_of_set I ! i else i) = (\<lambda>i. if i < n then sorted_list_of_set J ! i else i)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; y \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; (\<lambda>i. if i < n then sorted_list_of_set x ! i else i) = (\<lambda>i. if i < n then sorted_list_of_set y ! i else i)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "x \<in> J" if x: "x \<in> I" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> J
[PROOF STEP]
by (metis (mono_tags) fI_fJ I J distinct_card in_set_conv_nth mem_Collect_eq
          sorted_list_of_set(1) sorted_list_of_set(3) subset_eq_atLeast0_lessThan_finite x)
[PROOF STATE]
proof (state)
this:
?x \<in> I \<Longrightarrow> ?x \<in> J

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; y \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; (\<lambda>i. if i < n then sorted_list_of_set x ! i else i) = (\<lambda>i. if i < n then sorted_list_of_set y ! i else i)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x \<in> I \<Longrightarrow> ?x \<in> J

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; y \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; (\<lambda>i. if i < n then sorted_list_of_set x ! i else i) = (\<lambda>i. if i < n then sorted_list_of_set y ! i else i)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "x \<in> I" if x: "x \<in> J" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> I
[PROOF STEP]
by (metis (mono_tags) fI_fJ I J distinct_card in_set_conv_nth mem_Collect_eq
          sorted_list_of_set(1) sorted_list_of_set(3) subset_eq_atLeast0_lessThan_finite x)
[PROOF STATE]
proof (state)
this:
?x \<in> J \<Longrightarrow> ?x \<in> I

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; y \<in> {I. I \<subseteq> {0..<m} \<and> card I = n}; (\<lambda>i. if i < n then sorted_list_of_set x ! i else i) = (\<lambda>i. if i < n then sorted_list_of_set y ! i else i)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x \<in> I \<Longrightarrow> ?x \<in> J
?x \<in> J \<Longrightarrow> ?x \<in> I
[PROOF STEP]
show "I = J"
[PROOF STATE]
proof (prove)
using this:
?x \<in> I \<Longrightarrow> ?x \<in> J
?x \<in> J \<Longrightarrow> ?x \<in> I

goal (1 subgoal):
 1. I = J
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
I = J

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) {I. I \<subseteq> {0..<m} \<and> card I = n}

goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
have rw: "?f I ` {0..<n} = I" if I: "I \<in> ?setI" for I
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. if i < n then sorted_list_of_set I ! i else i) ` {0..<n} = I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>i. if i < n then sorted_list_of_set I ! i else i) ` {0..<n} = I
[PROOF STEP]
have "sorted_list_of_set I ! xa \<in> I" if "xa < n" for xa
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set I ! xa \<in> I
[PROOF STEP]
by (metis (mono_tags, lifting) I distinct_card distinct_sorted_list_of_set mem_Collect_eq
          nth_mem set_sorted_list_of_set subset_eq_atLeast0_lessThan_finite that)
[PROOF STATE]
proof (state)
this:
?xa < n \<Longrightarrow> sorted_list_of_set I ! ?xa \<in> I

goal (1 subgoal):
 1. (\<lambda>i. if i < n then sorted_list_of_set I ! i else i) ` {0..<n} = I
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?xa < n \<Longrightarrow> sorted_list_of_set I ! ?xa \<in> I

goal (1 subgoal):
 1. (\<lambda>i. if i < n then sorted_list_of_set I ! i else i) ` {0..<n} = I
[PROOF STEP]
have "\<exists>xa\<in>{0..<n}. x = sorted_list_of_set I ! xa" if x: "x\<in>I" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xa\<in>{0..<n}. x = sorted_list_of_set I ! xa
[PROOF STEP]
by (metis (full_types) x I atLeast0LessThan distinct_card in_set_conv_nth mem_Collect_eq
         lessThan_iff sorted_list_of_set(1) sorted_list_of_set(3) subset_eq_atLeast0_lessThan_finite)
[PROOF STATE]
proof (state)
this:
?x \<in> I \<Longrightarrow> \<exists>xa\<in>{0..<n}. ?x = sorted_list_of_set I ! xa

goal (1 subgoal):
 1. (\<lambda>i. if i < n then sorted_list_of_set I ! i else i) ` {0..<n} = I
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?xa < n \<Longrightarrow> sorted_list_of_set I ! ?xa \<in> I
?x \<in> I \<Longrightarrow> \<exists>xa\<in>{0..<n}. ?x = sorted_list_of_set I ! xa
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?xa < n \<Longrightarrow> sorted_list_of_set I ! ?xa \<in> I
?x \<in> I \<Longrightarrow> \<exists>xa\<in>{0..<n}. ?x = sorted_list_of_set I ! xa

goal (1 subgoal):
 1. (\<lambda>i. if i < n then sorted_list_of_set I ! i else i) ` {0..<n} = I
[PROOF STEP]
unfolding image_def
[PROOF STATE]
proof (prove)
using this:
?xa < n \<Longrightarrow> sorted_list_of_set I ! ?xa \<in> I
?x \<in> I \<Longrightarrow> \<exists>xa\<in>{0..<n}. ?x = sorted_list_of_set I ! xa

goal (1 subgoal):
 1. {y. \<exists>x\<in>{0..<n}. y = (if x < n then sorted_list_of_set I ! x else x)} = I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>i. if i < n then sorted_list_of_set I ! i else i) ` {0..<n} = I

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?I \<in> {I. I \<subseteq> {0..<m} \<and> card I = n} \<Longrightarrow> (\<lambda>i. if i < n then sorted_list_of_set ?I ! i else i) ` {0..<n} = ?I

goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
have f_setI: "?f` ?setI = F_strict"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
have "sorted_list_of_set I ! xa < m" if I: "I \<subseteq> {0..<m}" and "n = card I" and "xa < card I"
        for I xa
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set I ! xa < m
[PROOF STEP]
by (metis I \<open>xa < card I\<close> atLeast0LessThan distinct_card finite_atLeastLessThan lessThan_iff
          pick_in_set_le rev_finite_subset sorted_list_of_set(1)
          sorted_list_of_set(3) sorted_list_of_set_eq_pick subsetCE)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I; ?xa < card ?I\<rbrakk> \<Longrightarrow> sorted_list_of_set ?I ! ?xa < m

goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I; ?xa < card ?I\<rbrakk> \<Longrightarrow> sorted_list_of_set ?I ! ?xa < m

goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
have "strict_mono_on {0..<card I} (\<lambda>i. if i < card I then sorted_list_of_set I ! i else i)"
      if "I \<subseteq> {0..<m}" and "n = card I" for I
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono_on {0..<card I} (\<lambda>i. if i < card I then sorted_list_of_set I ! i else i)
[PROOF STEP]
by (smt \<open>I \<subseteq> {0..<m}\<close> atLeastLessThan_iff distinct_card finite_atLeastLessThan pick_mono_le
          rev_finite_subset sorted_list_of_set(1) sorted_list_of_set(3)
          sorted_list_of_set_eq_pick strict_mono_on_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I\<rbrakk> \<Longrightarrow> strict_mono_on {0..<card ?I} (\<lambda>i. if i < card ?I then sorted_list_of_set ?I ! i else i)

goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I\<rbrakk> \<Longrightarrow> strict_mono_on {0..<card ?I} (\<lambda>i. if i < card ?I then sorted_list_of_set ?I ! i else i)

goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
have "x \<in> ?f ` {I. I \<subseteq> {0..<m} \<and> card I = n}"
      if x1: "x \<in> {0..<n} \<rightarrow> {0..<m}" and x2: "\<forall>i. \<not> i < n \<longrightarrow> x i = i"
      and s: "strict_mono_on {0..<n} x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
have inj_x: "inj_on x {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on x {0..<n}
[PROOF STEP]
using s strict_mono_on_imp_inj_on
[PROOF STATE]
proof (prove)
using this:
strict_mono_on {0..<n} x
strict_mono_on ?A ?f \<Longrightarrow> inj_on ?f ?A

goal (1 subgoal):
 1. inj_on x {0..<n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on x {0..<n}

goal (1 subgoal):
 1. x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
hence card_xn: "card (x ` {0..<n}) = n"
[PROOF STATE]
proof (prove)
using this:
inj_on x {0..<n}

goal (1 subgoal):
 1. card (x ` {0..<n}) = n
[PROOF STEP]
by (simp add: card_image)
[PROOF STATE]
proof (state)
this:
card (x ` {0..<n}) = n

goal (1 subgoal):
 1. x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
have x_eq: "x = (\<lambda>i. if i < n then sorted_list_of_set (x ` {0..<n}) ! i else i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (\<lambda>i. if i < n then sorted_list_of_set (x ` {0..<n}) ! i else i)
[PROOF STEP]
unfolding fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xa. x xa = (if xa < n then sorted_list_of_set (x ` {0..<n}) ! xa else xa)
[PROOF STEP]
using nth_strict_mono_on s
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>strict_mono_on {0..<n} ?f; ?i < n\<rbrakk> \<Longrightarrow> ?f ?i = sorted_list_of_set (?f ` {0..<n}) ! ?i
strict_mono_on {0..<n} x

goal (1 subgoal):
 1. \<forall>xa. x xa = (if xa < n then sorted_list_of_set (x ` {0..<n}) ! xa else xa)
[PROOF STEP]
using x2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>strict_mono_on {0..<n} ?f; ?i < n\<rbrakk> \<Longrightarrow> ?f ?i = sorted_list_of_set (?f ` {0..<n}) ! ?i
strict_mono_on {0..<n} x
\<forall>i. \<not> i < n \<longrightarrow> x i = i

goal (1 subgoal):
 1. \<forall>xa. x xa = (if xa < n then sorted_list_of_set (x ` {0..<n}) ! xa else xa)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (\<lambda>i. if i < n then sorted_list_of_set (x ` {0..<n}) ! i else i)

goal (1 subgoal):
 1. x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
unfolding image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {y. \<exists>x\<in>{I. I \<subseteq> {0..<m} \<and> card I = n}. y = (\<lambda>i. if i < n then sorted_list_of_set x ! i else i)}
[PROOF STEP]
by (auto, rule exI[of _"x`{0..<n}"], insert card_xn x1 x_eq, auto)
[PROOF STATE]
proof (state)
this:
x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> {0..<n} \<rightarrow> {0..<m}; \<forall>i. \<not> i < n \<longrightarrow> ?x i = i; strict_mono_on {0..<n} ?x\<rbrakk> \<Longrightarrow> ?x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}

goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I; ?xa < card ?I\<rbrakk> \<Longrightarrow> sorted_list_of_set ?I ! ?xa < m
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I\<rbrakk> \<Longrightarrow> strict_mono_on {0..<card ?I} (\<lambda>i. if i < card ?I then sorted_list_of_set ?I ! i else i)
\<lbrakk>?x \<in> {0..<n} \<rightarrow> {0..<m}; \<forall>i. \<not> i < n \<longrightarrow> ?x i = i; strict_mono_on {0..<n} ?x\<rbrakk> \<Longrightarrow> ?x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I; ?xa < card ?I\<rbrakk> \<Longrightarrow> sorted_list_of_set ?I ! ?xa < m
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I\<rbrakk> \<Longrightarrow> strict_mono_on {0..<card ?I} (\<lambda>i. if i < card ?I then sorted_list_of_set ?I ! i else i)
\<lbrakk>?x \<in> {0..<n} \<rightarrow> {0..<m}; \<forall>i. \<not> i < n \<longrightarrow> ?x i = i; strict_mono_on {0..<n} ?x\<rbrakk> \<Longrightarrow> ?x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}

goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict
[PROOF STEP]
unfolding F_strict_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I; ?xa < card ?I\<rbrakk> \<Longrightarrow> sorted_list_of_set ?I ! ?xa < m
\<lbrakk>?I \<subseteq> {0..<m}; n = card ?I\<rbrakk> \<Longrightarrow> strict_mono_on {0..<card ?I} (\<lambda>i. if i < card ?I then sorted_list_of_set ?I ! i else i)
\<lbrakk>?x \<in> {0..<n} \<rightarrow> {0..<m}; \<forall>i. \<not> i < n \<longrightarrow> ?x i = i; strict_mono_on {0..<n} ?x\<rbrakk> \<Longrightarrow> ?x \<in> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}

goal (1 subgoal):
 1. (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = {f \<in> {0..<n} \<rightarrow> {0..<m}. (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i) \<and> strict_mono_on {0..<n} f}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n} = F_strict

goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
let ?g = "(\<lambda>f. det (submatrix A UNIV (f`{0..<n})) * det(submatrix B (f`{0..<n}) UNIV))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
have "det (A*B) = sum ((\<lambda>f. det (submatrix A UNIV (f ` {0..<n}))
    * det (submatrix B (f ` {0..<n}) UNIV)) \<circ> ?f) {I. I \<subseteq> {0..<m} \<and> card I = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (A * B) = sum ((\<lambda>f. Determinant.det (submatrix A UNIV (f ` {0..<n})) * Determinant.det (submatrix B (f ` {0..<n}) UNIV)) \<circ> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i)) {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
unfolding Cauchy_Binet1 f_setI[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>f\<in>(\<lambda>I i. if i < n then sorted_list_of_set I ! i else i) ` {I. I \<subseteq> {0..<m} \<and> card I = n}. Determinant.det (submatrix A UNIV (f ` {0..<n})) * Determinant.det (submatrix B (f ` {0..<n}) UNIV)) = sum ((\<lambda>f. Determinant.det (submatrix A UNIV (f ` {0..<n})) * Determinant.det (submatrix B (f ` {0..<n}) UNIV)) \<circ> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i)) {I. I \<subseteq> {0..<m} \<and> card I = n}
[PROOF STEP]
by (rule sum.reindex[OF inj_on])
[PROOF STATE]
proof (state)
this:
Determinant.det (A * B) = sum ((\<lambda>f. Determinant.det (submatrix A UNIV (f ` {0..<n})) * Determinant.det (submatrix B (f ` {0..<n}) UNIV)) \<circ> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i)) {I. I \<subseteq> {0..<m} \<and> card I = n}

goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Determinant.det (A * B) = sum ((\<lambda>f. Determinant.det (submatrix A UNIV (f ` {0..<n})) * Determinant.det (submatrix B (f ` {0..<n}) UNIV)) \<circ> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i)) {I. I \<subseteq> {0..<m} \<and> card I = n}

goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
have "... = (\<Sum>I\<in>{I. I\<subseteq>{0..<m} \<and> card I=n}.det(submatrix A UNIV I)*det(submatrix B I UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((\<lambda>f. Determinant.det (submatrix A UNIV (f ` {0..<n})) * Determinant.det (submatrix B (f ` {0..<n}) UNIV)) \<circ> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i)) {I. I \<subseteq> {0..<m} \<and> card I = n} = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
by (rule sum.cong, insert rw, auto)
[PROOF STATE]
proof (state)
this:
sum ((\<lambda>f. Determinant.det (submatrix A UNIV (f ` {0..<n})) * Determinant.det (submatrix B (f ` {0..<n}) UNIV)) \<circ> (\<lambda>I i. if i < n then sorted_list_of_set I ! i else i)) {I. I \<subseteq> {0..<m} \<and> card I = n} = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))

goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))

goal (1 subgoal):
 1. Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Determinant.det (A * B) = (\<Sum>I | I \<subseteq> {0..<m} \<and> card I = n. Determinant.det (submatrix A UNIV I) * Determinant.det (submatrix B I UNIV))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma L1_int_ineq:
  "abs(\<integral>x. f x \<partial>M) \<le> Norm (\<LL> 1 M) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
proof (cases "integrable M f")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
 2. \<not> integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
integrable M f

goal (2 subgoals):
 1. integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
 2. \<not> integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable M f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable M f

goal (1 subgoal):
 1. \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
using L1_I(2)[OF True]
[PROOF STATE]
proof (prove)
using this:
integrable M f
Norm (\<LL> 1 M) f = LINT x|M. \<bar>f x\<bar>

goal (1 subgoal):
 1. \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f

goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> integrable M f

goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> integrable M f
[PROOF STEP]
have "(\<integral>x. f x \<partial>M) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> integrable M f

goal (1 subgoal):
 1. integral\<^sup>L M f = 0
[PROOF STEP]
by (simp add: not_integrable_integral_eq)
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M f = 0

goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>L M f = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L M f = 0

goal (1 subgoal):
 1. \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
using Norm_nonneg
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L M f = 0
0 \<le> Norm ?N ?x

goal (1 subgoal):
 1. \<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>integral\<^sup>L M f\<bar> \<le> Norm (\<LL> 1 M) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l2norm_neg:
   "f square_integrable S \<Longrightarrow> l2norm S (\<lambda>x. - f x) = l2norm S f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f square_integrable S \<Longrightarrow> l2norm S (\<lambda>x. - f x) = l2norm S f
[PROOF STEP]
using l2norm_lmult [of f S "-1"]
[PROOF STATE]
proof (prove)
using this:
f square_integrable S \<Longrightarrow> l2norm S (\<lambda>x. - 1 * f x) = \<bar>- 1\<bar> * l2norm S f

goal (1 subgoal):
 1. f square_integrable S \<Longrightarrow> l2norm S (\<lambda>x. - f x) = l2norm S f
[PROOF STEP]
by simp


[STATEMENT]
lemma number_partition_of_functions_of:
  assumes "finite A" "finite B"
  assumes "number_partition (card A) N" "size N \<le> card B"
  shows "number_partition_of A B (functions_of A B N) = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
number_partition (card A) N
size N \<le> card B
[PROOF STEP]
have "functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
number_partition (card A) N
size N \<le> card B

goal (1 subgoal):
 1. functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
[PROOF STEP]
using functions_of assms
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
number_partition (card A) N
size N \<le> card B
\<lbrakk>finite ?A; finite ?B; number_partition (card ?A) ?N; size ?N \<le> card ?B\<rbrakk> \<Longrightarrow> functions_of ?A ?B ?N \<in> (?A \<rightarrow>\<^sub>E ?B) // domain_and_range_permutation ?A ?B
finite A
finite B
number_partition (card A) N
size N \<le> card B

goal (1 subgoal):
 1. functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
[PROOF STEP]
obtain f where "f \<in> A \<rightarrow>\<^sub>E B" and "functions_of A B N = domain_and_range_permutation A B `` {f}"
[PROOF STATE]
proof (prove)
using this:
functions_of A B N \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; functions_of A B N = domain_and_range_permutation A B `` {f}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson quotientE)
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B
functions_of A B N = domain_and_range_permutation A B `` {f}

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f \<in> A \<rightarrow>\<^sub>E B
functions_of A B N = domain_and_range_permutation A B `` {f}
[PROOF STEP]
have "f \<in> functions_of A B N"
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
functions_of A B N = domain_and_range_permutation A B `` {f}

goal (1 subgoal):
 1. f \<in> functions_of A B N
[PROOF STEP]
using equiv_domain_and_range_permutation equiv_class_self
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<rightarrow>\<^sub>E B
functions_of A B N = domain_and_range_permutation A B `` {f}
equiv (?A \<rightarrow>\<^sub>E ?B) (domain_and_range_permutation ?A ?B)
\<lbrakk>equiv ?A ?r; ?a \<in> ?A\<rbrakk> \<Longrightarrow> ?a \<in> ?r `` {?a}

goal (1 subgoal):
 1. f \<in> functions_of A B N
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f \<in> functions_of A B N

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
have "number_partition_of A B (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N)
[PROOF STEP]
unfolding number_partition_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
number_partition_of A B (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N)

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
number_partition_of A B (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N)

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
have "\<dots> = univ (\<lambda>f.  image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})
[PROOF STEP]
unfolding \<open>functions_of A B N = domain_and_range_permutation A B `` {f}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (functions_of A B N) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
have "\<dots> = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))
[PROOF STEP]
using \<open>finite B\<close> \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> equiv_domain_and_range_permutation
      multiset_of_partition_cards_respects_domain_and_range_permutation
[PROOF STATE]
proof (prove)
using this:
finite B
f \<in> A \<rightarrow>\<^sub>E B
equiv (?A \<rightarrow>\<^sub>E ?B) (domain_and_range_permutation ?A ?B)
finite ?B \<Longrightarrow> (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> ?A. f x = b}) ` ?B - {{}}))) respects domain_and_range_permutation ?A ?B

goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))
[PROOF STEP]
by (subst univ_commute') auto
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
have "image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
using \<open>f \<in> functions_of A B N\<close>
[PROOF STATE]
proof (prove)
using this:
f \<in> functions_of A B N

goal (1 subgoal):
 1. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
unfolding functions_of_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {f \<in> A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N}

goal (1 subgoal):
 1. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
number_partition_of A B (functions_of A B N) = N

goal (1 subgoal):
 1. number_partition_of A B (functions_of A B N) = N
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
number_partition_of A B (functions_of A B N) = N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSLIM_isNSCont: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S (f a) \<Longrightarrow> isNSCont f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S f a \<Longrightarrow> isNSCont f a
[PROOF STEP]
by (force simp add: isNSCont_def NSLIM_def)


[STATEMENT]
lemma valid_UV_lists_nemtpy':
  "\<lbrakk>finite xs; set U \<inter> set V = {}; set U \<subseteq> xs; set V \<subseteq> xs; distinct U; distinct V\<rbrakk>
    \<Longrightarrow> {x. \<exists>as bs cs. as@U@bs@V@cs = x \<and> set x = xs \<and> distinct x} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite xs; set U \<inter> set V = {}; set U \<subseteq> xs; set V \<subseteq> xs; distinct U; distinct V\<rbrakk> \<Longrightarrow> {x. \<exists>as bs cs. as @ U @ bs @ V @ cs = x \<and> set x = xs \<and> distinct x} \<noteq> {}
[PROOF STEP]
using valid_UV_lists_nemtpy[of xs]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite xs; set (?U @ ?V) \<subseteq> xs; distinct (?U @ ?V)\<rbrakk> \<Longrightarrow> {x. \<exists>as bs cs. as @ ?U @ bs @ ?V @ cs = x \<and> set x = xs \<and> distinct x} \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>finite xs; set U \<inter> set V = {}; set U \<subseteq> xs; set V \<subseteq> xs; distinct U; distinct V\<rbrakk> \<Longrightarrow> {x. \<exists>as bs cs. as @ U @ bs @ V @ cs = x \<and> set x = xs \<and> distinct x} \<noteq> {}
[PROOF STEP]
by simp


[STATEMENT]
lemma map_ext:
  "\<lbrakk> \<And> x y. (x, y) \<in>\<^sub>m A \<longleftrightarrow> (x, y) \<in>\<^sub>m B \<rbrakk> \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. ((x, y) \<in>\<^sub>m A) = ((x, y) \<in>\<^sub>m B)) \<Longrightarrow> A = B
[PROOF STEP]
by (rule ext, auto, metis not_Some_eq)


[STATEMENT]
lemma AE_completion: "(AE x in M. P x) \<Longrightarrow> (AE x in completion M. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere M P \<Longrightarrow> almost_everywhere (completion M) P
[PROOF STEP]
unfolding eventually_ae_filter
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bex (null_sets M) ((\<subseteq>) {x \<in> space M. \<not> P x}) \<Longrightarrow> Bex (null_sets (completion M)) ((\<subseteq>) {x \<in> space (completion M). \<not> P x})
[PROOF STEP]
by (auto intro: null_sets_completionI)