[STATEMENT]
lemma smod_int_range:
  \<open>a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}\<close>
  if \<open>b \<noteq> 0\<close> for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}
[PROOF STEP]
define m n where \<open>m = nat \<bar>a\<bar>\<close> \<open>n = nat \<bar>b\<bar>\<close>
[PROOF STATE]
proof (state)
this:
m = nat \<bar>a\<bar>
n = nat \<bar>b\<bar>

goal (1 subgoal):
 1. a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = nat \<bar>a\<bar>
n = nat \<bar>b\<bar>
[PROOF STEP]
have \<open>\<bar>a\<bar> = int m\<close> \<open>\<bar>b\<bar> = int n\<close>
[PROOF STATE]
proof (prove)
using this:
m = nat \<bar>a\<bar>
n = nat \<bar>b\<bar>

goal (1 subgoal):
 1. \<bar>a\<bar> = int m &&& \<bar>b\<bar> = int n
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> = int m
\<bar>b\<bar> = int n

goal (1 subgoal):
 1. a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> 0
\<bar>a\<bar> = int m
\<bar>b\<bar> = int n
[PROOF STEP]
have \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0
\<bar>a\<bar> = int m
\<bar>b\<bar> = int n

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

goal (1 subgoal):
 1. a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}
[PROOF STEP]
with signed_modulo_int_def [of a b] \<open>\<bar>a\<bar> = int m\<close> \<open>\<bar>b\<bar> = int n\<close>
[PROOF STATE]
proof (chain)
picking this:
a smod b = sgn a * (\<bar>a\<bar> mod \<bar>b\<bar>)
\<bar>a\<bar> = int m
\<bar>b\<bar> = int n
0 < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a smod b = sgn a * (\<bar>a\<bar> mod \<bar>b\<bar>)
\<bar>a\<bar> = int m
\<bar>b\<bar> = int n
0 < n

goal (1 subgoal):
 1. a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}
[PROOF STEP]
by (auto simp add: sgn_if diff_le_eq int_one_le_iff_zero_less simp flip: of_nat_mod of_nat_diff)
[PROOF STATE]
proof (state)
this:
a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma startsby_zero_power: "a $ 0 = 0 \<Longrightarrow> n > 0 \<Longrightarrow> a^n $0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a $ 0 = (0::'a); 0 < n\<rbrakk> \<Longrightarrow> a ^ n $ 0 = (0::'a)
[PROOF STEP]
by (simp add: fps_power_zeroth zero_power)


[STATEMENT]
lemma "InvOf y xs ys = {(x,y)|x. (x,y)\<in>Inv xs ys}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y) |x. x < y in xs \<and> y < x in ys} = {(x, y) |x. (x, y) \<in> Inv xs ys}
[PROOF STEP]
unfolding Inv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y) |x. x < y in xs \<and> y < x in ys} = {(x, y) |x. (x, y) \<in> {(x, y). x < y in xs \<and> y < x in ys}}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in category) cat_cf_rcomp_Hom_ObjMap_vrange:
  assumes "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,\<GG>-)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,\<GG>-)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
[PROOF STEP]
using category_axioms assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<CC>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,\<GG>-)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cf_rcomp_Hom_def
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<CC>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<CC> Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-) \<GG>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
[PROOF STEP]
by (intro cf_cn_cov_rcomp_ObjMap_vrange)
    (cs_concl cs_shallow cs_intro: cat_cs_intros)


[STATEMENT]
lemma gt_0_lt_mult_gt_1_hmset:
  fixes m n :: hmultiset
  assumes "m > 0" and "n > 1"
  shows "m < m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < m * n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
1 < n

goal (1 subgoal):
 1. m < m * n
[PROOF STEP]
by (metis mult.right_neutral mult_less_cancel1_hmset)


[STATEMENT]
lemma scaleHR_left_diff_distrib: "\<And>a b x. scaleHR (a - b) x = scaleHR a x - scaleHR b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. scaleHR (a - b) x = scaleHR a x - scaleHR b x
[PROOF STEP]
by transfer (rule scaleR_left_diff_distrib)


[STATEMENT]
lemma wellf_Pr_arity_greater_1: "wellf (Pr n f g) \<Longrightarrow> arity (Pr n f g) > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellf (Pr n f g) \<Longrightarrow> 1 < arity (Pr n f g)
[PROOF STEP]
using wellf_arity_nonzero
[PROOF STATE]
proof (prove)
using this:
wellf ?f \<Longrightarrow> 0 < arity ?f

goal (1 subgoal):
 1. wellf (Pr n f g) \<Longrightarrow> 1 < arity (Pr n f g)
[PROOF STEP]
by auto


[STATEMENT]
lemma comp_fun_commute_maybe_or: "comp_fun_commute maybe_or"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute (\<or>?)
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y x. (\<or>?) y \<circ> (\<or>?) x = (\<or>?) x \<circ> (\<or>?) y
[PROOF STEP]
apply (simp add: comp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y x. (\<lambda>xa. y \<or>? (x \<or>? xa)) = (\<lambda>xa. x \<or>? (y \<or>? xa))
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y x xa. y \<or>? (x \<or>? xa) = x \<or>? (y \<or>? xa)
[PROOF STEP]
by (simp add: add.left_commute)


[STATEMENT]
lemma rwp_on_rspR_on_wca_on: \<comment> \<open>\citet[T.2]{Sen:1970}\<close>
  assumes "rwp_on A f = rspR_on A f"
  shows "wca_on A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wca_on A f
[PROOF STEP]
using %invisible assms
[PROOF STATE]
proof (prove)
using this:
rwp_on A f = rspR_on A f

goal (1 subgoal):
 1. wca_on A f
[PROOF STEP]
unfolding wca_on_def rsp_on_def rspR_on_def
[PROOF STATE]
proof (prove)
using this:
rwp_on A f = {(x, y). {x, y} \<subseteq> A \<and> (y, x) \<notin> {(x, y). \<exists>B\<subseteq>A. x \<in> Rf f B \<and> y \<in> f B}}

goal (1 subgoal):
 1. \<forall>(x, y)\<in>rwp_on A f. \<forall>B\<subseteq>A. x \<in> f B \<and> y \<in> B \<longrightarrow> y \<in> f B
[PROOF STEP]
by blast


[STATEMENT]
lemma is_function_tuple_append:
  assumes "is_function_tuple R n fs"
  assumes "is_function_tuple R n gs"
  shows "is_function_tuple R n (fs@gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_function_tuple R n (fs @ gs)
[PROOF STEP]
using assms is_function_tupleI set_append
[PROOF STATE]
proof (prove)
using this:
is_function_tuple R n fs
is_function_tuple R n gs
set ?fs \<subseteq> carrier (?R\<^bsup>?n\<^esup>) \<rightarrow> carrier ?R \<Longrightarrow> is_function_tuple ?R ?n ?fs
set (?xs @ ?ys) = set ?xs \<union> set ?ys

goal (1 subgoal):
 1. is_function_tuple R n (fs @ gs)
[PROOF STEP]
by (simp add: is_function_tuple_def)


[STATEMENT]
lemma pochhammer_poly_0 [simp]: "pochhammer_poly 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer_poly 0 = 1
[PROOF STEP]
by (simp add: pochhammer_poly_def)


[STATEMENT]
lemma prefixToElementAppend:
  shows "prefixToElement e (M1 @ M2) =
            (if e \<in> set (elements M1) then
                prefixToElement e M1
             else
                M1 @ prefixToElement e M2
             )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefixToElement e (M1 @ M2) = (if e \<in> set (elements M1) then prefixToElement e M1 else M1 @ prefixToElement e M2)
[PROOF STEP]
by (induct M1) auto


[STATEMENT]
lemma convex_hull_mono: "Vs \<subseteq> Ws \<Longrightarrow> convex_hull Vs \<subseteq> convex_hull Ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Vs \<subseteq> Ws \<Longrightarrow> convex_hull Vs \<subseteq> convex_hull Ws
[PROOF STEP]
unfolding convex_hull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Vs \<subseteq> Ws \<Longrightarrow> {x. \<exists>Ws c. finite Ws \<and> Ws \<subseteq> Vs \<and> convex_lincomb c Ws x} \<subseteq> {x. \<exists>Wsa c. finite Wsa \<and> Wsa \<subseteq> Ws \<and> convex_lincomb c Wsa x}
[PROOF STEP]
by auto


[STATEMENT]
lemma cnjE:
  assumes "x \<noteq> 0"
  shows "cnj x = cor ((cmod x)\<^sup>2) / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj x = cor ((cmod x)\<^sup>2) / x
[PROOF STEP]
using complex_mult_cnj_cmod[of x] assms
[PROOF STATE]
proof (prove)
using this:
x * cnj x = cor ((cmod x)\<^sup>2)
x \<noteq> 0

goal (1 subgoal):
 1. cnj x = cor ((cmod x)\<^sup>2) / x
[PROOF STEP]
by (auto simp add: field_simps)


[STATEMENT]
lemma matrix_vector_mult_basis:
  fixes A :: "real^'n^'m"
  shows "A *v (axis k 1) = column k A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v axis k 1 = column k A
[PROOF STEP]
by (simp add: cart_eq_inner_axis column_def matrix_mult_dot)


[STATEMENT]
lemma ratrel_iff [simp]: "ratrel x y \<longleftrightarrow> snd x \<noteq> 0 \<and> snd y \<noteq> 0 \<and> fst x * snd y = fst y * snd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ratrel x y = (snd x \<noteq> 0 \<and> snd y \<noteq> 0 \<and> fst x * snd y = fst y * snd x)
[PROOF STEP]
by (simp add: ratrel_def)


[STATEMENT]
lemma list_all2_eq_fun_conv_map: "list_all2 (\<lambda>x y. x = f y) xs ys \<longleftrightarrow> xs = map f ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (\<lambda>x y. x = f y) xs ys = (xs = map f ys)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. list_all2 (\<lambda>x y. x = f y) xs ys \<Longrightarrow> xs = map f ys
 2. xs = map f ys \<Longrightarrow> list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
assume "list_all2 (\<lambda>x y. x = f y) xs ys"
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x y. x = f y) xs ys

goal (2 subgoals):
 1. list_all2 (\<lambda>x y. x = f y) xs ys \<Longrightarrow> xs = map f ys
 2. xs = map f ys \<Longrightarrow> list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
thus "xs = map f ys"
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<lambda>x y. x = f y) xs ys

goal (1 subgoal):
 1. xs = map f ys
[PROOF STEP]
by induction auto
[PROOF STATE]
proof (state)
this:
xs = map f ys

goal (1 subgoal):
 1. xs = map f ys \<Longrightarrow> list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xs = map f ys \<Longrightarrow> list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
assume "xs = map f ys"
[PROOF STATE]
proof (state)
this:
xs = map f ys

goal (1 subgoal):
 1. xs = map f ys \<Longrightarrow> list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
xs = map f ys

goal (1 subgoal):
 1. xs = map f ys \<Longrightarrow> list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
have "list_all2 (\<lambda>x y. x = f y) (map f ys) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (\<lambda>x y. x = f y) (map f ys) ys
[PROOF STEP]
by (induction ys) auto
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x y. x = f y) (map f ys) ys

goal (1 subgoal):
 1. xs = map f ys \<Longrightarrow> list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
xs = map f ys
list_all2 (\<lambda>x y. x = f y) (map f ys) ys
[PROOF STEP]
show "list_all2 (\<lambda>x y. x = f y) xs ys"
[PROOF STATE]
proof (prove)
using this:
xs = map f ys
list_all2 (\<lambda>x y. x = f y) (map f ys) ys

goal (1 subgoal):
 1. list_all2 (\<lambda>x y. x = f y) xs ys
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x y. x = f y) xs ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cosh_real_at_top: "filterlim (cosh :: real \<Rightarrow> real) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim cosh at_top at_top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filterlim cosh at_top at_top
[PROOF STEP]
have *: "((\<lambda>x. exp (- x)) \<longlongrightarrow> (0::real)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (- x)) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (intro filterlim_compose[OF exp_at_bot] filterlim_uminus_at_bot_at_top)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (- x)) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. filterlim cosh at_top at_top
[PROOF STEP]
have "filterlim (\<lambda>x. (1 / 2) * (exp (-x) + exp x) :: real) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. 1 / 2 * (exp (- x) + exp x) :> at_top
[PROOF STEP]
by (rule filterlim_tendsto_pos_mult_at_top[OF _ _
               filterlim_tendsto_add_at_top[OF *]] tendsto_const)+ (auto simp: exp_at_top)
[PROOF STATE]
proof (state)
this:
LIM x at_top. 1 / 2 * (exp (- x) + exp x) :> at_top

goal (1 subgoal):
 1. filterlim cosh at_top at_top
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LIM x at_top. 1 / 2 * (exp (- x) + exp x) :> at_top

goal (1 subgoal):
 1. filterlim cosh at_top at_top
[PROOF STEP]
have "(\<lambda>x. (1 / 2) * (exp (-x) + exp x) :: real) = cosh"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 1 / 2 * (exp (- x) + exp x)) = cosh
[PROOF STEP]
by (simp add: fun_eq_iff cosh_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. 1 / 2 * (exp (- x) + exp x)) = cosh

goal (1 subgoal):
 1. filterlim cosh at_top at_top
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
filterlim cosh at_top at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim cosh at_top at_top

goal (1 subgoal):
 1. filterlim cosh at_top at_top
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
filterlim cosh at_top at_top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Module) mHom_l_zero:"\<lbrakk>R module N; f \<in> mHom R M N\<rbrakk>
              \<Longrightarrow> tOp_mHom R M N (mzeromap M N) f = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N (mzeromap M N) f = f
[PROOF STEP]
apply (frule mHom_ex_zero [of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; mzeromap M N \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N (mzeromap M N) f = f
[PROOF STEP]
apply (frule tOp_mHom_closed [of N "mzeromap M N" f], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; mzeromap M N \<in> mHom R M N; tOp_mHom R M N (mzeromap M N) f \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N (mzeromap M N) f = f
[PROOF STEP]
apply (rule mHom_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; mzeromap M N \<in> mHom R M N; tOp_mHom R M N (mzeromap M N) f \<in> mHom R M N\<rbrakk> \<Longrightarrow> \<forall>m\<in>carrier M. tOp_mHom R M N (mzeromap M N) f m = f m
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; mzeromap M N \<in> mHom R M N; tOp_mHom R M N (mzeromap M N) f \<in> mHom R M N; m \<in> carrier M\<rbrakk> \<Longrightarrow> tOp_mHom R M N (mzeromap M N) f m = f m
[PROOF STEP]
apply (simp add:tOp_mHom_def, simp add:mzeromap_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; (\<lambda>x\<in>carrier M. \<zero>\<^bsub>N\<^esub>) \<in> mHom R M N; (\<lambda>x\<in>carrier M. (if x \<in> carrier M then \<zero>\<^bsub>N\<^esub> else undefined) \<plusminus>\<^bsub>N\<^esub> f x) \<in> mHom R M N; m \<in> carrier M\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>N\<^esub> \<plusminus>\<^bsub>N\<^esub> f m = f m
[PROOF STEP]
apply (frule_tac f = f and m = m in mHom_mem [of N], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; (\<lambda>x\<in>carrier M. \<zero>\<^bsub>N\<^esub>) \<in> mHom R M N; (\<lambda>x\<in>carrier M. (if x \<in> carrier M then \<zero>\<^bsub>N\<^esub> else undefined) \<plusminus>\<^bsub>N\<^esub> f x) \<in> mHom R M N; m \<in> carrier M; f m \<in> carrier N\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>N\<^esub> \<plusminus>\<^bsub>N\<^esub> f m = f m
[PROOF STEP]
apply (frule Module.module_is_ag [of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; (\<lambda>x\<in>carrier M. \<zero>\<^bsub>N\<^esub>) \<in> mHom R M N; (\<lambda>x\<in>carrier M. (if x \<in> carrier M then \<zero>\<^bsub>N\<^esub> else undefined) \<plusminus>\<^bsub>N\<^esub> f x) \<in> mHom R M N; m \<in> carrier M; f m \<in> carrier N; aGroup N\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>N\<^esub> \<plusminus>\<^bsub>N\<^esub> f m = f m
[PROOF STEP]
apply (simp add:aGroup.ag_l_zero[of N])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma degree_polyadd:
  assumes np: "isnpolyh p n0"
    and nq: "isnpolyh q n1"
  shows "degree (p +\<^sub>p q) \<le> max (degree p) (degree q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Reflected_Multivariate_Polynomial.degree (p +\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree q)
[PROOF STEP]
using degreen_polyadd[OF np nq, where m= "0"] degree_eq_degreen0
[PROOF STATE]
proof (prove)
using this:
0 \<le> max n0 n1 \<Longrightarrow> degreen (p +\<^sub>p q) 0 \<le> max (degreen p 0) (degreen q 0)
Reflected_Multivariate_Polynomial.degree ?p = degreen ?p 0

goal (1 subgoal):
 1. Reflected_Multivariate_Polynomial.degree (p +\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree q)
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_one_over_one_minus_fps_X_squared':
  assumes "inverse (1::'a::{ring_1,inverse}) = 1"
  shows   "inverse ((1 - fps_X)^2 :: 'a  fps) = Abs_fps (\<lambda>n. of_nat (n+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse ((1 - fps_X)\<^sup>2) = Abs_fps (\<lambda>n. of_nat (n + 1))
[PROOF STEP]
using   assms fps_lr_one_over_one_minus_fps_X_squared(2)
[PROOF STATE]
proof (prove)
using this:
inverse (1::'a) = (1::'a)
fps_right_inverse ((1 - fps_X)\<^sup>2) (1::?'a) = Abs_fps (\<lambda>n. of_nat (n + 1))

goal (1 subgoal):
 1. inverse ((1 - fps_X)\<^sup>2) = Abs_fps (\<lambda>n. of_nat (n + 1))
[PROOF STEP]
by      (simp add: fps_inverse_def power2_eq_square)


[STATEMENT]
lemma vector_ssub_ldistrib: "(c::'a::ring) *s (x - y) = c *s x - c *s y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c *s (x - y) = c *s x - c *s y
[PROOF STEP]
by (vector field_simps)


[STATEMENT]
lemma leftrec_43: "n > 0 \<Longrightarrow>
             leftrec u v lc rc ((4 * real m + 3) / 2 ^ (Suc n)) =
                 rc (leftrec u v lc rc ((2 * real m + 1) / 2^n)) (rightrec u v lc rc ((2 * real m + 1) / 2^n))
                 (midpoint (leftrec u v lc rc ((2 * real m + 1) / 2^n)) (rightrec u v lc rc ((2 * real m + 1) / 2^n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> leftrec u v lc rc ((4 * real m + 3) / 2 ^ Suc n) = rc (leftrec u v lc rc ((2 * real m + 1) / 2 ^ n)) (rightrec u v lc rc ((2 * real m + 1) / 2 ^ n)) (midpoint (leftrec u v lc rc ((2 * real m + 1) / 2 ^ n)) (rightrec u v lc rc ((2 * real m + 1) / 2 ^ n)))
[PROOF STEP]
unfolding dyad_rec2_def dyad_rec_43_times2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> fst (case dyad_rec (\<lambda>z. (u, v)) (\<lambda>(a, b). (a, lc a b (midpoint a b))) (\<lambda>(a, b). (rc a b (midpoint a b), b)) (2 * (2 * real m + 1) / 2 ^ n) of (a, b) \<Rightarrow> (rc a b (midpoint a b), b)) = rc (fst (dyad_rec (\<lambda>z. (u, v)) (\<lambda>(a, b). (a, lc a b (midpoint a b))) (\<lambda>(a, b). (rc a b (midpoint a b), b)) (2 * ((2 * real m + 1) / 2 ^ n)))) (snd (dyad_rec (\<lambda>z. (u, v)) (\<lambda>(a, b). (a, lc a b (midpoint a b))) (\<lambda>(a, b). (rc a b (midpoint a b), b)) (2 * ((2 * real m + 1) / 2 ^ n)))) (midpoint (fst (dyad_rec (\<lambda>z. (u, v)) (\<lambda>(a, b). (a, lc a b (midpoint a b))) (\<lambda>(a, b). (rc a b (midpoint a b), b)) (2 * ((2 * real m + 1) / 2 ^ n)))) (snd (dyad_rec (\<lambda>z. (u, v)) (\<lambda>(a, b). (a, lc a b (midpoint a b))) (\<lambda>(a, b). (rc a b (midpoint a b), b)) (2 * ((2 * real m + 1) / 2 ^ n)))))
[PROOF STEP]
by (simp add: case_prod_beta)


[STATEMENT]
lemma Re_cos: "Re(cos z) = cos(Re z) * (exp(Im z) + exp(-(Im z))) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (cos z) = cos (Re z) * (exp (Im z) + exp (- Im z)) / 2
[PROOF STEP]
by (simp add: cos_exp_eq field_simps Re_divide Re_exp)


[STATEMENT]
lemma box_Complex_eq:
  "box (Complex a c) (Complex b d) = (\<lambda>(x,y). Complex x y) ` (box a b \<times> box c d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. box (Complex a c) (Complex b d) = (\<lambda>(x, y). Complex x y) ` (box a b \<times> box c d)
[PROOF STEP]
by (auto simp: box_def Basis_complex_def image_iff complex_eq_iff)


[STATEMENT]
lemma register_Fst_register_Snd[simp]:
  assumes \<open>register F\<close>
  shows \<open>(F o Fst; F o Snd) = F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<circ> Fst;F \<circ> Snd) = F
[PROOF STEP]
apply (rule tensor_extensionality)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. preregister (F \<circ> Fst;F \<circ> Snd)
 2. preregister F
 3. \<And>a b. (F \<circ> Fst;F \<circ> Snd) (a \<otimes>\<^sub>u b) = F (a \<otimes>\<^sub>u b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
register F

goal (3 subgoals):
 1. preregister (F \<circ> Fst;F \<circ> Snd)
 2. preregister F
 3. \<And>a b. (F \<circ> Fst;F \<circ> Snd) (a \<otimes>\<^sub>u b) = F (a \<otimes>\<^sub>u b)
[PROOF STEP]
by (auto simp: register_pair_apply Fst_def Snd_def register_mult tensor_update_mult)


[STATEMENT]
lemma affine_hull_halfspace_ge:
  fixes a :: "'a::euclidean_space"
  shows "affine hull {x. a \<bullet> x \<ge> r} = (if a = 0 \<and> r > 0 then {} else UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull {x. r \<le> a \<bullet> x} = (if a = (0::'a) \<and> 0 < r then {} else UNIV)
[PROOF STEP]
using affine_hull_halfspace_le [of "-a" "-r"]
[PROOF STATE]
proof (prove)
using this:
affine hull {x. - a \<bullet> x \<le> - r} = (if - a = (0::'a) \<and> - r < 0 then {} else UNIV)

goal (1 subgoal):
 1. affine hull {x. r \<le> a \<bullet> x} = (if a = (0::'a) \<and> 0 < r then {} else UNIV)
[PROOF STEP]
by simp


[STATEMENT]
lemma set_times_plus_distrib: "a *o (b +o C) = (a * b) +o (a *o C)"
  for a b :: "'a::semiring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *o (b +o C) = a * b +o a *o C
[PROOF STEP]
by (auto simp add: elt_set_plus_def elt_set_times_def ring_distribs)


[STATEMENT]
lemma fps_mult_nth_1: "(f * g) $ 1 = f$0 * g$1 + f$1 * g$0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * g) $ 1 = f $ 0 * g $ 1 + f $ 1 * g $ 0
[PROOF STEP]
by (simp add: fps_mult_nth)


[STATEMENT]
lemma oprod_Partial_order: "\<lbrakk>Partial_order r; Partial_order r'\<rbrakk> \<Longrightarrow> Partial_order (r *o r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Partial_order r; Partial_order r'\<rbrakk> \<Longrightarrow> Partial_order (r *o r')
[PROOF STEP]
unfolding partial_order_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Preorder r \<and> antisym r; Preorder r' \<and> antisym r'\<rbrakk> \<Longrightarrow> Preorder (r *o r') \<and> antisym (r *o r')
[PROOF STEP]
using oprod_Preorder oprod_antisym
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Preorder ?r; Preorder ?r'; antisym ?r; antisym ?r'\<rbrakk> \<Longrightarrow> Preorder (?r *o ?r')
\<lbrakk>antisym ?r; antisym ?r'\<rbrakk> \<Longrightarrow> antisym (?r *o ?r')

goal (1 subgoal):
 1. \<lbrakk>Preorder r \<and> antisym r; Preorder r' \<and> antisym r'\<rbrakk> \<Longrightarrow> Preorder (r *o r') \<and> antisym (r *o r')
[PROOF STEP]
by blast


[STATEMENT]
lemma complex_roots:
  "smult (lead_coeff p) (\<Prod>a\<leftarrow>complex_roots_complex p. [:- a, 1:]) = p"
  "length (complex_roots_complex p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (lead_coeff p) (\<Prod>a\<leftarrow>complex_roots_complex p. [:- a, 1:]) = p &&& length (complex_roots_complex p) = degree p
[PROOF STEP]
using someI_ex[OF fundamental_theorem_algebra_factorized]
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (lead_coeff ?p1) (\<Prod>a\<leftarrow>(SOME x. Polynomial.smult (lead_coeff ?p1) (\<Prod>a\<leftarrow>x. [:- a, 1:]) = ?p1 \<and> length x = degree ?p1). [:- a, 1:]) = ?p1 \<and> length (SOME x. Polynomial.smult (lead_coeff ?p1) (\<Prod>a\<leftarrow>x. [:- a, 1:]) = ?p1 \<and> length x = degree ?p1) = degree ?p1

goal (1 subgoal):
 1. Polynomial.smult (lead_coeff p) (\<Prod>a\<leftarrow>complex_roots_complex p. [:- a, 1:]) = p &&& length (complex_roots_complex p) = degree p
[PROOF STEP]
unfolding complex_roots_complex_def
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (lead_coeff ?p1) (\<Prod>a\<leftarrow>(SOME x. Polynomial.smult (lead_coeff ?p1) (\<Prod>a\<leftarrow>x. [:- a, 1:]) = ?p1 \<and> length x = degree ?p1). [:- a, 1:]) = ?p1 \<and> length (SOME x. Polynomial.smult (lead_coeff ?p1) (\<Prod>a\<leftarrow>x. [:- a, 1:]) = ?p1 \<and> length x = degree ?p1) = degree ?p1

goal (1 subgoal):
 1. Polynomial.smult (lead_coeff p) (\<Prod>a\<leftarrow>(SOME as. Polynomial.smult (lead_coeff p) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = p \<and> length as = degree p). [:- a, 1:]) = p &&& length (SOME as. Polynomial.smult (lead_coeff p) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = p \<and> length as = degree p) = degree p
[PROOF STEP]
by simp_all


[STATEMENT]
lemma INF_INF_seq_distrib: "Y \<noteq> {} \<Longrightarrow> (\<Sqinter>x\<in>X. c x) ; (\<Sqinter>y\<in>Y. d y) = (\<Sqinter>x\<in>X. \<Sqinter>y\<in>Y. c x ; d y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> \<Sqinter> (c ` X) ; \<Sqinter> (d ` Y) = (\<Sqinter>x::'c\<in>X. \<Sqinter>y::'b\<in>Y. c x ; d y)
variables:
d :: 'b \<Rightarrow> 'a
X :: 'c set
c :: 'c \<Rightarrow> 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Y :: 'b set
type variables:
'b, 'c :: type
'a :: refinement_lattice
[PROOF STEP]
by (simp add: INF_seq_distrib seq_INF_distrib)


[STATEMENT]
lemma integral_finite_singleton: "integral\<^sup>L P f = (\<Sum>x\<in>Pow S_edges. f x * measure P {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation f = (\<Sum>x\<in>Pow S_edges. f x * prob {x})
[PROOF STEP]
using p_prob prob_eq
[PROOF STATE]
proof (prove)
using this:
0 \<le> p
p \<le> 1
prob ?A = (if ?A \<subseteq> Pow S_edges then \<Sum>edges\<in>?A. p ^ card edges * (1 - p) ^ card (S_edges - edges) else 0)

goal (1 subgoal):
 1. expectation f = (\<Sum>x\<in>Pow S_edges. f x * prob {x})
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> p
p \<le> 1
Sigma_Algebra.measure (point_measure (Pow S_edges) (\<lambda>x. ennreal (p ^ card x * (1 - p) ^ card (S_edges - x)))) ?A = (if ?A \<subseteq> Pow S_edges then \<Sum>edges\<in>?A. p ^ card edges * (1 - p) ^ card (S_edges - edges) else 0)

goal (1 subgoal):
 1. integral\<^sup>L (point_measure (Pow S_edges) (\<lambda>x. ennreal (p ^ card x * (1 - p) ^ card (S_edges - x)))) f = (\<Sum>x\<in>Pow S_edges. f x * Sigma_Algebra.measure (point_measure (Pow S_edges) (\<lambda>x. ennreal (p ^ card x * (1 - p) ^ card (S_edges - x)))) {x})
[PROOF STEP]
by (subst lebesgue_integral_point_measure_finite) (auto intro!: sum.cong)


[STATEMENT]
lemma closure_convex_hull [simp]:
  fixes S :: "'a::euclidean_space set"
  shows "compact S ==> closure(convex hull S) = convex hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact S \<Longrightarrow> closure (convex hull S) = convex hull S
[PROOF STEP]
by (simp add: compact_imp_closed compact_convex_hull)


[STATEMENT]
lemma Re_complex_div_lt_0: "Re (a / b) < 0 \<longleftrightarrow> Re (a * cnj b) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re (a / b) < 0) = (Re (a * cnj b) < 0)
[PROOF STEP]
by (metis less_asym neq_iff Re_complex_div_eq_0 Re_complex_div_gt_0)


[STATEMENT]
lemma odd_addI:
  "even a \<Longrightarrow> odd b \<Longrightarrow> odd (a + b)"
  "odd a \<Longrightarrow> even b \<Longrightarrow> odd (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>even a; odd b\<rbrakk> \<Longrightarrow> odd (a + b)) &&& (\<lbrakk>odd a; even b\<rbrakk> \<Longrightarrow> odd (a + b))
[PROOF STEP]
by auto


[STATEMENT]
lemma is_aligned_and_2_to_k:
  "(n AND 2 ^ k - 1) = 0 \<Longrightarrow> is_aligned (n :: 'a :: len word) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n AND 2 ^ k - 1 = 0 \<Longrightarrow> is_aligned n k
[PROOF STEP]
by (simp add: is_aligned_mask mask_eq_decr_exp)


[STATEMENT]
lemma qbs_exp_morphismI:
  assumes "\<And>\<alpha> \<beta>. \<alpha> \<in> qbs_Mx X \<Longrightarrow>
                 \<beta> \<in> pair_qbs_Mx real_quasi_borel Y \<Longrightarrow>
                 (\<lambda>(r,x). (f \<circ> \<alpha>) r x) \<circ> \<beta> \<in> qbs_Mx Z"
   shows "f \<in> X \<rightarrow>\<^sub>Q exp_qbs Y Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> X \<rightarrow>\<^sub>Q Y \<Rightarrow>\<^sub>Q Z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?\<alpha> \<in> qbs_Mx X; ?\<beta> \<in> pair_qbs_Mx \<real>\<^sub>Q Y\<rbrakk> \<Longrightarrow> (\<lambda>(r, x). (f \<circ> ?\<alpha>) r x) \<circ> ?\<beta> \<in> qbs_Mx Z

goal (1 subgoal):
 1. f \<in> X \<rightarrow>\<^sub>Q Y \<Rightarrow>\<^sub>Q Z
[PROOF STEP]
by(auto intro!: qbs_morphismI simp: exp_qbs_Mx_def comp_def)


[STATEMENT]
lemma "\<forall>x::'a::linordered_field. \<exists>y.
  \<bar>y\<bar> \<noteq> \<bar>x\<bar> \<and> (\<forall>z > max x y. \<exists>w. w \<noteq> y \<and> w \<noteq> z \<and> 3 * w - z \<ge> x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<exists>y. \<bar>y\<bar> \<noteq> \<bar>x\<bar> \<and> (\<forall>z>max x y. \<exists>w. w \<noteq> y \<and> w \<noteq> z \<and> x + y \<le> (3::'a) * w - z)
[PROOF STEP]
by ferrack


[STATEMENT]
lemma contour_integral_zero:
  assumes "valid_path g" "path_image g \<subseteq> S" "pathfinish g = pathstart g" "f holomorphic_on S"
         "\<And>\<gamma> z. \<lbrakk>path \<gamma>; path_image \<gamma> \<subseteq> S; pathfinish \<gamma> = pathstart \<gamma>; z \<notin> S\<rbrakk> \<Longrightarrow> winding_number \<gamma> z = 0"
  shows "(f has_contour_integral 0) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_contour_integral 0) g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path g
path_image g \<subseteq> S
pathfinish g = pathstart g
f holomorphic_on S
\<lbrakk>path ?\<gamma>; path_image ?\<gamma> \<subseteq> S; pathfinish ?\<gamma> = pathstart ?\<gamma>; ?z \<notin> S\<rbrakk> \<Longrightarrow> winding_number ?\<gamma> ?z = 0

goal (1 subgoal):
 1. (f has_contour_integral 0) g
[PROOF STEP]
by (meson Cauchy_theorem_global openS valid_path_imp_path)


[STATEMENT]
lemma intpow_mult_distrib: "(x * y) ^\<^sub>Z m = x ^\<^sub>Z m * y ^\<^sub>Z m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y) ^\<^sub>Z m = x ^\<^sub>Z m * y ^\<^sub>Z m
[PROOF STEP]
by (simp add: intpow_def power_mult_distrib)


[STATEMENT]
lemma setdist_eq_0_sing_1:
  "setdist {x} S = 0 \<longleftrightarrow> S = {} \<or> x \<in> closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (setdist {x} S = 0) = (S = {} \<or> x \<in> closure S)
[PROOF STEP]
by (metis in_closure_iff_infdist_zero infdist_def infdist_eq_setdist)


[STATEMENT]
lemma continuous_imp_closed_map:
   "\<lbrakk>continuous_map X Y f; compact_space X; Hausdorff_space Y\<rbrakk> \<Longrightarrow> closed_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; compact_space X; Hausdorff_space Y\<rbrakk> \<Longrightarrow> closed_map X Y f
[PROOF STEP]
by (meson closed_map_def closedin_compact_space compactin_imp_closedin image_compactin)


[STATEMENT]
lemma isotoneI [intro?]:
  fixes f :: "'a \<Rightarrow> 'b"
  assumes "weak_partial_order L1"
          "weak_partial_order L2"
          "(\<And>x y. \<lbrakk>x \<in> carrier L1; y \<in> carrier L1; x \<sqsubseteq>\<^bsub>L1\<^esub> y\<rbrakk>
                   \<Longrightarrow> f x \<sqsubseteq>\<^bsub>L2\<^esub> f y)"
  shows "isotone L1 L2 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isotone L1 L2 f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
weak_partial_order L1
weak_partial_order L2
\<lbrakk>?x \<in> carrier L1; ?y \<in> carrier L1; ?x \<sqsubseteq>\<^bsub>L1\<^esub> ?y\<rbrakk> \<Longrightarrow> f ?x \<sqsubseteq>\<^bsub>L2\<^esub> f ?y

goal (1 subgoal):
 1. isotone L1 L2 f
[PROOF STEP]
by (auto simp add:isotone_def)


[STATEMENT]
lemma count_vec_vCons: "count_vec (vCons aa v) a = (if (aa = a) then count_vec v a + 1 else count_vec v a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec (vCons aa v) a = (if aa = a then count_vec v a + 1 else count_vec v a)
[PROOF STEP]
by(simp add: vec_mset_vCons)


[STATEMENT]
lemma "(0::nat) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
by linarith


[STATEMENT]
lemma in_nlists_Suc_iff: "xs \<in> nlists A (Suc n) \<longleftrightarrow> (\<exists>x xs'. xs = x # xs' \<and> x \<in> A \<and> xs' \<in> nlists A n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> nlists A (Suc n)) = (\<exists>x xs'. xs = x # xs' \<and> x \<in> A \<and> xs' \<in> nlists A n)
[PROOF STEP]
by(cases xs) simp_all


[STATEMENT]
lemma mat_of_rows_row[simp]:
  assumes i:"i < length vs" and n: "vs ! i \<in> carrier_vec n"
  shows "row (mat_of_rows n vs) i = vs ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_of_rows n vs) i = vs ! i
[PROOF STEP]
unfolding mat_of_rows_def row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_col (mat (length vs) n (\<lambda>(i, y). vs ! i $ y))) (\<lambda>j. mat (length vs) n (\<lambda>(i, y). vs ! i $ y) $$ (i, j)) = vs ! i
[PROOF STEP]
using n i
[PROOF STATE]
proof (prove)
using this:
vs ! i \<in> carrier_vec n
i < length vs

goal (1 subgoal):
 1. vec (dim_col (mat (length vs) n (\<lambda>(i, y). vs ! i $ y))) (\<lambda>j. mat (length vs) n (\<lambda>(i, y). vs ! i $ y) $$ (i, j)) = vs ! i
[PROOF STEP]
by auto


[STATEMENT]
lemma ct_suffix_imp_ct_list_eq:
  assumes "ct_suffix xs ys"
  shows "ct_list_eq (drop (length ys - length xs) ys) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ct_list_eq (drop (length ys - length xs) ys) xs
[PROOF STEP]
using assms ct_list_eq_def list_all2_lengthD
[PROOF STATE]
proof (prove)
using this:
ct_suffix xs ys
ct_list_eq ?ct1s ?ct2s = list_all2 ct_eq ?ct1s ?ct2s
list_all2 ?P ?xs ?ys \<Longrightarrow> length ?xs = length ?ys

goal (1 subgoal):
 1. ct_list_eq (drop (length ys - length xs) ys) xs
[PROOF STEP]
unfolding ct_suffix_def
[PROOF STATE]
proof (prove)
using this:
\<exists>as bs. ys = as @ bs \<and> ct_list_eq bs xs
ct_list_eq ?ct1s ?ct2s = list_all2 ct_eq ?ct1s ?ct2s
list_all2 ?P ?xs ?ys \<Longrightarrow> length ?xs = length ?ys

goal (1 subgoal):
 1. ct_list_eq (drop (length ys - length xs) ys) xs
[PROOF STEP]
by fastforce


[STATEMENT]
lemma coeff_Q: "Polynomial.coeff Q k = (if k > n then 0 else (-1) ^ (n - k) * e (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
[PROOF STEP]
proof (cases "k \<le> n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
 2. \<not> k \<le> n \<Longrightarrow> poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k \<le> n

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
 2. \<not> k \<le> n \<Longrightarrow> poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
[PROOF STEP]
using coeff_poly_from_roots[of "{..<n}" k x]
[PROOF STATE]
proof (prove)
using this:
k \<le> n
\<lbrakk>finite {..<n}; k \<le> card {..<n}\<rbrakk> \<Longrightarrow> poly.coeff (\<Prod>xa<n. [:- x xa, 1:]) k = (- 1) ^ (card {..<n} - k) * (\<Sum>X | X \<subseteq> {..<n} \<and> card X = card {..<n} - k. prod x X)

goal (1 subgoal):
 1. poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
[PROOF STEP]
by (auto simp: Q_def e_def)
[PROOF STATE]
proof (state)
this:
poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> poly.coeff Q k = (if n < k then 0 else (- 1) ^ (n - k) * e (n - k))
[PROOF STEP]
qed (auto simp: Polynomial.coeff_eq_0)


[STATEMENT]
lemma fls_integral_X_inv_power':
  assumes "n \<ge> 1"
  shows
    "fls_integral (fls_X_inv ^ n :: 'a :: division_ring fls) =
      - fls_const (inverse (of_nat (n-1))) * fls_X_inv ^ (n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
proof (cases "n = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 1

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
n \<noteq> 1
[PROOF STEP]
have n: "n \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
n \<noteq> 1

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

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
hence
    "fls_integral (fls_X_inv ^ n :: 'a fls) =
      fls_const (inverse (- of_nat (nat (int n - 1)))) * fls_X_inv ^ (n-1)"
[PROOF STATE]
proof (prove)
using this:
2 \<le> n

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = fls_const (inverse (- of_nat (nat (int n - 1)))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
by (simp add: fls_integral_X_inv_power)
[PROOF STATE]
proof (state)
this:
fls_integral (fls_X_inv ^ n) = fls_const (inverse (- of_nat (nat (int n - 1)))) * fls_X_inv ^ (n - 1)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fls_integral (fls_X_inv ^ n) = fls_const (inverse (- of_nat (nat (int n - 1)))) * fls_X_inv ^ (n - 1)

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
2 \<le> n
[PROOF STEP]
have "nat (int n - 1) = n - 1"
[PROOF STATE]
proof (prove)
using this:
2 \<le> n

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

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fls_integral (fls_X_inv ^ n) = fls_const (inverse (- of_nat (nat (int n - 1)))) * fls_X_inv ^ (n - 1)
nat (int n - 1) = n - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fls_integral (fls_X_inv ^ n) = fls_const (inverse (- of_nat (nat (int n - 1)))) * fls_X_inv ^ (n - 1)
nat (int n - 1) = n - 1

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
using inverse_minus_eq[of "of_nat (n-1) :: 'a"]
[PROOF STATE]
proof (prove)
using this:
fls_integral (fls_X_inv ^ n) = fls_const (inverse (- of_nat (nat (int n - 1)))) * fls_X_inv ^ (n - 1)
nat (int n - 1) = n - 1
inverse (- of_nat (n - 1)) = - inverse (of_nat (n - 1))

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

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - fls_const (inverse (of_nat (n - 1))) * fls_X_inv ^ (n - 1)
[PROOF STEP]
qed simp


[STATEMENT]
lemma aux_Cauchy:
  fixes x y :: "complex vec"
  assumes "x \<in> carrier_vec n" and "y \<in> carrier_vec n"
  shows "0 \<le> inner_prod x x + a * (inner_prod x y) + (cnj a) * ((cnj (inner_prod x y)) + a * (inner_prod y y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
have "(inner_prod (x+ a \<cdot>\<^sub>v y) (x+a \<cdot>\<^sub>v y)) = (inner_prod (x+a \<cdot>\<^sub>v y) x) + (inner_prod (x+a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (x + a \<cdot>\<^sub>v y) (x + a \<cdot>\<^sub>v y) = inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y)
[PROOF STEP]
apply (subst inner_prod_distrib_right)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. x + a \<cdot>\<^sub>v y \<in> carrier_vec ?n
 2. x \<in> carrier_vec ?n
 3. a \<cdot>\<^sub>v y \<in> carrier_vec ?n
 4. inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y) = inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n
y \<in> carrier_vec n

goal (4 subgoals):
 1. x + a \<cdot>\<^sub>v y \<in> carrier_vec ?n
 2. x \<in> carrier_vec ?n
 3. a \<cdot>\<^sub>v y \<in> carrier_vec ?n
 4. inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y) = inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (x + a \<cdot>\<^sub>v y) (x + a \<cdot>\<^sub>v y) = inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y)

goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod (x + a \<cdot>\<^sub>v y) (x + a \<cdot>\<^sub>v y) = inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y)

goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
have "\<dots> = inner_prod x x + (a) * (inner_prod x y) + cnj a * ((cnj (inner_prod x y)) + (a) * (inner_prod y y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y) = inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (subst (1 2) inner_prod_distrib_left[of _ n])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a \<cdot>\<^sub>v y \<in> carrier_vec n
 2. x \<in> carrier_vec n
 3. inner_prod x x + inner_prod (a \<cdot>\<^sub>v y) x + (inner_prod x (a \<cdot>\<^sub>v y) + inner_prod (a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y)) = inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (auto simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (a \<cdot>\<^sub>v y) x + (inner_prod x (a \<cdot>\<^sub>v y) + a * inner_prod (a \<cdot>\<^sub>v y) y) = a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (subst (1 2) inner_prod_smult_right[of _ n])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. y \<in> carrier_vec n
 2. x \<in> carrier_vec n
 3. conjugate a * inner_prod y x + (inner_prod x (a \<cdot>\<^sub>v y) + a * (conjugate a * inner_prod y y)) = a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (auto simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj a * inner_prod y x + (inner_prod x (a \<cdot>\<^sub>v y) + a * (cnj a * inner_prod y y)) = a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (subst inner_prod_smult_left[of _ n])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x \<in> carrier_vec n
 2. y \<in> carrier_vec n
 3. cnj a * inner_prod y x + (a * inner_prod x y + a * (cnj a * inner_prod y y)) = a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (auto simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj a * inner_prod y x + a * (cnj a * inner_prod y y) = cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (subst inner_prod_swap[of y n x])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. y \<in> carrier_vec n
 2. x \<in> carrier_vec n
 3. cnj a * conjugate (inner_prod x y) + a * (cnj a * inner_prod y y) = cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
apply (auto simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj a * cnj (inner_prod x y) + a * (cnj a * inner_prod y y) = cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
unfolding distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj a * cnj (inner_prod x y) + a * (cnj a * inner_prod y y) = cnj a * cnj (inner_prod x y) + cnj a * (a * inner_prod y y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (x + a \<cdot>\<^sub>v y) x + inner_prod (x + a \<cdot>\<^sub>v y) (a \<cdot>\<^sub>v y) = inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)

goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inner_prod (x + a \<cdot>\<^sub>v y) (x + a \<cdot>\<^sub>v y) = inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inner_prod (x + a \<cdot>\<^sub>v y) (x + a \<cdot>\<^sub>v y) = inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)

goal (1 subgoal):
 1. 0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)
[PROOF STEP]
by (metis self_cscalar_prod_geq_0)
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod x x + a * inner_prod x y + cnj a * (cnj (inner_prod x y) + a * inner_prod y y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_to_lpoly_from_lpoly_coeff_dual2:
  assumes "i < dim_vec (lpoly_to_vec (vec_to_lpoly v))"
  shows "(lpoly_to_vec (vec_to_lpoly v)) $ i = v $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lpoly_to_vec (vec_to_lpoly v) $ i = v $ i
[PROOF STEP]
by (metis assms dim_poly_dim_vec_equiv less_le_trans lin_poly_to_vec_coeff_access
      vec_to_lin_poly_coeff_access vec_to_poly_dim_less)


[STATEMENT]
lemma is_proper_prefix_eq_prefix: "is_proper_prefix a b = (a \<noteq> b \<and> is_prefix a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_proper_prefix a b = (a \<noteq> b \<and> is_prefix a b)
[PROOF STEP]
by (metis append_self_conv is_prefix_eq_proper_prefix is_proper_prefix_def)


[STATEMENT]
lemma zero_less_iff_1_le_hmset: "0 < n \<longleftrightarrow> 1 \<le> n" for n :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < n) = (1 \<le> n)
[PROOF STEP]
by (rule less_iff_add1_le_hmset[of 0, simplified])


[STATEMENT]
lemma Im_image_box:
  assumes "Re a < Re b" "Im a < Im b"
  shows   "Im ` box a b = {Im a<..<Im b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im ` box a b = {Im a<..<Im b}
[PROOF STEP]
using inner_image_box[of "\<i>::complex" a b] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<i> \<in> Basis; \<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i\<rbrakk> \<Longrightarrow> (\<lambda>x. x \<bullet> \<i>) ` box a b = {a \<bullet> \<i><..<b \<bullet> \<i>}
Re a < Re b
Im a < Im b

goal (1 subgoal):
 1. Im ` box a b = {Im a<..<Im b}
[PROOF STEP]
by (auto simp: Basis_complex_def)


[STATEMENT]
lemma Lp_Banach_lattice:
  assumes "f \<in> space\<^sub>N (\<LL> p M)"
  shows "(\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M)"
        "Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M) &&& Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M)
 2. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
have [measurable]: "f \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M
[PROOF STEP]
using Lp_measurable[OF assms]
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M

goal (1 subgoal):
 1. f \<in> borel_measurable M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M

goal (2 subgoals):
 1. (\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M)
 2. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
show "(\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M)
[PROOF STEP]
by (rule Lp_domination(1)[OF _ assms], auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M)

goal (1 subgoal):
 1. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
have "Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) \<le> Norm (\<LL> p M) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) \<le> Norm (\<LL> p M) f
[PROOF STEP]
by (rule Lp_domination[OF _ assms], auto)
[PROOF STATE]
proof (state)
this:
Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) \<le> Norm (\<LL> p M) f

goal (1 subgoal):
 1. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) \<le> Norm (\<LL> p M) f

goal (1 subgoal):
 1. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
have "Norm (\<LL> p M) f \<le> Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Norm (\<LL> p M) f \<le> Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>)
[PROOF STEP]
by (rule Lp_domination[OF _ \<open>(\<lambda>x. \<bar>f x\<bar>) \<in> space\<^sub>N (\<LL> p M)\<close>], auto)
[PROOF STATE]
proof (state)
this:
Norm (\<LL> p M) f \<le> Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>)

goal (1 subgoal):
 1. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
show "Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f"
[PROOF STATE]
proof (prove)
using this:
Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f

goal (1 subgoal):
 1. Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Norm (\<LL> p M) (\<lambda>x. \<bar>f x\<bar>) = Norm (\<LL> p M) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIMSEQ_powrat_inverse_of_nat_pos_less_one:
  assumes a0: "0 < a" and a1: "a < 1"
  shows "(\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat n))) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
have "inverse a > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < inverse a
[PROOF STEP]
using a0 a1
[PROOF STATE]
proof (prove)
using this:
0 < a
a < 1

goal (1 subgoal):
 1. 1 < inverse a
[PROOF STEP]
using one_less_inverse
[PROOF STATE]
proof (prove)
using this:
0 < a
a < 1
\<lbrakk>(0::?'a) < ?a; ?a < (1::?'a)\<rbrakk> \<Longrightarrow> (1::?'a) < inverse ?a

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

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < inverse a
[PROOF STEP]
have "(\<lambda>n. inverse a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
using this:
1 < inverse a

goal (1 subgoal):
 1. (\<lambda>n. inverse a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
using LIMSEQ_powrat_inverse_of_nat_ge_one
[PROOF STATE]
proof (prove)
using this:
1 < inverse a
1 \<le> ?a \<Longrightarrow> (\<lambda>n. ?a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>n. inverse a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. inverse a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. inverse a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
have "(\<lambda>n. inverse (a pow\<^sub>\<rat> inverse (rat_of_nat n))) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>n. inverse (a pow\<^sub>\<rat> inverse (rat_of_nat n))) \<longlonglongrightarrow> 1
[PROOF STEP]
using powrat_inverse
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
inverse ?y pow\<^sub>\<rat> ?r = inverse (?y pow\<^sub>\<rat> ?r)

goal (1 subgoal):
 1. (\<lambda>n. inverse (a pow\<^sub>\<rat> inverse (rat_of_nat n))) \<longlonglongrightarrow> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. inverse (a pow\<^sub>\<rat> inverse (rat_of_nat n))) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. inverse (a pow\<^sub>\<rat> inverse (rat_of_nat n))) \<longlonglongrightarrow> 1
[PROOF STEP]
have "(\<lambda>x. 1 / inverse (a pow\<^sub>\<rat> inverse (rat_of_nat x))) \<longlonglongrightarrow> 1/1"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse (a pow\<^sub>\<rat> inverse (rat_of_nat n))) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>x. 1 / inverse (a pow\<^sub>\<rat> inverse (rat_of_nat x))) \<longlonglongrightarrow> 1 / 1
[PROOF STEP]
by (auto intro: tendsto_divide simp only:)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. 1 / inverse (a pow\<^sub>\<rat> inverse (rat_of_nat x))) \<longlonglongrightarrow> 1 / 1

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. 1 / inverse (a pow\<^sub>\<rat> inverse (rat_of_nat x))) \<longlonglongrightarrow> 1 / 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. 1 / inverse (a pow\<^sub>\<rat> inverse (rat_of_nat x))) \<longlonglongrightarrow> 1 / 1

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
by (auto simp add: divide_inverse)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvd_prod:
fixes A::"'b set"
assumes "\<exists>b\<in>A. a dvd f b" "finite A"
shows "a dvd prod f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd prod f A
[PROOF STEP]
using assms(2,1)
[PROOF STATE]
proof (prove)
using this:
finite A
\<exists>b\<in>A. a dvd f b

goal (1 subgoal):
 1. a dvd prod f A
[PROOF STEP]
proof (induct A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>b\<in>{}. a dvd f b \<Longrightarrow> a dvd prod f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>b\<in>F. a dvd f b \<Longrightarrow> a dvd prod f F; \<exists>b\<in>insert x F. a dvd f b\<rbrakk> \<Longrightarrow> a dvd prod f (insert x F)
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
\<exists>b\<in>A. a dvd f b \<Longrightarrow> a dvd prod f A
\<exists>b\<in>insert x A. a dvd f b

goal (2 subgoals):
 1. \<exists>b\<in>{}. a dvd f b \<Longrightarrow> a dvd prod f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<exists>b\<in>F. a dvd f b \<Longrightarrow> a dvd prod f F; \<exists>b\<in>insert x F. a dvd f b\<rbrakk> \<Longrightarrow> a dvd prod f (insert x F)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
\<exists>b\<in>A. a dvd f b \<Longrightarrow> a dvd prod f A
\<exists>b\<in>insert x A. a dvd f b

goal (1 subgoal):
 1. a dvd prod f (insert x A)
[PROOF STEP]
using comm_monoid_mult_class.dvd_mult dvd_mult2 insert_iff prod.insert
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
\<exists>b\<in>A. a dvd f b \<Longrightarrow> a dvd prod f A
\<exists>b\<in>insert x A. a dvd f b
?a dvd ?c \<Longrightarrow> ?a dvd ?b * ?c
?a dvd ?b \<Longrightarrow> ?a dvd ?b * ?c
(?a \<in> insert ?b ?A) = (?a = ?b \<or> ?a \<in> ?A)
\<lbrakk>finite ?A; ?x \<notin> ?A\<rbrakk> \<Longrightarrow> prod ?g (insert ?x ?A) = ?g ?x * prod ?g ?A

goal (1 subgoal):
 1. a dvd prod f (insert x A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a dvd prod f (insert x A)

goal (1 subgoal):
 1. \<exists>b\<in>{}. a dvd f b \<Longrightarrow> a dvd prod f {}
[PROOF STEP]
qed auto


[STATEMENT]
lemma eNorm_cmult:
  "eNorm N (c *\<^sub>R x) = ennreal \<bar>c\<bar> * eNorm N x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm N (c *\<^sub>R x) = ennreal \<bar>c\<bar> * eNorm N x
[PROOF STEP]
unfolding eNorm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Rep_quasinorm N) (c *\<^sub>R x) = ennreal \<bar>c\<bar> * snd (Rep_quasinorm N) x
[PROOF STEP]
using Rep_quasinorm[of N]
[PROOF STATE]
proof (prove)
using this:
Rep_quasinorm N \<in> {(x, N). 1 \<le> ennreal x \<and> (\<forall>x c. N (c *\<^sub>R x) = ennreal \<bar>c\<bar> * N x) \<and> (\<forall>xa y. N (xa + y) \<le> ennreal x * N xa + ennreal x * N y)}

goal (1 subgoal):
 1. snd (Rep_quasinorm N) (c *\<^sub>R x) = ennreal \<bar>c\<bar> * snd (Rep_quasinorm N) x
[PROOF STEP]
by auto


[STATEMENT]
lemma indicator_abs_le_1: "\<bar>indicator S x\<bar> \<le> (1::'a::linordered_idom)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>indicator S x\<bar> \<le> (1::'a)
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>of_bool (x \<in> S)\<bar> \<le> (1::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma Max_neq_imp_less[dest]: "\<lbrakk> finite I; k \<in> I; k \<noteq> Max I \<rbrakk> \<Longrightarrow> k < Max I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; k \<in> I; k \<noteq> Max I\<rbrakk> \<Longrightarrow> k < Max I
[PROOF STEP]
by (rule order_neq_le_trans[OF _ Max_ge])


[STATEMENT]
lemma agg_sum_distrib:
  fixes f g :: "'a \<Rightarrow> 'b::aggregation_order"
  shows "(\<Sum>\<^sub>k f k + g k) = (\<Sum>\<^sub>k f k) + (\<Sum>\<^sub>k g k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aggregation.sum_0 (\<lambda>k. f k + g k) {k. True} = aggregation.sum_0 f {k. True} + aggregation.sum_0 g {k. True}
[PROOF STEP]
by (rule aggregation.sum_0.distrib)


[STATEMENT]
lemma set_iterator_product_foldli_conv:
  "set_iterator_product (foldli as) (\<lambda>a. foldli (bs a)) =
   foldli (concat (map (\<lambda>a. map (\<lambda>b. (a, b)) (bs a)) as))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_product (foldli as) (\<lambda>a. foldli (bs a)) = foldli (concat (map (\<lambda>a. map (Pair a) (bs a)) as))
[PROOF STEP]
apply (induct as)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set_iterator_product (foldli []) (\<lambda>a. foldli (bs a)) = foldli (concat (map (\<lambda>a. map (Pair a) (bs a)) []))
 2. \<And>a as. set_iterator_product (foldli as) (\<lambda>a. foldli (bs a)) = foldli (concat (map (\<lambda>a. map (Pair a) (bs a)) as)) \<Longrightarrow> set_iterator_product (foldli (a # as)) (\<lambda>a. foldli (bs a)) = foldli (concat (map (\<lambda>a. map (Pair a) (bs a)) (a # as)))
[PROOF STEP]
apply (simp add: set_iterator_product_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. set_iterator_product (foldli as) (\<lambda>a. foldli (bs a)) = foldli (concat (map (\<lambda>a. map (Pair a) (bs a)) as)) \<Longrightarrow> set_iterator_product (foldli (a # as)) (\<lambda>a. foldli (bs a)) = foldli (concat (map (\<lambda>a. map (Pair a) (bs a)) (a # as)))
[PROOF STEP]
apply (simp add: set_iterator_product_def foldli_append foldli_map o_def fun_eq_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_sum_nat_ivl_bounded2:
  fixes K :: "'a::linordered_semidom"
  assumes f: "\<And>p::nat. p < n \<Longrightarrow> f p \<le> K" and K: "0 \<le> K"
  shows "sum f {..<n-k} \<le> of_nat n * K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<n - k} \<le> of_nat n * K
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {..<n - k} \<le> of_nat n * K
[PROOF STEP]
have "sum f {..<n-k} \<le> (\<Sum>i<n - k. K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<n - k} \<le> (\<Sum>i<n - k. K)
[PROOF STEP]
by (rule sum_mono [OF f]) auto
[PROOF STATE]
proof (state)
this:
sum f {..<n - k} \<le> (\<Sum>i<n - k. K)

goal (1 subgoal):
 1. sum f {..<n - k} \<le> of_nat n * K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {..<n - k} \<le> (\<Sum>i<n - k. K)

goal (1 subgoal):
 1. sum f {..<n - k} \<le> of_nat n * K
[PROOF STEP]
have "... \<le> of_nat n * K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n - k. K) \<le> of_nat n * K
[PROOF STEP]
by (auto simp: mult_right_mono K)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n - k. K) \<le> of_nat n * K

goal (1 subgoal):
 1. sum f {..<n - k} \<le> of_nat n * K
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f {..<n - k} \<le> of_nat n * K
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f {..<n - k} \<le> of_nat n * K

goal (1 subgoal):
 1. sum f {..<n - k} \<le> of_nat n * K
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f {..<n - k} \<le> of_nat n * K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group_hom) img_is_subgroup: "subgroup (h ` (carrier G)) H" \<^marker>\<open>contributor \<open>Paulo Em?lio de Vilhena\<close>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (h ` carrier G) H
[PROOF STEP]
apply (rule subgroupI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. h ` carrier G \<subseteq> carrier H
 2. h ` carrier G \<noteq> {}
 3. \<And>a. a \<in> h ` carrier G \<Longrightarrow> inv\<^bsub>H\<^esub> a \<in> h ` carrier G
 4. \<And>a b. \<lbrakk>a \<in> h ` carrier G; b \<in> h ` carrier G\<rbrakk> \<Longrightarrow> a \<otimes>\<^bsub>H\<^esub> b \<in> h ` carrier G
[PROOF STEP]
apply (auto simp add: image_subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> inv\<^bsub>H\<^esub> h x \<in> h ` carrier G
 2. \<And>x xa. \<lbrakk>x \<in> carrier G; xa \<in> carrier G\<rbrakk> \<Longrightarrow> h x \<otimes>\<^bsub>H\<^esub> h xa \<in> h ` carrier G
[PROOF STEP]
apply (metis G.inv_closed hom_inv image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> carrier G; xa \<in> carrier G\<rbrakk> \<Longrightarrow> h x \<otimes>\<^bsub>H\<^esub> h xa \<in> h ` carrier G
[PROOF STEP]
by (metis G.monoid_axioms hom_mult image_eqI monoid.m_closed)


[STATEMENT]
lemma closedin_closed_eq: "closed S \<Longrightarrow> closedin (top_of_set S) T \<longleftrightarrow> closed T \<and> T \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S \<Longrightarrow> closedin (top_of_set S) T = (closed T \<and> T \<subseteq> S)
[PROOF STEP]
by (meson closedin_limpt closed_subset closedin_closed_trans)


[STATEMENT]
lemma set_delete_index_distinct:
  assumes "distinct xs" "n < length xs"
  shows   "set (delete_index n xs) = set xs - {xs ! n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (delete_index n xs) = set xs - {xs ! n}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs
n < length xs

goal (1 subgoal):
 1. set (delete_index n xs) = set xs - {xs ! n}
[PROOF STEP]
by (induction n xs rule: delete_index.induct) fastforce+


[STATEMENT]
lemma path_connected_component_set: "path_connected S \<longleftrightarrow> (\<forall>x\<in>S. path_component_set S x = S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected S = (\<forall>x\<in>S. path_component_set S x = S)
[PROOF STEP]
unfolding path_connected_component path_component_subset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>S. Ball S (path_component S x)) = (\<forall>x\<in>S. path_component_set S x = S)
[PROOF STEP]
using path_component_mem
[PROOF STATE]
proof (prove)
using this:
path_component ?S ?x ?y \<Longrightarrow> ?x \<in> ?S
path_component ?S ?x ?y \<Longrightarrow> ?y \<in> ?S

goal (1 subgoal):
 1. (\<forall>x\<in>S. Ball S (path_component S x)) = (\<forall>x\<in>S. path_component_set S x = S)
[PROOF STEP]
by blast


[STATEMENT]
lemma factorization_algorithm_16_22:
  assumes res: "factorization_algorithm_16_22 f = G"
  and sff: "square_free f"
  and deg: "degree f > 0"
  shows "(\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
let ?lc = "lead_coeff f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
define p where "p \<equiv> suitable_prime_bz f"
[PROOF STATE]
proof (state)
this:
p \<equiv> suitable_prime_bz f

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
obtain c gs where fff: "finite_field_factorization_int p f = (c,gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c gs. finite_field_factorization_int p f = (c, gs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
finite_field_factorization_int p f = (c, gs)

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
let ?degs = "map degree gs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
note res = res[unfolded factorization_algorithm_16_22_def Let_def, folded p_def,
    unfolded fff split, folded]
[PROOF STATE]
proof (state)
this:
reconstruction_of_algorithm_16_22 p (find_exponent p (sqrt_int_ceiling (2 ^ (5 * degree f * degree f) * \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)))) (hensel_lifting p (find_exponent p (sqrt_int_ceiling (2 ^ (5 * degree f * degree f) * \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)))) f gs) f = G

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
from suitable_prime_bz[OF sff refl]
[PROOF STATE]
proof (chain)
picking this:
prime (suitable_prime_bz f)
comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f)
poly_mod.square_free_m (suitable_prime_bz f) f
[PROOF STEP]
have prime: "prime p" and cop: "coprime ?lc p" and sf: "poly_mod.square_free_m p f"
[PROOF STATE]
proof (prove)
using this:
prime (suitable_prime_bz f)
comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f)
poly_mod.square_free_m (suitable_prime_bz f) f

goal (1 subgoal):
 1. prime p &&& comm_monoid_mult_class.coprime (lead_coeff f) p &&& poly_mod.square_free_m p f
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
prime (suitable_prime_bz f)
comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f)
poly_mod.square_free_m (suitable_prime_bz f) f

goal (1 subgoal):
 1. prime (suitable_prime_bz f) &&& comm_monoid_mult_class.coprime (lead_coeff f) (suitable_prime_bz f) &&& poly_mod.square_free_m (suitable_prime_bz f) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime p
comm_monoid_mult_class.coprime (lead_coeff f) p
poly_mod.square_free_m p f

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
note res
[PROOF STATE]
proof (state)
this:
reconstruction_of_algorithm_16_22 p (find_exponent p (sqrt_int_ceiling (2 ^ (5 * degree f * degree f) * \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)))) (hensel_lifting p (find_exponent p (sqrt_int_ceiling (2 ^ (5 * degree f * degree f) * \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)))) f gs) f = G

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
from prime
[PROOF STATE]
proof (chain)
picking this:
prime p
[PROOF STEP]
interpret poly_mod_prime p
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. poly_mod_prime p
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
define K where "K = 2 ^ (5 * degree f * degree f) *
            \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)"
[PROOF STATE]
proof (state)
this:
K = 2 ^ (5 * degree f * degree f) * \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
define N where "N = sqrt_int_ceiling K"
[PROOF STATE]
proof (state)
this:
N = sqrt_int_ceiling K

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
have K0: "K \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> K
[PROOF STEP]
unfolding K_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 2 ^ (5 * degree f * degree f) * \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> K

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
have N0: "N \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> N
[PROOF STEP]
unfolding N_def sqrt_int_ceiling
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<lceil>sqrt (real_of_int K)\<rceil>
[PROOF STEP]
using K0
[PROOF STATE]
proof (prove)
using this:
0 \<le> K

goal (1 subgoal):
 1. 0 \<le> \<lceil>sqrt (real_of_int K)\<rceil>
[PROOF STEP]
by (smt of_int_nonneg real_sqrt_ge_0_iff zero_le_ceiling)
[PROOF STATE]
proof (state)
this:
0 \<le> N

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
define n where "n = find_exponent p N"
[PROOF STATE]
proof (state)
this:
n = find_exponent p N

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
note res = res[folded n_def[unfolded N_def K_def]]
[PROOF STATE]
proof (state)
this:
reconstruction_of_algorithm_16_22 p n (hensel_lifting p n f gs) f = G

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
note n = find_exponent[OF m1, of N, folded n_def]
[PROOF STATE]
proof (state)
this:
N < p ^ n
n \<noteq> 0

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
note bh = berlekamp_and_hensel_separated[OF cop sf refl fff n(2)]
[PROOF STATE]
proof (state)
this:
berlekamp_hensel p n f = hensel_lifting p n f gs
sort (map degree gs) = sort (map degree (hensel_lifting p n f gs))

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
note res = res[folded bh(1)]
[PROOF STATE]
proof (state)
this:
reconstruction_of_algorithm_16_22 p n (berlekamp_hensel p n f) f = G

goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G
[PROOF STEP]
proof (rule reconstruction_of_algorithm_16_22[OF prime deg _ refl cop sf sff res])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> (p ^ n)\<^sup>2
[PROOF STEP]
from n(1)
[PROOF STATE]
proof (chain)
picking this:
N < p ^ n
[PROOF STEP]
have "N \<le> p ^ n"
[PROOF STATE]
proof (prove)
using this:
N < p ^ n

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

goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> (p ^ n)\<^sup>2
[PROOF STEP]
hence *: "N^2 \<le> (p^n)^2"
[PROOF STATE]
proof (prove)
using this:
N \<le> p ^ n

goal (1 subgoal):
 1. N\<^sup>2 \<le> (p ^ n)\<^sup>2
[PROOF STEP]
by (intro power_mono N0, auto)
[PROOF STATE]
proof (state)
this:
N\<^sup>2 \<le> (p ^ n)\<^sup>2

goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> (p ^ n)\<^sup>2
[PROOF STEP]
show "2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> (p ^ n)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> (p ^ n)\<^sup>2
[PROOF STEP]
proof (rule order.trans[OF _ *])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2
[PROOF STEP]
have "2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) = K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) = K
[PROOF STEP]
unfolding K_def B2_LLL_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * (2 ^ (2 * degree f) * \<parallel>f\<parallel>\<^sup>2) ^ (2 * degree f) = 2 ^ (5 * degree f * degree f) * \<parallel>f\<parallel>\<^sup>2 ^ (2 * degree f)
[PROOF STEP]
by (simp add: ac_simps
          power_mult_distrib power2_eq_square power_mult[symmetric] power_add[symmetric])
[PROOF STATE]
proof (state)
this:
2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) = K

goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) = K

goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2
[PROOF STEP]
have "\<dots> \<le> N\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<le> N\<^sup>2
[PROOF STEP]
unfolding N_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<le> (sqrt_int_ceiling K)\<^sup>2
[PROOF STEP]
by (rule sqrt_int_ceiling_bound[OF K0])
[PROOF STATE]
proof (state)
this:
K \<le> N\<^sup>2

goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2
[PROOF STEP]
show "2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2

goal (1 subgoal):
 1. 2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> N\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (degree f)\<^sup>2 * B2_LLL f ^ (2 * degree f) \<le> (p ^ n)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>g\<in>set G. irreducible\<^sub>d g) \<and> f = prod_list G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_compl_induct[case_names 0 Suc]: "\<lbrakk>P 0; !! n . ALL nn . nn <= n \<longrightarrow> P nn \<Longrightarrow> P (Suc n)\<rbrakk> \<Longrightarrow> P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n)\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply(induct_tac n rule: nat_less_induct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n); \<forall>m<n. P m\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply(case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n); \<forall>m<n. P m; n = 0\<rbrakk> \<Longrightarrow> P n
 2. \<And>n nat. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n); \<forall>m<n. P m; n = Suc nat\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Cons_in_nlists_iff: "x # xs \<in> nlists A n \<longleftrightarrow> (\<exists>n'. n = Suc n' \<and> x \<in> A \<and> xs \<in> nlists A n')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs \<in> nlists A n) = (\<exists>n'. n = Suc n' \<and> x \<in> A \<and> xs \<in> nlists A n')
[PROOF STEP]
by(cases n) simp_all


[STATEMENT]
lemma nn_integral_bij_count_space:
  assumes g: "bij_betw g A B"
  shows "(\<integral>\<^sup>+x. f (g x) \<partial>count_space A) = (\<integral>\<^sup>+x. f x \<partial>count_space B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f (g x) \<partial>count_space A = integral\<^sup>N (count_space B) f
[PROOF STEP]
using g[THEN bij_betw_imp_funcset]
[PROOF STATE]
proof (prove)
using this:
g \<in> A \<rightarrow> B

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f (g x) \<partial>count_space A = integral\<^sup>N (count_space B) f
[PROOF STEP]
by (subst distr_bij_count_space[OF g, symmetric])
     (auto intro!: nn_integral_distr[symmetric])


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


[STATEMENT]
lemma prime_power_eq_one_iff [simp]: "prime p \<Longrightarrow> p ^ n = 1 \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> (p ^ n = (1::'a)) = (n = 0)
[PROOF STEP]
using prime_power_inj[of p n 0]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime p; p ^ n = p ^ 0\<rbrakk> \<Longrightarrow> n = 0

goal (1 subgoal):
 1. prime p \<Longrightarrow> (p ^ n = (1::'a)) = (n = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma binomial_fact:
  assumes kn: "k \<le> n"
  shows "(of_nat (n choose k) :: 'a::field_char_0) = fact n / (fact k * fact (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (n choose k) = fact n / (fact k * fact (n - k))
[PROOF STEP]
using binomial_fact_lemma[OF kn]
[PROOF STATE]
proof (prove)
using this:
fact k * fact (n - k) * (n choose k) = fact n

goal (1 subgoal):
 1. of_nat (n choose k) = fact n / (fact k * fact (n - k))
[PROOF STEP]
by (metis (mono_tags, lifting) fact_nonzero mult_eq_0_iff nonzero_mult_div_cancel_left of_nat_fact of_nat_mult)


[STATEMENT]
lemma sgn_scaleC: "sgn (scaleC r x) = scaleC (sgn r) (sgn x)"
  for x :: "'a::complex_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (r *\<^sub>C x) = sgn r *\<^sub>C sgn x
[PROOF STEP]
by (simp add: scaleR_scaleC sgn_div_norm ac_simps)


[STATEMENT]
lemma integral_restrict_UNIV:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "S \<in> sets lebesgue"
  shows "integral\<^sup>L lebesgue (\<lambda>x. if x \<in> S then f x else 0) = integral\<^sup>L (lebesgue_on S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue. (if x \<in> S then f x else (0::'b)) = integral\<^sup>L (lebesgue_on S) f
[PROOF STEP]
using integral_restrict_Int [of S UNIV f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>S \<in> sets lebesgue; UNIV \<in> sets lebesgue\<rbrakk> \<Longrightarrow> LINT x|lebesgue_on UNIV. (if x \<in> S then f x else (0::'b)) = integral\<^sup>L (lebesgue_on (S \<inter> UNIV)) f
S \<in> sets lebesgue

goal (1 subgoal):
 1. LINT x|lebesgue. (if x \<in> S then f x else (0::'b)) = integral\<^sup>L (lebesgue_on S) f
[PROOF STEP]
by (simp add: lebesgue_on_UNIV_eq)


[STATEMENT]
lemma eq_mod_iff: "0 < n \<Longrightarrow> b = b mod n \<longleftrightarrow> 0 \<le> b \<and> b < n"
  for b n :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (b = b mod n) = (0 \<le> b \<and> b < n)
[PROOF STEP]
using pos_mod_sign [of n b] pos_mod_bound [of n b]
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> 0 \<le> b mod n
0 < n \<Longrightarrow> b mod n < n

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (b = b mod n) = (0 \<le> b \<and> b < n)
[PROOF STEP]
by (safe, auto)


[STATEMENT]
lemma Max_less_iMin_conv_less: "
  \<lbrakk> finite A; A \<noteq> {}; B \<noteq> {} \<rbrakk> \<Longrightarrow> (Max A < iMin B) = (\<forall>a\<in>A. \<forall>b\<in>B. a < b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}; B \<noteq> {}\<rbrakk> \<Longrightarrow> (Max A < iMin B) = (\<forall>a\<in>A. \<forall>b\<in>B. a < b)
[PROOF STEP]
by (blast intro: Max_less_iMin_imp_less less_imp_Max_less_iMin)


[STATEMENT]
lemma set_replicate_Suc: "set (replicate (Suc n) x) = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (replicate (Suc n) x) = {x}
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma generaliseAll:
 assumes i: "PROP Pure.prop (\<And>s. PROP Pure.prop (Trueprop (P s)) \<Longrightarrow> PROP Pure.prop (Trueprop (Q s)))"
 shows "PROP Pure.prop (PROP Pure.prop (Trueprop (\<forall>s. P s)) \<Longrightarrow> PROP Pure.prop (Trueprop (\<forall>s. Q s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s. P s) \<Longrightarrow> (\<forall>s. Q s)
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
\<And>s. (P s) \<Longrightarrow> (Q s)

goal (1 subgoal):
 1. (\<forall>s. P s) \<Longrightarrow> (\<forall>s. Q s)
[PROOF STEP]
by (auto simp add: prop_def)


[STATEMENT]
lemma closure_scaleR:
  fixes S :: "'a::real_normed_vector set"
  shows "((*\<^sub>R) c) ` (closure S) = closure (((*\<^sub>R) c) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) c ` closure S = closure ((*\<^sub>R) c ` S)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (*\<^sub>R) c ` closure S \<subseteq> closure ((*\<^sub>R) c ` S)
 2. closure ((*\<^sub>R) c ` S) \<subseteq> (*\<^sub>R) c ` closure S
[PROOF STEP]
show "((*\<^sub>R) c) ` (closure S) \<subseteq> closure (((*\<^sub>R) c) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) c ` closure S \<subseteq> closure ((*\<^sub>R) c ` S)
[PROOF STEP]
using bounded_linear_scaleR_right
[PROOF STATE]
proof (prove)
using this:
bounded_linear ((*\<^sub>R) ?r)

goal (1 subgoal):
 1. (*\<^sub>R) c ` closure S \<subseteq> closure ((*\<^sub>R) c ` S)
[PROOF STEP]
by (rule closure_bounded_linear_image_subset)
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) c ` closure S \<subseteq> closure ((*\<^sub>R) c ` S)

goal (1 subgoal):
 1. closure ((*\<^sub>R) c ` S) \<subseteq> (*\<^sub>R) c ` closure S
[PROOF STEP]
show "closure (((*\<^sub>R) c) ` S) \<subseteq> ((*\<^sub>R) c) ` (closure S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure ((*\<^sub>R) c ` S) \<subseteq> (*\<^sub>R) c ` closure S
[PROOF STEP]
by (intro closure_minimal image_mono closure_subset closed_scaling closed_closure)
[PROOF STATE]
proof (state)
this:
closure ((*\<^sub>R) c ` S) \<subseteq> (*\<^sub>R) c ` closure S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem card_reachable_ab: "card (reachable_b as r) \<le> card (reachable_a as r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (reachable_b as r) \<le> card (reachable_a as r)
[PROOF STEP]
unfolding reachable_ab
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (hom_ab ` reachable_a as r) \<le> card (reachable_a as r)
[PROOF STEP]
using after.finite_reachable
[PROOF STATE]
proof (prove)
using this:
finite (reachable_a ?as ?r)

goal (1 subgoal):
 1. card (hom_ab ` reachable_a as r) \<le> card (reachable_a as r)
[PROOF STEP]
by (rule card_image_le)