[STATEMENT]
lemma final_lemma1:
     "(\<Inter>v \<in> V. \<Inter>w \<in> V. {s. ((s \<in> reachable v) = ((root,v) \<in> REACHABLE)) &
                              s \<in> nmsg_eq 0 (v,w)})
      \<subseteq> final"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>v\<in>V. \<Inter>w\<in>V. {s. (s \<in> Reachability.reachable v) = ((root, v) \<in> REACHABLE) \<and> s \<in> nmsg_eq 0 (v, w)}) \<subseteq> final
[PROOF STEP]
apply (unfold final_def Equality_def, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a b. \<lbrakk>\<forall>xa\<in>V. \<forall>xb\<in>V. (x \<in> Reachability.reachable xa) = ((root, xa) \<in> REACHABLE) \<and> x \<in> nmsg_eq 0 (xa, xb); (a, b) \<in> E\<rbrakk> \<Longrightarrow> x \<in> nmsg_eq 0 (a, b)
[PROOF STEP]
apply (frule E_imp_in_V_R)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a b. \<lbrakk>\<forall>xa\<in>V. \<forall>xb\<in>V. (x \<in> Reachability.reachable xa) = ((root, xa) \<in> REACHABLE) \<and> x \<in> nmsg_eq 0 (xa, xb); (a, b) \<in> E; b \<in> V\<rbrakk> \<Longrightarrow> x \<in> nmsg_eq 0 (a, b)
[PROOF STEP]
apply (frule E_imp_in_V_L, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma enat_Suc0[simp]: "enat (Suc 0) = eSuc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat (Suc 0) = eSuc 0
[PROOF STEP]
by (metis One_nat_def one_eSuc one_enat_def)


[STATEMENT]
lemma cos_integer_2pi: "n \<in> \<int> \<Longrightarrow> cos(2 * pi * n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> \<int> \<Longrightarrow> cos (2 * pi * n) = 1
[PROOF STEP]
by (metis Ints_cases cos_one_2pi_int mult.assoc mult.commute)


[STATEMENT]
lemma floor_less_iff: "\<lfloor>x\<rfloor> < z \<longleftrightarrow> x < of_int z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < z) = (x < of_int z)
[PROOF STEP]
by (simp add: not_le [symmetric] le_floor_iff)


[STATEMENT]
lemma fin_independent_sets: "finite (independent_sets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite independent_sets
[PROOF STEP]
unfolding independent_sets_def is_independent_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {vs. vs \<subseteq> V \<and> all_edges vs \<inter> E = {}}
[PROOF STEP]
using finV
[PROOF STATE]
proof (prove)
using this:
finite V

goal (1 subgoal):
 1. finite {vs. vs \<subseteq> V \<and> all_edges vs \<inter> E = {}}
[PROOF STEP]
by auto


[STATEMENT]
theorem straighten_topdown_inv:"straighten_topdown w1 w2 \<Longrightarrow> (kauff_mat w1) = (kauff_mat w2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. straighten_topdown w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
unfolding straighten_topdown_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w1 = basic [vert, cup] \<circ> basic [cap, vert] \<and> w2 = basic [vert] \<circ> basic [vert] \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
using striaghten_topdown_computation
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic [vert, cup] \<circ> basic [cap, vert]) = kauff_mat (basic [vert] \<circ> basic [vert])

goal (1 subgoal):
 1. w1 = basic [vert, cup] \<circ> basic [cap, vert] \<and> w2 = basic [vert] \<circ> basic [vert] \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
by auto


[STATEMENT]
lemma simple_integral_indicator:
  assumes A: "A \<in> sets M"
  assumes f: "simple_function M f"
  shows "(\<integral>\<^sup>Sx. f x * indicator A x \<partial>M) =
    (\<Sum>x \<in> f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
have eq: "(\<lambda>x. (f x, indicator A x)) ` space M \<inter> {x. snd x = 1} = (\<lambda>x. (f x, 1::ennreal))`A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x, indicator A x)) ` space M \<inter> {x. snd x = 1} = (\<lambda>x. (f x, 1)) ` A
[PROOF STEP]
using A[THEN sets.sets_into_space]
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> space M

goal (1 subgoal):
 1. (\<lambda>x. (f x, indicator A x)) ` space M \<inter> {x. snd x = 1} = (\<lambda>x. (f x, 1)) ` A
[PROOF STEP]
by (auto simp: indicator_def image_iff split: if_split_asm)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x, indicator A x)) ` space M \<inter> {x. snd x = 1} = (\<lambda>x. (f x, 1)) ` A

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
have eq2: "\<And>x. f x \<notin> f ` A \<Longrightarrow> f -` {f x} \<inter> space M \<inter> A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f x \<notin> f ` A \<Longrightarrow> f -` {f x} \<inter> space M \<inter> A = {}
[PROOF STEP]
by (auto simp: image_iff)
[PROOF STATE]
proof (state)
this:
f ?x \<notin> f ` A \<Longrightarrow> f -` {f ?x} \<inter> space M \<inter> A = {}

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
have "(\<integral>\<^sup>Sx. f x * indicator A x \<partial>M) =
    (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x))`space M. (fst y * snd y) * emeasure M {x\<in>space M. (f x, indicator A x) = y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. fst y * snd y * emeasure M {x \<in> space M. (f x, indicator A x) = y})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> sets M
simple_function M f

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. fst y * snd y * emeasure M {x \<in> space M. (f x, indicator A x) = y})
[PROOF STEP]
by (intro simple_function_partition) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. fst y * snd y * emeasure M {x \<in> space M. (f x, indicator A x) = y})

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. fst y * snd y * emeasure M {x \<in> space M. (f x, indicator A x) = y})

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
have "\<dots> = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x::ennreal))`space M.
    if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. fst y * snd y * emeasure M {x \<in> space M. (f x, indicator A x) = y}) = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0)
[PROOF STEP]
by (auto simp: indicator_def split: if_split_asm intro!: arg_cong2[where f="(*)"] arg_cong2[where f=emeasure] sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. fst y * snd y * emeasure M {x \<in> space M. (f x, indicator A x) = y}) = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0)

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. fst y * snd y * emeasure M {x \<in> space M. (f x, indicator A x) = y}) = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0)

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
have "\<dots> = (\<Sum>y\<in>(\<lambda>x. (f x, 1::ennreal))`A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0) = (\<Sum>y\<in>(\<lambda>x. (f x, 1)) ` A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> sets M
simple_function M f

goal (1 subgoal):
 1. (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0) = (\<Sum>y\<in>(\<lambda>x. (f x, 1)) ` A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A))
[PROOF STEP]
by (subst sum.If_cases) (auto intro!: simple_functionD(1) simp: eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0) = (\<Sum>y\<in>(\<lambda>x. (f x, 1)) ` A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A))

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>(\<lambda>x. (f x, indicator A x)) ` space M. if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0) = (\<Sum>y\<in>(\<lambda>x. (f x, 1)) ` A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A))

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
have "\<dots> = (\<Sum>y\<in>fst`(\<lambda>x. (f x, 1::ennreal))`A. y * emeasure M (f -` {y} \<inter> space M \<inter> A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>(\<lambda>x. (f x, 1)) ` A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A)) = (\<Sum>y\<in>fst ` (\<lambda>x. (f x, 1)) ` A. y * emeasure M (f -` {y} \<inter> space M \<inter> A))
[PROOF STEP]
by (subst sum.reindex [of fst]) (auto simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>(\<lambda>x. (f x, 1)) ` A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A)) = (\<Sum>y\<in>fst ` (\<lambda>x. (f x, 1)) ` A. y * emeasure M (f -` {y} \<inter> space M \<inter> A))

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>(\<lambda>x. (f x, 1)) ` A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A)) = (\<Sum>y\<in>fst ` (\<lambda>x. (f x, 1)) ` A. y * emeasure M (f -` {y} \<inter> space M \<inter> A))

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
have "\<dots> = (\<Sum>x \<in> f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>fst ` (\<lambda>x. (f x, 1)) ` A. y * emeasure M (f -` {y} \<inter> space M \<inter> A)) = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
using A[THEN sets.sets_into_space]
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> space M

goal (1 subgoal):
 1. (\<Sum>y\<in>fst ` (\<lambda>x. (f x, 1)) ` A. y * emeasure M (f -` {y} \<inter> space M \<inter> A)) = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
by (intro sum.mono_neutral_cong_left simple_functionD f) (auto simp: image_comp comp_def eq2)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>fst ` (\<lambda>x. (f x, 1)) ` A. y * emeasure M (f -` {y} \<inter> space M \<inter> A)) = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))

goal (1 subgoal):
 1. \<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>S x. f x * indicator A x \<partial>M = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolutely_integrable_scaleR_left:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
    assumes "f absolutely_integrable_on S"
  shows "(\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S
[PROOF STEP]
have "(\<lambda>x. c *\<^sub>R x) o f absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) c \<circ> f absolutely_integrable_on S
[PROOF STEP]
by (simp add: absolutely_integrable_linear assms bounded_linear_scaleR_right)
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) c \<circ> f absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(*\<^sub>R) c \<circ> f absolutely_integrable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(*\<^sub>R) c \<circ> f absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(*\<^sub>R) c \<circ> f absolutely_integrable_on S
f absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma design_iso_block_intersect_num_eq:
  assumes "b1 \<in># \<B>"
  assumes "b2 \<in># \<B>"
  shows "b1 |\<inter>| b2 = (\<pi> ` b1) |\<inter>| (\<pi> ` b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b1 |\<inter>| b2 = \<pi> ` b1 |\<inter>| \<pi> ` b2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b1 |\<inter>| b2 = \<pi> ` b1 |\<inter>| \<pi> ` b2
[PROOF STEP]
have split: "\<pi> ` (b1 \<inter> b2) = (\<pi> ` b1) \<inter> (\<pi> ` b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> ` (b1 \<inter> b2) = \<pi> ` b1 \<inter> \<pi> ` b2
[PROOF STEP]
using assms bij bij_betw_inter_subsets
[PROOF STATE]
proof (prove)
using this:
b1 \<in># \<B>
b2 \<in># \<B>
bij_betw \<pi> \<V> \<V>'
\<lbrakk>bij_betw ?f ?A ?B; ?a1.0 \<subseteq> ?A; ?a2.0 \<subseteq> ?A\<rbrakk> \<Longrightarrow> ?f ` (?a1.0 \<inter> ?a2.0) = ?f ` ?a1.0 \<inter> ?f ` ?a2.0

goal (1 subgoal):
 1. \<pi> ` (b1 \<inter> b2) = \<pi> ` b1 \<inter> \<pi> ` b2
[PROOF STEP]
by (metis source.wellformed)
[PROOF STATE]
proof (state)
this:
\<pi> ` (b1 \<inter> b2) = \<pi> ` b1 \<inter> \<pi> ` b2

goal (1 subgoal):
 1. b1 |\<inter>| b2 = \<pi> ` b1 |\<inter>| \<pi> ` b2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> ` (b1 \<inter> b2) = \<pi> ` b1 \<inter> \<pi> ` b2

goal (1 subgoal):
 1. b1 |\<inter>| b2 = \<pi> ` b1 |\<inter>| \<pi> ` b2
[PROOF STEP]
using source.wellformed
[PROOF STATE]
proof (prove)
using this:
\<pi> ` (b1 \<inter> b2) = \<pi> ` b1 \<inter> \<pi> ` b2
?b \<in># \<B> \<Longrightarrow> ?b \<subseteq> \<V>

goal (1 subgoal):
 1. b1 |\<inter>| b2 = \<pi> ` b1 |\<inter>| \<pi> ` b2
[PROOF STEP]
by (simp add: intersection_number_def iso_points_ss_card split assms(2) inf.coboundedI2)
[PROOF STATE]
proof (state)
this:
b1 |\<inter>| b2 = \<pi> ` b1 |\<inter>| \<pi> ` b2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compactin_imp_closedin:
  assumes X: "Hausdorff_space X" and S: "compactin X S" shows "closedin X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin X S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin X S
[PROOF STEP]
have "S \<subseteq> topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> topspace X
[PROOF STEP]
by (simp add: assms compactin_subset_topspace)
[PROOF STATE]
proof (state)
this:
S \<subseteq> topspace X

goal (1 subgoal):
 1. closedin X S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S \<subseteq> topspace X

goal (1 subgoal):
 1. closedin X S
[PROOF STEP]
have "\<exists>T. openin X T \<and> x \<in> T \<and> T \<subseteq> topspace X - S" if "x \<in> topspace X" "x \<notin> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>T. openin X T \<and> x \<in> T \<and> T \<subseteq> topspace X - S
[PROOF STEP]
using Hausdorff_space_compact_separation [OF X _ S, of "{x}"] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compactin X {x}; disjnt {x} S; \<And>U V. \<lbrakk>openin X U; openin X V; {x} \<subseteq> U; S \<subseteq> V; disjnt U V\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
x \<in> topspace X
x \<notin> S

goal (1 subgoal):
 1. \<exists>T. openin X T \<and> x \<in> T \<and> T \<subseteq> topspace X - S
[PROOF STEP]
apply (simp add: disjnt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>thesis. (\<And>U V. \<lbrakk>openin X U; openin X V; x \<in> U; S \<subseteq> V; U \<inter> V = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; x \<in> topspace X; x \<notin> S\<rbrakk> \<Longrightarrow> \<exists>T. openin X T \<and> x \<in> T \<and> T \<subseteq> topspace X - S
[PROOF STEP]
by (metis Diff_mono Diff_triv openin_subset)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> topspace X; ?x \<notin> S\<rbrakk> \<Longrightarrow> \<exists>T. openin X T \<and> ?x \<in> T \<and> T \<subseteq> topspace X - S

goal (1 subgoal):
 1. closedin X S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> topspace X
\<lbrakk>?x \<in> topspace X; ?x \<notin> S\<rbrakk> \<Longrightarrow> \<exists>T. openin X T \<and> ?x \<in> T \<and> T \<subseteq> topspace X - S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> topspace X
\<lbrakk>?x \<in> topspace X; ?x \<notin> S\<rbrakk> \<Longrightarrow> \<exists>T. openin X T \<and> ?x \<in> T \<and> T \<subseteq> topspace X - S

goal (1 subgoal):
 1. closedin X S
[PROOF STEP]
using closedin_def openin_subopen
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> topspace X
\<lbrakk>?x \<in> topspace X; ?x \<notin> S\<rbrakk> \<Longrightarrow> \<exists>T. openin X T \<and> ?x \<in> T \<and> T \<subseteq> topspace X - S
closedin ?U ?S = (?S \<subseteq> topspace ?U \<and> openin ?U (topspace ?U - ?S))
openin ?U ?S = (\<forall>x\<in>?S. \<exists>T. openin ?U T \<and> x \<in> T \<and> T \<subseteq> ?S)

goal (1 subgoal):
 1. closedin X S
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
closedin X S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSLIMSEQ_diff_const: "f \<longlonglongrightarrow>\<^sub>N\<^sub>S a \<Longrightarrow> (\<lambda>n. f n - b) \<longlonglongrightarrow>\<^sub>N\<^sub>S a - b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow>\<^sub>N\<^sub>S a \<Longrightarrow> (\<lambda>n. f n - b) \<longlonglongrightarrow>\<^sub>N\<^sub>S a - b
[PROOF STEP]
by (simp add: NSLIMSEQ_diff NSLIMSEQ_const)


[STATEMENT]
lemma pointwise_le_iff:
  "x \<unlhd> y \<longleftrightarrow> length x = length y \<and> (\<forall>(i,j) \<in> set (zip x y). i\<le>j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<unlhd> y) = (length x = length y \<and> (\<forall>(i, j)\<in>set (zip x y). i \<le> j))
[PROOF STEP]
by (simp add: list_all2_iff pointwise_le_def)


[STATEMENT]
lemma upper_triangular_adjugate:
  fixes A::"(('a::comm_ring_1,'n::{wellorder, finite}) vec, 'n) vec"
  assumes A: "upper_triangular A"
  shows "upper_triangular (adjugate A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_triangular (adjugate A)
[PROOF STEP]
proof (auto simp add: cofactor_def upper_triangular_def adjugate_def transpose_def cofactorM_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. j < i \<Longrightarrow> det (minorM A j i) = (0::'a)
[PROOF STEP]
fix i j::'n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. j < i \<Longrightarrow> det (minorM A j i) = (0::'a)
[PROOF STEP]
assume ji: "j < i"
[PROOF STATE]
proof (state)
this:
j < i

goal (1 subgoal):
 1. \<And>i j. j < i \<Longrightarrow> det (minorM A j i) = (0::'a)
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
upper_triangular A
j < i
[PROOF STEP]
show "det (minorM A j i) = 0"
[PROOF STATE]
proof (prove)
using this:
upper_triangular A
j < i

goal (1 subgoal):
 1. det (minorM A j i) = (0::'a)
[PROOF STEP]
unfolding minorM_eq det_sq_matrix_eq[symmetric] from_vec_to_vec det_minor_row
[PROOF STATE]
proof (prove)
using this:
upper_triangular A
j < i

goal (1 subgoal):
 1. Square_Matrix.det (upd_row (from_vec A) j (axis i (1::'a))) = (0::'a)
[PROOF STEP]
by (subst Square_Matrix.det_upperdiagonal)
       (auto simp: upd_row.rep_eq from_vec.rep_eq row_def axis_def upper_triangular_def intro!: prod_zero)
[PROOF STATE]
proof (state)
this:
det (minorM A j i) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cinner_minus_left [simp]: "cinner (- x) y = - cinner x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner (- x) y = - cinner x y
[PROOF STEP]
using cinner_add_left [of x "- x" y]
[PROOF STATE]
proof (prove)
using this:
cinner (x + - x) y = cinner x y + cinner (- x) y

goal (1 subgoal):
 1. cinner (- x) y = - cinner x y
[PROOF STEP]
by (simp add: group_add_class.add_eq_0_iff)


[STATEMENT]
lemma absolutely_integrable_mult_Fejer_kernel_reflected2:
  assumes f: "f absolutely_integrable_on {-pi..pi}"
    and periodic: "\<And>x. f(x + 2*pi) = f x"
  shows "(\<lambda>x. Fejer_kernel n x * f(t - x)) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Fejer_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. Fejer_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
have "(\<lambda>x. f(t - x)) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on {- pi..pi}
f (?x + 2 * pi) = f ?x

goal (1 subgoal):
 1. (\<lambda>x. f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
apply (subst absolutely_integrable_reflect_real [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f absolutely_integrable_on {- pi..pi}; \<And>x. f (x + 2 * pi) = f x\<rbrakk> \<Longrightarrow> (\<lambda>x. f (t - - x)) absolutely_integrable_on {- pi..- (- pi)}
[PROOF STEP]
apply (simp add: absolutely_integrable_periodic_offset)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (t - x)) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<lambda>x. Fejer_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (t - x)) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<lambda>x. Fejer_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by (rule absolutely_integrable_mult_Fejer_kernel)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Fejer_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "Abs_Nat (Rep_Nat a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_Nat (Rep_Nat a) = a
[PROOF STEP]
nitpick [expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_Nat (Rep_Nat a) = a
[PROOF STEP]
by (rule Rep_Nat_inverse)


[STATEMENT]
lemma Elem_affine_of_ivl_le:
  assumes "e \<in> UNIV \<rightarrow> {-1 .. 1}"
  assumes "l \<le> u"
  shows "l \<le> aform_val e (aform_of_ivl l u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "l =  (1 / 2) *\<^sub>R l + (1 / 2) *\<^sub>R l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = (1 / 2) *\<^sub>R l + (1 / 2) *\<^sub>R l
[PROOF STEP]
by (simp add: scaleR_left_distrib[symmetric])
[PROOF STATE]
proof (state)
this:
l = (1 / 2) *\<^sub>R l + (1 / 2) *\<^sub>R l

goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
l = (1 / 2) *\<^sub>R l + (1 / 2) *\<^sub>R l

goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "\<dots> = (l + u)/\<^sub>R2 - tdev (pdevs_of_ivl l u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>R l + (1 / 2) *\<^sub>R l = (l + u) /\<^sub>R 2 - tdev (pdevs_of_ivl l u)
[PROOF STEP]
by (auto simp: assms tdev_pdevs_of_ivl algebra_simps)
[PROOF STATE]
proof (state)
this:
(1 / 2) *\<^sub>R l + (1 / 2) *\<^sub>R l = (l + u) /\<^sub>R 2 - tdev (pdevs_of_ivl l u)

goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / 2) *\<^sub>R l + (1 / 2) *\<^sub>R l = (l + u) /\<^sub>R 2 - tdev (pdevs_of_ivl l u)

goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
have "\<dots> \<le> aform_val e (aform_of_ivl l u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l + u) /\<^sub>R 2 - tdev (pdevs_of_ivl l u) \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
using abs_pdevs_val_le_tdev[OF assms(1), of "pdevs_of_ivl l u"]
[PROOF STATE]
proof (prove)
using this:
\<bar>pdevs_val e (pdevs_of_ivl l u)\<bar> \<le> tdev (pdevs_of_ivl l u)

goal (1 subgoal):
 1. (l + u) /\<^sub>R 2 - tdev (pdevs_of_ivl l u) \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
by (auto simp: aform_val_def aform_of_ivl_def minus_le_iff dest!: abs_le_D2)
[PROOF STATE]
proof (state)
this:
(l + u) /\<^sub>R 2 - tdev (pdevs_of_ivl l u) \<le> aform_val e (aform_of_ivl l u)

goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l \<le> aform_val e (aform_of_ivl l u)

goal (1 subgoal):
 1. l \<le> aform_val e (aform_of_ivl l u)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
l \<le> aform_val e (aform_of_ivl l u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_nth_in_listset: "length x = length As \<Longrightarrow> (\<And>i. i < length As \<Longrightarrow> x ! i \<in> As ! i) \<Longrightarrow> x \<in> listset As"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length x = length As; \<And>i. i < length As \<Longrightarrow> x ! i \<in> As ! i\<rbrakk> \<Longrightarrow> x \<in> listset As
[PROOF STEP]
by (induction x As rule: list_induct2) (fastforce simp: set_Cons_def nth_Cons)+


[STATEMENT]
lemma polyhedron_Int_affine_minimal:
  fixes S :: "'a :: euclidean_space set"
  shows "polyhedron S \<longleftrightarrow>
         (\<exists>F. finite F \<and> S = (affine hull S) \<inter> \<Inter>F \<and>
              (\<forall>h \<in> F. \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x \<le> b}) \<and>
              (\<forall>F'. F' \<subset> F \<longrightarrow> S \<subset> (affine hull S) \<inter> \<Inter>F'))"
     (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polyhedron S = (\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F'))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. polyhedron S \<Longrightarrow> \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F')
 2. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F') \<Longrightarrow> polyhedron S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
polyhedron S

goal (2 subgoals):
 1. polyhedron S \<Longrightarrow> \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F')
 2. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F') \<Longrightarrow> polyhedron S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
polyhedron S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
polyhedron S

goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F')
[PROOF STEP]
by (force simp: polyhedron_Int_affine_parallel_minimal elim!: ex_forward)
[PROOF STATE]
proof (state)
this:
\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F')

goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}) \<and> (\<forall>F'\<subset>F. S \<subset> affine hull S \<inter> \<Inter> F') \<Longrightarrow> polyhedron S
[PROOF STEP]
qed (auto simp: polyhedron_Int_affine elim!: ex_forward)


[STATEMENT]
lemma connected_Euclidean_space: "connected_space (Euclidean_space n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_space (Euclidean_space n)
[PROOF STEP]
by (simp add: contractible_imp_connected_space)


[STATEMENT]
lemma "eq (Node (1::nat) (Node 2 Leaf Leaf) (Node 3 Leaf Leaf)) (Node (1::nat) (Node 2 Leaf Leaf) (Node 4 Leaf Leaf))
    \<longleftrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq (Node 1 (Node 2 Leaf Leaf) (Node 3 Leaf Leaf)) (Node 1 (Node 2 Leaf Leaf) (Node 4 Leaf Leaf)) = False
[PROOF STEP]
by eval


[STATEMENT]
lemma euclid:
  "FPRE (\<lambda>s::nat store. s ''x'' = x \<and> s ''y'' = y)
   (WHILE (\<lambda>s. s ''y'' \<noteq> 0) INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y)
    DO
     (''z'' ::= (\<lambda>s. s ''y''));
     (''y'' ::= (\<lambda>s. s ''x'' mod s ''y''));
     (''x'' ::= (\<lambda>s. s ''z''))
    OD)
   POST (\<lambda>s. s ''x'' = gcd x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_antirange_kleene_algebra.bdia (WHILE (\<lambda>s. s ''y'' \<noteq> 0) INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) DO (''z'' ::= (\<lambda>s. s ''y'')) ; (''y'' ::= (\<lambda>s. s ''x'' mod s ''y'')) ; (''x'' ::= (\<lambda>s. s ''z'')) OD) \<lceil>\<lambda>s. s ''x'' = x \<and> s ''y'' = y\<rceil> \<subseteq> rel_antirange_kleene_algebra.ars_r \<lceil>\<lambda>s. s ''x'' = gcd x y\<rceil>
[PROOF STEP]
by (rule rel_modal_kleene_algebra.bdia_whilei, auto simp: gcd_non_0_nat)


[STATEMENT]
lemma (in field) poly_of_const_over_carrier:
  shows "poly_of_const ` (carrier R) = { p \<in> carrier ((carrier R)[X]). degree p = 0 }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
have "poly_of_const ` (carrier R) = insert [] { [ k ] | k. k \<in> carrier R - { \<zero> } }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_const ` carrier R = insert [] {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
unfolding poly_of_const_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. local.normalize [k]) ` carrier R = insert [] {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly_of_const ` carrier R = insert [] {[k] |k. k \<in> carrier R - {\<zero>}}

goal (1 subgoal):
 1. poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_of_const ` carrier R = insert [] {[k] |k. k \<in> carrier R - {\<zero>}}

goal (1 subgoal):
 1. poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
have " ... = { p \<in> carrier ((carrier R)[X]). degree p = 0 }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert [] {[k] |k. k \<in> carrier R - {\<zero>}} = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
unfolding univ_poly_def polynomial_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert [] {[k] |k. k \<in> carrier R - {\<zero>}} = {p \<in> carrier \<lparr>carrier = {p. p = [] \<or> set p \<subseteq> carrier R \<and> lead_coeff p \<noteq> \<zero>}, monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>. degree p = 0}
[PROOF STEP]
by (auto, metis le_Suc_eq le_zero_eq length_0_conv length_Suc_conv list.sel(1) list.set_sel(1) subsetCE)
[PROOF STATE]
proof (state)
this:
insert [] {[k] |k. k \<in> carrier R - {\<zero>}} = {p \<in> carrier (carrier R [X]). degree p = 0}

goal (1 subgoal):
 1. poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}

goal (1 subgoal):
 1. poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly_of_const ` carrier R = {p \<in> carrier (carrier R [X]). degree p = 0}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma and_int_rec:
  \<open>k AND l = of_bool (odd k \<and> odd l) + 2 * ((k div 2) AND (l div 2))\<close>
    for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
proof (cases \<open>k \<in> {0, - 1} \<and> l \<in> {0, - 1}\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k \<in> {0, - 1} \<and> l \<in> {0, - 1} \<Longrightarrow> k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
 2. \<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1}) \<Longrightarrow> k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k \<in> {0, - 1} \<and> l \<in> {0, - 1}

goal (2 subgoals):
 1. k \<in> {0, - 1} \<and> l \<in> {0, - 1} \<Longrightarrow> k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
 2. \<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1}) \<Longrightarrow> k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<in> {0, - 1} \<and> l \<in> {0, - 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<in> {0, - 1} \<and> l \<in> {0, - 1}

goal (1 subgoal):
 1. k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
by auto (simp_all add: and_int.simps)
[PROOF STATE]
proof (state)
this:
k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)

goal (1 subgoal):
 1. \<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1}) \<Longrightarrow> k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1}) \<Longrightarrow> k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1})

goal (1 subgoal):
 1. \<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1}) \<Longrightarrow> k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (k \<in> {0, - 1} \<and> l \<in> {0, - 1})

goal (1 subgoal):
 1. k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)
[PROOF STEP]
by (auto simp add: ac_simps and_int.simps [of k l])
[PROOF STATE]
proof (state)
this:
k AND l = of_bool (odd k \<and> odd l) + 2 * (k div 2 AND l div 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem gen_ramanujan_sum_distrib:
  fixes f g :: "nat \<Rightarrow> complex"
  assumes "a > 0" "b > 0" "m > 0" "k > 0" (* remove cond. on m,n *)
  assumes "coprime a k" "coprime b m" "coprime k m"
  assumes "multiplicative_function f" and
          "multiplicative_function g"
  shows "s f g (m*k) (a*b) = s f g m a * s f g k b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
from assms(1-6)
[PROOF STATE]
proof (chain)
picking this:
0 < a
0 < b
0 < m
0 < k
coprime a k
coprime b m
[PROOF STEP]
have eq: "gcd (m*k) (a*b) = gcd a m * gcd k b"
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b
0 < m
0 < k
coprime a k
coprime b m

goal (1 subgoal):
 1. gcd (m * k) (a * b) = gcd a m * gcd k b
[PROOF STEP]
by (simp add: linear_gcd  gcd.commute mult.commute)
[PROOF STATE]
proof (state)
this:
gcd (m * k) (a * b) = gcd a m * gcd k b

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "s f g (m*k) (a*b) =
        (\<Sum>d | d dvd gcd (m*k) (a*b). f(d) * g((m*k) div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s f g (m * k) (a * b) = (\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d))
[PROOF STEP]
unfolding gen_ramanujan_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd (a * b) (m * k). f d * g (m * k div d)) = (\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d))
[PROOF STEP]
by (rule sum.cong, simp add: gcd.commute,blast)
[PROOF STATE]
proof (state)
this:
s f g (m * k) (a * b) = (\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
s f g (m * k) (a * b) = (\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> =
     (\<Sum>d | d dvd gcd a m * gcd k b. f(d) * g((m*k) div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d)) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
gcd (m * k) (a * b) = gcd a m * gcd k b

goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d)) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d)) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd gcd (m * k) (a * b). f d * g (m * k div d)) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> =
     (\<Sum>(d1,d2) | d1 dvd gcd a m \<and>  d2 dvd gcd k b.
          f(d1*d2) * g((m*k) div (d1*d2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
have b: "bij_betw (\<lambda>(d1, d2). d1 * d2)
   {(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}
   {d. d dvd gcd a m * gcd k b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>(d1, d2). d1 * d2) {(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b} {d. d dvd gcd a m * gcd k b}
[PROOF STEP]
using assms(5) reindex_product_bij
[PROOF STATE]
proof (prove)
using this:
coprime a k
coprime ?a ?k \<Longrightarrow> bij_betw (\<lambda>(d1, d2). d1 * d2) {(d1, d2). d1 dvd gcd ?a ?m \<and> d2 dvd gcd ?k ?b} {d. d dvd gcd ?a ?m * gcd ?k ?b}

goal (1 subgoal):
 1. bij_betw (\<lambda>(d1, d2). d1 * d2) {(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b} {d. d dvd gcd a m * gcd k b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>(d1, d2). d1 * d2) {(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b} {d. d dvd gcd a m * gcd k b}

goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
have "(\<Sum>(d1, d2) | d1 dvd gcd a m \<and> d2 dvd gcd k b.
     f (d1 * d2) * g (m * k div (d1 * d2))) =
      (\<Sum>x\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}.
     f (case x of (d1, d2) \<Rightarrow> d1 * d2)*
       g (m * k div (case x of (d1, d2) \<Rightarrow> d1 * d2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>x\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (case x of (d1, d2) \<Rightarrow> d1 * d2) * g (m * k div (case x of (d1, d2) \<Rightarrow> d1 * d2)))
[PROOF STEP]
by (rule sum.cong,auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>x\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (case x of (d1, d2) \<Rightarrow> d1 * d2) * g (m * k div (case x of (d1, d2) \<Rightarrow> d1 * d2)))

goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>x\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (case x of (d1, d2) \<Rightarrow> d1 * d2) * g (m * k div (case x of (d1, d2) \<Rightarrow> d1 * d2)))

goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
have "\<dots> = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (case x of (d1, d2) \<Rightarrow> d1 * d2) * g (m * k div (case x of (d1, d2) \<Rightarrow> d1 * d2))) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>(d1, d2). d1 * d2) {(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b} {d. d dvd gcd a m * gcd k b}

goal (1 subgoal):
 1. (\<Sum>x\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (case x of (d1, d2) \<Rightarrow> d1 * d2) * g (m * k div (case x of (d1, d2) \<Rightarrow> d1 * d2))) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))
[PROOF STEP]
by (rule sum.reindex_bij_betw[of "\<lambda>(d1,d2). d1*d2" ])
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (case x of (d1, d2) \<Rightarrow> d1 * d2) * g (m * k div (case x of (d1, d2) \<Rightarrow> d1 * d2))) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))

goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d))

goal (1 subgoal):
 1. (\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd gcd a m * gcd k b. f d * g (m * k div d)) = (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b.
                     f (d1*d2) * g ((m*k) div (d1*d2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f (d1 * d2) * g (m * k div (d1 * d2)))
[PROOF STEP]
by (simp add: sum.cartesian_product) (rule sum.cong,auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f (d1 * d2) * g (m * k div (d1 * d2)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(d1, d2)\<in>{(d1, d2). d1 dvd gcd a m \<and> d2 dvd gcd k b}. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f (d1 * d2) * g (m * k div (d1 * d2)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b.
                      f d1 * f d2 * g ((m*k) div (d1*d2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m * k div (d1 * d2)))
[PROOF STEP]
using assms(5) assms(8) multiplicative_function.mult_coprime
[PROOF STATE]
proof (prove)
using this:
coprime a k
multiplicative_function f
\<lbrakk>multiplicative_function ?f; coprime ?a ?b\<rbrakk> \<Longrightarrow> ?f (?a * ?b) = ?f ?a * ?f ?b

goal (1 subgoal):
 1. (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m * k div (d1 * d2)))
[PROOF STEP]
by (intro sum.cong refl) fastforce+
[PROOF STATE]
proof (state)
this:
(\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m * k div (d1 * d2)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f (d1 * d2) * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m * k div (d1 * d2)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b.
                      f d1 * f d2* g (m div d1) * g (k div d2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m div d1) * g (k div d2))
[PROOF STEP]
proof (intro sum.cong refl, clarify, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x dvd gcd a m; xa dvd gcd k b\<rbrakk> \<Longrightarrow> f x * f xa * g (m * k div (x * xa)) = f x * f xa * g (m div x) * g (k div xa)
[PROOF STEP]
case (1 d1 d2)
[PROOF STATE]
proof (state)
this:
d1 dvd gcd a m
d2 dvd gcd k b

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x dvd gcd a m; xa dvd gcd k b\<rbrakk> \<Longrightarrow> f x * f xa * g (m * k div (x * xa)) = f x * f xa * g (m div x) * g (k div xa)
[PROOF STEP]
hence "g (m * k div (d1 * d2)) = g (m div d1) * g (k div d2)"
[PROOF STATE]
proof (prove)
using this:
d1 dvd gcd a m
d2 dvd gcd k b

goal (1 subgoal):
 1. g (m * k div (d1 * d2)) = g (m div d1) * g (k div d2)
[PROOF STEP]
using assms(7,9) multipl_div
[PROOF STATE]
proof (prove)
using this:
d1 dvd gcd a m
d2 dvd gcd k b
coprime k m
multiplicative_function g
\<lbrakk>multiplicative_function ?f; ?d1.0 dvd ?m; ?d2.0 dvd ?k; coprime ?m ?k\<rbrakk> \<Longrightarrow> ?f (?m * ?k div (?d1.0 * ?d2.0)) = ?f (?m div ?d1.0) * ?f (?k div ?d2.0)

goal (1 subgoal):
 1. g (m * k div (d1 * d2)) = g (m div d1) * g (k div d2)
[PROOF STEP]
by (meson coprime_commute dvd_gcdD1 dvd_gcdD2)
[PROOF STATE]
proof (state)
this:
g (m * k div (d1 * d2)) = g (m div d1) * g (k div d2)

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x dvd gcd a m; xa dvd gcd k b\<rbrakk> \<Longrightarrow> f x * f xa * g (m * k div (x * xa)) = f x * f xa * g (m div x) * g (k div xa)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
g (m * k div (d1 * d2)) = g (m div d1) * g (k div d2)

goal (1 subgoal):
 1. f d1 * f d2 * g (m * k div (d1 * d2)) = f d1 * f d2 * g (m div d1) * g (k div d2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f d1 * f d2 * g (m * k div (d1 * d2)) = f d1 * f d2 * g (m div d1) * g (k div d2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m div d1) * g (k div d2))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m * k div (d1 * d2))) = (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m div d1) * g (k div d2))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{d1. d1 dvd gcd a m}. \<Sum>j\<in>{d2. d2 dvd gcd k b}.
                      f i * g (m div i) * (f j * g (k div j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m div d1) * g (k div d2)) = (\<Sum>i\<in>{d1. d1 dvd gcd a m}. \<Sum>j\<in>{d2. d2 dvd gcd k b}. f i * g (m div i) * (f j * g (k div j)))
[PROOF STEP]
by (rule sum.cong,blast,rule sum.cong,blast,simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m div d1) * g (k div d2)) = (\<Sum>i\<in>{d1. d1 dvd gcd a m}. \<Sum>j\<in>{d2. d2 dvd gcd k b}. f i * g (m div i) * (f j * g (k div j)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d1 | d1 dvd gcd a m. \<Sum>d2 | d2 dvd gcd k b. f d1 * f d2 * g (m div d1) * g (k div d2)) = (\<Sum>i\<in>{d1. d1 dvd gcd a m}. \<Sum>j\<in>{d2. d2 dvd gcd k b}. f i * g (m div i) * (f j * g (k div j)))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> = (\<Sum>d1 | d1 dvd gcd a m. f d1 * g (m div d1)) *
                      (\<Sum>d2 | d2 dvd gcd k b. f d2 * g (k div d2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{d1. d1 dvd gcd a m}. \<Sum>j\<in>{d2. d2 dvd gcd k b}. f i * g (m div i) * (f j * g (k div j))) = (\<Sum>d1 | d1 dvd gcd a m. f d1 * g (m div d1)) * (\<Sum>d2 | d2 dvd gcd k b. f d2 * g (k div d2))
[PROOF STEP]
by (simp add: sum_product)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{d1. d1 dvd gcd a m}. \<Sum>j\<in>{d2. d2 dvd gcd k b}. f i * g (m div i) * (f j * g (k div j))) = (\<Sum>d1 | d1 dvd gcd a m. f d1 * g (m div d1)) * (\<Sum>d2 | d2 dvd gcd k b. f d2 * g (k div d2))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{d1. d1 dvd gcd a m}. \<Sum>j\<in>{d2. d2 dvd gcd k b}. f i * g (m div i) * (f j * g (k div j))) = (\<Sum>d1 | d1 dvd gcd a m. f d1 * g (m div d1)) * (\<Sum>d2 | d2 dvd gcd k b. f d2 * g (k div d2))

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
have "\<dots> = s f g m a * s f g k b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d1 | d1 dvd gcd a m. f d1 * g (m div d1)) * (\<Sum>d2 | d2 dvd gcd k b. f d2 * g (k div d2)) = s f g m a * s f g k b
[PROOF STEP]
unfolding gen_ramanujan_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d1 | d1 dvd gcd a m. f d1 * g (m div d1)) * (\<Sum>d2 | d2 dvd gcd k b. f d2 * g (k div d2)) = (\<Sum>d | d dvd gcd a m. f d * g (m div d)) * (\<Sum>d | d dvd gcd b k. f d * g (k div d))
[PROOF STEP]
by (simp add: gcd.commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>d1 | d1 dvd gcd a m. f d1 * g (m div d1)) * (\<Sum>d2 | d2 dvd gcd k b. f d2 * g (k div d2)) = s f g m a * s f g k b

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s f g (m * k) (a * b) = s f g m a * s f g k b

goal (1 subgoal):
 1. s f g (m * k) (a * b) = s f g m a * s f g k b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s f g (m * k) (a * b) = s f g m a * s f g k b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_enat_partial_function_mono [partial_function_mono]:
  "\<lbrakk> monotone (fun_ord (\<le>)) (\<le>) f; monotone (fun_ord (\<le>)) (\<le>) g \<rbrakk>
  \<Longrightarrow> monotone (fun_ord (\<le>)) (\<le>) (\<lambda>x. max (f x) (g x) :: enat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>monotone (fun_ord (\<le>)) (\<le>) f; monotone (fun_ord (\<le>)) (\<le>) g\<rbrakk> \<Longrightarrow> monotone (fun_ord (\<le>)) (\<le>) (\<lambda>x. max (f x) (g x))
[PROOF STEP]
by(rule mono2mono_max_enat)


[STATEMENT]
lemma ack_nest_bound: "ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
have "ack i1 (ack i2 j) < ack (i1 + i2) (ack (Suc (i1 + i2)) j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (i1 + i2) (ack (Suc (i1 + i2)) j)
[PROOF STEP]
by (meson ack_le_mono1 ack_less_mono1 ack_less_mono2 le_add1 le_trans less_add_Suc2 not_less)
[PROOF STATE]
proof (state)
this:
ack i1 (ack i2 j) < ack (i1 + i2) (ack (Suc (i1 + i2)) j)

goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ack i1 (ack i2 j) < ack (i1 + i2) (ack (Suc (i1 + i2)) j)

goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
have "\<dots> = ack (Suc (i1 + i2)) (Suc j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ack (i1 + i2) (ack (Suc (i1 + i2)) j) = ack (Suc (i1 + i2)) (Suc j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ack (i1 + i2) (ack (Suc (i1 + i2)) j) = ack (Suc (i1 + i2)) (Suc j)

goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ack (i1 + i2) (ack (Suc (i1 + i2)) j) = ack (Suc (i1 + i2)) (Suc j)

goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
have "\<dots> \<le> ack (2 + (i1 + i2)) j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ack (Suc (i1 + i2)) (Suc j) \<le> ack (2 + (i1 + i2)) j
[PROOF STEP]
using ack2_le_ack1 add_2_eq_Suc
[PROOF STATE]
proof (prove)
using this:
ack ?i (Suc ?j) \<le> ack (Suc ?i) ?j
2 + ?n = Suc (Suc ?n)

goal (1 subgoal):
 1. ack (Suc (i1 + i2)) (Suc j) \<le> ack (2 + (i1 + i2)) j
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
ack (Suc (i1 + i2)) (Suc j) \<le> ack (2 + (i1 + i2)) j

goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j

goal (1 subgoal):
 1. ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjointI:
  "(\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> a \<noteq> b \<Longrightarrow> a \<inter> b = {}) \<Longrightarrow> disjoint A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> A; b \<in> A; a \<noteq> b\<rbrakk> \<Longrightarrow> a \<inter> b = {}) \<Longrightarrow> disjoint A
[PROOF STEP]
unfolding disjoint_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> A; b \<in> A; a \<noteq> b\<rbrakk> \<Longrightarrow> a \<inter> b = {}) \<Longrightarrow> \<forall>a\<in>A. \<forall>b\<in>A. a \<noteq> b \<longrightarrow> a \<inter> b = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma size_rbt_joinL[simp]: "size (rbt_joinL t1 a b t2) = Suc (size t1 + size t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (rbt_joinL t1 a b t2) = Suc (size t1 + size t2)
[PROOF STEP]
by (induction t1 a b t2 rule: rbt_joinL.induct)
     (auto simp: rbt_joinL.simps split: RBT_Impl.rbt.splits RBT_Impl.color.splits)


[STATEMENT]
lemma dvd_Gcd_fin_iff:
  "b dvd Gcd\<^sub>f\<^sub>i\<^sub>n A \<longleftrightarrow> (\<forall>a\<in>A. b dvd a)" if "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b dvd Gcd\<^sub>f\<^sub>i\<^sub>n A) = (\<forall>a\<in>A. b dvd a)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (b dvd Gcd\<^sub>f\<^sub>i\<^sub>n A) = (\<forall>a\<in>A. b dvd a)
[PROOF STEP]
by (auto intro: Gcd_fin_greatest Gcd_fin_dvd dvd_trans [of b "Gcd\<^sub>f\<^sub>i\<^sub>n A"])


[STATEMENT]
lemma special_points_on_x_axis' [simp]:
  shows "on_circline x_axis 0\<^sub>h" and "on_circline x_axis 1\<^sub>h" and "on_circline x_axis \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_circline x_axis 0\<^sub>h &&& on_circline x_axis 1\<^sub>h &&& on_circline x_axis \<infinity>\<^sub>h
[PROOF STEP]
by (transfer, transfer, simp add: vec_cnj_def)+


[STATEMENT]
lemma convergent_minus_iff_ereal: "convergent (\<lambda>x. - f x::ereal) \<longleftrightarrow> convergent f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>x. - f x) = convergent f
[PROOF STEP]
unfolding convergent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>L. (\<lambda>x. - f x) \<longlonglongrightarrow> L) = (\<exists>L. f \<longlonglongrightarrow> L)
[PROOF STEP]
by (metis ereal_uminus_uminus ereal_Lim_uminus)


[STATEMENT]
lemma perm_restrict_union:
  assumes "perm_restrict f A permutes A" "perm_restrict f B permutes B" "A \<inter> B = {}"
  shows "perm_restrict f A o perm_restrict f B = perm_restrict f (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perm_restrict f A \<circ> perm_restrict f B = perm_restrict f (A \<union> B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
perm_restrict f A permutes A
perm_restrict f B permutes B
A \<inter> B = {}

goal (1 subgoal):
 1. perm_restrict f A \<circ> perm_restrict f B = perm_restrict f (A \<union> B)
[PROOF STEP]
by (auto simp: fun_eq_iff perm_restrict_def permutes_def) (metis Diff_iff Diff_triv)


[STATEMENT]
lemma linear_inj_on_left_inverse:
  assumes lf: "linear s1 s2 f"
  assumes fi: "inj_on f (vs1.span S)"
  shows "\<exists>g. range g \<subseteq> vs1.span S \<and> linear s2 s1 g \<and> (\<forall>x\<in>vs1.span S. g (f x) = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. range g \<subseteq> vs1.span S \<and> linear (*b) (*a) g \<and> (\<forall>x\<in>vs1.span S. g (f x) = x)
[PROOF STEP]
using linear_exists_left_inverse_on[OF lf vs1.subspace_span fi]
[PROOF STATE]
proof (prove)
using this:
\<exists>g. range g \<subseteq> vs1.span S \<and> linear (*b) (*a) g \<and> (\<forall>v\<in>vs1.span S. g (f v) = v)

goal (1 subgoal):
 1. \<exists>g. range g \<subseteq> vs1.span S \<and> linear (*b) (*a) g \<and> (\<forall>x\<in>vs1.span S. g (f x) = x)
[PROOF STEP]
by (auto simp: linear_iff_module_hom)


[STATEMENT]
lemma (in group) r_cancel_one' [simp]: "x \<in> carrier G \<Longrightarrow> a \<in> carrier G \<Longrightarrow> x = a \<otimes> x \<longleftrightarrow> a = one G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; a \<in> carrier G\<rbrakk> \<Longrightarrow> (x = a \<otimes> x) = (a = \<one>)
[PROOF STEP]
using r_cancel_one
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; ?a \<in> carrier G\<rbrakk> \<Longrightarrow> (?a \<otimes> ?x = ?x) = (?a = \<one>)

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; a \<in> carrier G\<rbrakk> \<Longrightarrow> (x = a \<otimes> x) = (a = \<one>)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sum_le_1_prod: assumes d: "1 \<le> d" and c: "1 \<le> c"
  shows "c + d \<le> 1 + c * (d :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c + d \<le> 1 + c * d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c + d \<le> 1 + c * d
[PROOF STEP]
from d c
[PROOF STATE]
proof (chain)
picking this:
1 \<le> d
1 \<le> c
[PROOF STEP]
have "(c - 1) * (d - 1) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> d
1 \<le> c

goal (1 subgoal):
 1. 0 \<le> (c - 1) * (d - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> (c - 1) * (d - 1)

goal (1 subgoal):
 1. c + d \<le> 1 + c * d
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> (c - 1) * (d - 1)

goal (1 subgoal):
 1. c + d \<le> 1 + c * d
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
c + d \<le> 1 + c * d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_diff_se: "t \<in># S \<Longrightarrow> size S = size (S - {#t#}) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> size S = size (S - {#t#}) + 1
[PROOF STEP]
proof (unfold size_multiset_overloaded_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
let ?SIZE = "sum (count S) (set_mset S)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
assume A: "t \<in># S"
[PROOF STATE]
proof (state)
this:
t \<in># S

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
t \<in># S
[PROOF STEP]
have SPLITPRE: "finite (set_mset S) & {t}\<subseteq>(set_mset S)"
[PROOF STATE]
proof (prove)
using this:
t \<in># S

goal (1 subgoal):
 1. finite (set_mset S) \<and> {t} \<subseteq> set_mset S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (set_mset S) \<and> {t} \<subseteq> set_mset S

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
hence "?SIZE = sum (count S) (set_mset S - {t}) + sum (count S) {t}"
[PROOF STATE]
proof (prove)
using this:
finite (set_mset S) \<and> {t} \<subseteq> set_mset S

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + sum (count S) {t}
[PROOF STEP]
by (blast dest: sum.subset_diff)
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + sum (count S) {t}

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
hence "?SIZE = sum (count S) (set_mset S - {t}) + count (S) t"
[PROOF STATE]
proof (prove)
using this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + sum (count S) {t}

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count S t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count S t

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count S t

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
t \<in># S
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count S t
[PROOF STEP]
have "count S t = count (S-{#t#}) t + 1"
[PROOF STATE]
proof (prove)
using this:
t \<in># S
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count S t

goal (1 subgoal):
 1. count S t = count (S - {#t#}) t + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
count S t = count (S - {#t#}) t + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count S t
count S t = count (S - {#t#}) t + 1
[PROOF STEP]
have D: "?SIZE = sum (count S) (set_mset S - {t}) + count (S-{#t#}) t + 1"
[PROOF STATE]
proof (prove)
using this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count S t
count S t = count (S - {#t#}) t + 1

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count (S - {#t#}) t + 1
[PROOF STEP]
by (arith)
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count (S - {#t#}) t + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count (S - {#t#}) t + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
have "sum (count S) (set_mset S - {t}) = sum (count (S-{#t#})) (set_mset S - {t})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})
[PROOF STEP]
have "\<forall>x\<in>(set_mset S - {t}). count S x = count (S-{#t#}) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set_mset S - {t}. count S x = count (S - {#t#}) x
[PROOF STEP]
by (auto iff add: count_ne_remove)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set_mset S - {t}. count S x = count (S - {#t#}) x

goal (1 subgoal):
 1. sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set_mset S - {t}. count S x = count (S - {#t#}) x

goal (1 subgoal):
 1. sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count (S - {#t#}) t + 1
sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})
[PROOF STEP]
have D: "?SIZE = sum (count (S-{#t#})) (set_mset S - {t}) + count (S-{#t#}) t + 1"
[PROOF STATE]
proof (prove)
using this:
sum (count S) (set_mset S) = sum (count S) (set_mset S - {t}) + count (S - {#t#}) t + 1
sum (count S) (set_mset S - {t}) = sum (count (S - {#t#})) (set_mset S - {t})

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
assume CASE: "t \<notin># S - {#t#}"
[PROOF STATE]
proof (state)
this:
t \<notin># S - {#t#}

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
from CASE
[PROOF STATE]
proof (chain)
picking this:
t \<notin># S - {#t#}
[PROOF STEP]
have "set_mset S - {t} = set_mset (S - {#t#})"
[PROOF STATE]
proof (prove)
using this:
t \<notin># S - {#t#}

goal (1 subgoal):
 1. set_mset S - {t} = set_mset (S - {#t#})
[PROOF STEP]
by (auto simp add: in_diff_count split: if_splits)
[PROOF STATE]
proof (state)
this:
set_mset S - {t} = set_mset (S - {#t#})

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
with CASE D
[PROOF STATE]
proof (chain)
picking this:
t \<notin># S - {#t#}
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1
set_mset S - {t} = set_mset (S - {#t#})
[PROOF STEP]
have "?SIZE = sum (count (S-{#t#})) (set_mset (S - {#t#})) + 1"
[PROOF STATE]
proof (prove)
using this:
t \<notin># S - {#t#}
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1
set_mset S - {t} = set_mset (S - {#t#})

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
by (simp add: not_in_iff)
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
t \<notin># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
t \<notin># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
t \<notin># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
assume CASE: "t \<in># S - {#t#}"
[PROOF STATE]
proof (state)
this:
t \<in># S - {#t#}

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
from CASE
[PROOF STATE]
proof (chain)
picking this:
t \<in># S - {#t#}
[PROOF STEP]
have "t \<in># S"
[PROOF STATE]
proof (prove)
using this:
t \<in># S - {#t#}

goal (1 subgoal):
 1. t \<in># S
[PROOF STEP]
by (rule in_diffD)
[PROOF STATE]
proof (state)
this:
t \<in># S

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
with CASE
[PROOF STATE]
proof (chain)
picking this:
t \<in># S - {#t#}
t \<in># S
[PROOF STEP]
have 1: "set_mset S = set_mset (S-{#t#})"
[PROOF STATE]
proof (prove)
using this:
t \<in># S - {#t#}
t \<in># S

goal (1 subgoal):
 1. set_mset S = set_mset (S - {#t#})
[PROOF STEP]
by (auto simp add: in_diff_count split: if_splits)
[PROOF STATE]
proof (state)
this:
set_mset S = set_mset (S - {#t#})

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set_mset S = set_mset (S - {#t#})

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
from D
[PROOF STATE]
proof (chain)
picking this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1
[PROOF STEP]
have "?SIZE = sum (count (S-{#t#})) (set_mset S - {t}) + sum (count (S-{#t#})) {t} + 1"
[PROOF STATE]
proof (prove)
using this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t} + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t} + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t} + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
from SPLITPRE sum.subset_diff
[PROOF STATE]
proof (chain)
picking this:
finite (set_mset S) \<and> {t} \<subseteq> set_mset S
\<lbrakk>?B \<subseteq> ?A; finite ?A\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?g (?A - ?B) + sum ?g ?B
[PROOF STEP]
have "sum (count (S-{#t#})) (set_mset S) = sum (count (S-{#t#})) (set_mset S - {t}) + sum (count (S-{#t#})) {t}"
[PROOF STATE]
proof (prove)
using this:
finite (set_mset S) \<and> {t} \<subseteq> set_mset S
\<lbrakk>?B \<subseteq> ?A; finite ?A\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?g (?A - ?B) + sum ?g ?B

goal (1 subgoal):
 1. sum (count (S - {#t#})) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t}
[PROOF STEP]
by (blast)
[PROOF STATE]
proof (state)
this:
sum (count (S - {#t#})) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t}

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set_mset S = set_mset (S - {#t#})
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t} + 1
sum (count (S - {#t#})) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t}
[PROOF STEP]
have "?SIZE = sum (count (S-{#t#})) (set_mset (S-{#t#})) + 1"
[PROOF STATE]
proof (prove)
using this:
set_mset S = set_mset (S - {#t#})
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t} + 1
sum (count (S - {#t#})) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + sum (count (S - {#t#})) {t}

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
t \<in># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal (1 subgoal):
 1. t \<in># S \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1
t \<notin># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
t \<in># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
show "?SIZE = sum (count (S-{#t#})) (set_mset (S - {#t#})) + 1"
[PROOF STATE]
proof (prove)
using this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset S - {t}) + count (S - {#t#}) t + 1
t \<notin># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
t \<in># S - {#t#} \<Longrightarrow> sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal (1 subgoal):
 1. sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum (count S) (set_mset S) = sum (count (S - {#t#})) (set_mset (S - {#t#})) + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hurwitz_zeta_one_half_left:
  assumes "s \<noteq> 1"
  shows   "hurwitz_zeta (1 / 2) s = (2 powr s - 1) * zeta s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hurwitz_zeta (1 / 2) s = (2 powr s - 1) * zeta s
[PROOF STEP]
using zeta_conv_hurwitz_zeta_multiplication[of 2 s] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 2; s \<noteq> 1\<rbrakk> \<Longrightarrow> of_nat 2 powr s * zeta s = (\<Sum>n = 1..2. hurwitz_zeta (real n / real 2) s)
s \<noteq> 1

goal (1 subgoal):
 1. hurwitz_zeta (1 / 2) s = (2 powr s - 1) * zeta s
[PROOF STEP]
by (simp add: eval_nat_numeral zeta_def field_simps)


[STATEMENT]
lemma set_bind_pmf[simp]: "set_pmf (bind_pmf M N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
have "set_pmf (bind_pmf M N) = {x. ennreal (pmf (bind_pmf M N) x) \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_pmf (M \<bind> N) = {x. ennreal (pmf (M \<bind> N) x) \<noteq> 0}
[PROOF STEP]
by (simp add: set_pmf_eq pmf_nonneg)
[PROOF STATE]
proof (state)
this:
set_pmf (M \<bind> N) = {x. ennreal (pmf (M \<bind> N) x) \<noteq> 0}

goal (1 subgoal):
 1. set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_pmf (M \<bind> N) = {x. ennreal (pmf (M \<bind> N) x) \<noteq> 0}

goal (1 subgoal):
 1. set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
have "\<dots> = (\<Union>M\<in>set_pmf M. set_pmf (N M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. ennreal (pmf (M \<bind> N) x) \<noteq> 0} = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
unfolding ennreal_pmf_bind
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<integral>\<^sup>+ xa. ennreal (pmf (N xa) x) \<partial>measure_pmf M \<noteq> 0} = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
by (subst nn_integral_0_iff_AE) (auto simp: AE_measure_pmf_iff pmf_nonneg set_pmf_eq)
[PROOF STATE]
proof (state)
this:
{x. ennreal (pmf (M \<bind> N) x) \<noteq> 0} = (\<Union>M\<in>set_pmf M. set_pmf (N M))

goal (1 subgoal):
 1. set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))

goal (1 subgoal):
 1. set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
set_pmf (M \<bind> N) = (\<Union>M\<in>set_pmf M. set_pmf (N M))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Group) card_im_D_gchain:"\<lbrakk>0 < n; D_gchain G n f\<rbrakk>
                                   \<Longrightarrow> card (f `{i. i \<le> n}) = Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; D_gchain G n f\<rbrakk> \<Longrightarrow> card (f ` {i. i \<le> n}) = Suc n
[PROOF STEP]
apply (frule D_gchain1 [of "n"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; D_gchain G n f; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow> card (f ` {i. i \<le> n}) = Suc n
[PROOF STEP]
apply (subst card_image, assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permutes_prod:
  assumes p: "p permutes S"
  shows "(\<Prod>s\<in>S. f (p s) s) = (\<Prod>s\<in>S. f s (inv p s))"
    (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>s\<in>S. f (p s) s) = (\<Prod>s\<in>S. f s (inv p s))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p permutes S

goal (1 subgoal):
 1. (\<Prod>s\<in>S. f (p s) s) = (\<Prod>s\<in>S. f s (inv p s))
[PROOF STEP]
by (fact prod.permutes_inv)


[STATEMENT]
lemma moduleI:
  fixes R (structure) and M (structure)
  assumes cring: "cring R"
    and abelian_group: "abelian_group M"
    and smult_closed:
      "!!a x. [| a \<in> carrier R; x \<in> carrier M |] ==> a \<odot>\<^bsub>M\<^esub> x \<in> carrier M"
    and smult_l_distr:
      "!!a b x. [| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>
      (a \<oplus> b) \<odot>\<^bsub>M\<^esub> x = (a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"
    and smult_r_distr:
      "!!a x y. [| a \<in> carrier R; x \<in> carrier M; y \<in> carrier M |] ==>
      a \<odot>\<^bsub>M\<^esub> (x \<oplus>\<^bsub>M\<^esub> y) = (a \<odot>\<^bsub>M\<^esub> x) \<oplus>\<^bsub>M\<^esub> (a \<odot>\<^bsub>M\<^esub> y)"
    and smult_assoc1:
      "!!a b x. [| a \<in> carrier R; b \<in> carrier R; x \<in> carrier M |] ==>
      (a \<otimes> b) \<odot>\<^bsub>M\<^esub> x = a \<odot>\<^bsub>M\<^esub> (b \<odot>\<^bsub>M\<^esub> x)"
    and smult_one:
      "!!x. x \<in> carrier M ==> \<one> \<odot>\<^bsub>M\<^esub> x = x"
  shows "module R M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module R M
[PROOF STEP]
by (auto intro: module.intro cring.axioms abelian_group.axioms
    module_axioms.intro assms)


[STATEMENT]
lemma padic_zero_in_padic_set:
  assumes "p > 0"
  shows "padic_zero p \<in> padic_set p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_zero p \<in> padic_set p
[PROOF STEP]
apply(rule padic_set_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. padic_zero p m \<in> carrier (residue_ring (p ^ m))
 2. \<And>m n. m < n \<Longrightarrow> residue (p ^ m) (padic_zero p n) = padic_zero p m
[PROOF STEP]
by(auto simp: assms padic_zero_def residue_def residue_ring_def)


[STATEMENT]
lemma compact_sums':
  fixes S :: "'a::real_normed_vector set"
  assumes "compact S" and "compact T"
  shows "compact (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
have "(\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = {x + y |x y. x \<in> S \<and> y \<in> T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = {x + y |x y. x \<in> S \<and> y \<in> T}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = {x + y |x y. x \<in> S \<and> y \<in> T}

goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = {x + y |x y. x \<in> S \<and> y \<in> T}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = {x + y |x y. x \<in> S \<and> y \<in> T}

goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
using compact_sums [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = {x + y |x y. x \<in> S \<and> y \<in> T}
compact {x + y |x y. x \<in> S \<and> y \<in> T}

goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compact (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Qp_n_nonempty:
  shows "carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<noteq> {}
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. carrier (Q\<^sub>p\<^bsup>0\<^esup>) \<noteq> {}
 2. \<And>n. carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<noteq> {} \<Longrightarrow> carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>) \<noteq> {}
[PROOF STEP]
apply (simp add: Qp_zero_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<noteq> {} \<Longrightarrow> carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>) \<noteq> {}
[PROOF STEP]
using cartesian_power_cons[of _ Q\<^sub>p _ \<one>] Qp.one_closed
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?as \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>); \<one> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> \<one> # ?as \<in> carrier (Q\<^sub>p\<^bsup>?n + 1\<^esup>)
\<one> \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. \<And>n. carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<noteq> {} \<Longrightarrow> carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>) \<noteq> {}
[PROOF STEP]
by (metis Suc_eq_plus1 all_not_in_conv cartesian_power_cons empty_iff)


[STATEMENT]
lemma Erdos_Rado_sunflower:
  assumes "\<forall> A \<in> F. finite A \<and> card A \<le> k"
    and "card F > (r - 1)^k * fact k"
  shows "\<exists> S. S \<subseteq> F \<and> sunflower S \<and> card S = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>S\<subseteq>F. sunflower S \<and> card S = r
[PROOF STEP]
by (rule sunflower_card_subset_lift[OF _ assms],
      metis Erdos_Rado_sunflower_same_card)


[STATEMENT]
lemma extreme_point_of_segment:
  fixes x :: "'a::euclidean_space"
  shows
   "x extreme_point_of closed_segment a b \<longleftrightarrow> x = a \<or> x = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x extreme_point_of closed_segment a b) = (x = a \<or> x = b)
[PROOF STEP]
by (simp add: extreme_point_of_convex_hull_2 segment_convex_hull)


[STATEMENT]
lemma isomorphic_designsI [intro]: "design \<V>' \<B>' \<Longrightarrow> bij_betw \<pi> \<V> \<V>' \<Longrightarrow> image_mset ((`) \<pi>) \<B> = \<B>'
    \<Longrightarrow> (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>design \<V>' \<B>'; bij_betw \<pi> \<V> \<V>'; image_mset ((`) \<pi>) \<B> = \<B>'\<rbrakk> \<Longrightarrow> (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
using design_isomorphism.intro isomorphic_designs_def wf_design image_set_system_wellformed
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>incidence_system_isomorphism ?\<V> ?\<B> ?\<V>' ?\<B>' ?bij_map; design ?\<V> ?\<B>; design ?\<V>' ?\<B>'\<rbrakk> \<Longrightarrow> design_isomorphism ?\<V> ?\<B> ?\<V>' ?\<B>' ?bij_map
(?\<D> \<cong>\<^sub>D ?\<D>') = (\<exists>\<pi>. design_isomorphism (fst ?\<D>) (snd ?\<D>) (fst ?\<D>') (snd ?\<D>') \<pi>)
design \<V> \<B>
incidence_system (?f ` \<V>) (blocks_image \<B> ?f)

goal (1 subgoal):
 1. \<lbrakk>design \<V>' \<B>'; bij_betw \<pi> \<V> \<V>'; image_mset ((`) \<pi>) \<B> = \<B>'\<rbrakk> \<Longrightarrow> (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>')
[PROOF STEP]
by (metis bij_betw_imp_surj_on blocks_image_def fst_conv incidence_system_axioms
      incidence_system_isomorphism.intro incidence_system_isomorphism_axioms_def snd_conv)


[STATEMENT]
lemma left_ideal_minus:
  assumes "left_ideal I"
  and "a\<in>I" and "b\<in>I"
  shows "a - b \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b \<in> I
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) diff_minus_eq_add left_ideal_def minus_minus subgroup_def)