[STATEMENT]
lemma deg_f: "degree f = degree F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree f = degree F
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree f \<le> degree F
 2. degree F \<le> degree f
[PROOF STEP]
have "coeff f (degree F) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff f (degree F) \<noteq> (0::'a)
[PROOF STEP]
using monic
[PROOF STATE]
proof (prove)
using this:
monic F

goal (1 subgoal):
 1. coeff f (degree F) \<noteq> (0::'a)
[PROOF STEP]
by (simp add: f_def reduce_fps_poly_def)
[PROOF STATE]
proof (state)
this:
coeff f (degree F) \<noteq> (0::'a)

goal (2 subgoals):
 1. degree f \<le> degree F
 2. degree F \<le> degree f
[PROOF STEP]
thus "degree f \<ge> (degree F)"
[PROOF STATE]
proof (prove)
using this:
coeff f (degree F) \<noteq> (0::'a)

goal (1 subgoal):
 1. degree F \<le> degree f
[PROOF STEP]
by (rule le_degree)
[PROOF STATE]
proof (state)
this:
degree F \<le> degree f

goal (1 subgoal):
 1. degree f \<le> degree F
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree f \<le> degree F
[PROOF STEP]
have "coeff f n = 0" if "n > degree F" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff f n = (0::'a)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
degree F < n

goal (1 subgoal):
 1. coeff f n = (0::'a)
[PROOF STEP]
by (simp add: f_def reduce_fps_poly_def coeff_eq_0)
[PROOF STATE]
proof (state)
this:
degree F < ?n \<Longrightarrow> coeff f ?n = (0::'a)

goal (1 subgoal):
 1. degree f \<le> degree F
[PROOF STEP]
thus "degree f \<le> degree F"
[PROOF STATE]
proof (prove)
using this:
degree F < ?n \<Longrightarrow> coeff f ?n = (0::'a)

goal (1 subgoal):
 1. degree f \<le> degree F
[PROOF STEP]
using degree_le
[PROOF STATE]
proof (prove)
using this:
degree F < ?n \<Longrightarrow> coeff f ?n = (0::'a)
\<forall>i>?n. coeff ?p i = (0::?'a) \<Longrightarrow> degree ?p \<le> ?n

goal (1 subgoal):
 1. degree f \<le> degree F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
degree f \<le> degree F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Melem_subst_cls[simp]: "L \<in># C \<cdot> \<sigma> \<longleftrightarrow> (\<exists>M. M \<in># C \<and> L = M \<cdot>l \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L \<in># C \<cdot> \<sigma>) = (\<exists>M. M \<in># C \<and> L = M \<cdot>l \<sigma>)
[PROOF STEP]
unfolding subst_cls_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L \<in># {#A \<cdot>l \<sigma>. A \<in># C#}) = (\<exists>M. M \<in># C \<and> L = M \<cdot>l \<sigma>)
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_fixp2:
  assumes "finite(UNIV :: 'a set)" and "mono (\<tau> :: ('a set \<Rightarrow> 'a set))"
  shows "\<exists> i. (\<tau> ^^ i) UNIV = (\<tau> ^^(i + 1)) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
have "\<forall>i. (\<tau> ^^ (i + (1))) UNIV \<subseteq> (\<tau> ^^ i) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subseteq> (\<tau> ^^ i) UNIV
[PROOF STEP]
by (rule predtrans_UNIV , simp add: assms(2))
[PROOF STATE]
proof (state)
this:
\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subseteq> (\<tau> ^^ i) UNIV

goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subseteq> (\<tau> ^^ i) UNIV

goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
have "\<exists>i. \<not> (\<tau> ^^ (i + (1))) UNIV \<subset> (\<tau> ^^ i) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite UNIV
mono \<tau>

goal (1 subgoal):
 1. \<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite UNIV; mono \<tau>\<rbrakk> \<Longrightarrow> \<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV
[PROOF STEP]
have "\<not> (\<forall> i :: nat. (\<tau> ^^ i) UNIV \<supset> (\<tau> ^^(i + 1)) UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV)
[PROOF STEP]
using assms(1) assms(2) no_infinite_subset_chain2
[PROOF STATE]
proof (prove)
using this:
finite UNIV
mono \<tau>
\<lbrakk>finite UNIV; mono ?\<tau>; \<forall>i. (?\<tau> ^^ (i + 1)) UNIV \<subset> (?\<tau> ^^ i) UNIV\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> (\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV)

goal (1 subgoal):
 1. \<lbrakk>finite UNIV; mono \<tau>\<rbrakk> \<Longrightarrow> \<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV
[PROOF STEP]
thus "\<exists>i. \<not> (\<tau> ^^ (i + (1))) UNIV \<subset> (\<tau> ^^ i) UNIV"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV)

goal (1 subgoal):
 1. \<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV

goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subseteq> (\<tau> ^^ i) UNIV
\<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV
[PROOF STEP]
show "\<exists> i. (\<tau> ^^ i) UNIV = (\<tau> ^^(i + 1)) UNIV"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subseteq> (\<tau> ^^ i) UNIV
\<exists>i. \<not> (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV

goal (1 subgoal):
 1. \<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>i. (\<tau> ^^ i) UNIV = (\<tau> ^^ (i + 1)) UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma EV_disj: "(EV P | EV Q) = EV (\<lambda>n. P n | Q n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (EV P \<or> EV Q) = EV (\<lambda>n. P n \<or> Q n)
[PROOF STEP]
apply (unfold EV_def, force)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma measurable_on_sum:
  assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> f i measurable_on S"
  shows "(\<lambda>x. sum  (\<lambda>i. f i x) I) measurable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>I. f i x) measurable_on S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> f ?i measurable_on S

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>I. f i x) measurable_on S
[PROOF STEP]
by (induction I) (auto simp: measurable_on_add)


[STATEMENT]
lemma lemma_4_12_i_v: "a \<noteq> 1 \<Longrightarrow> (\<exists> n . a r-n\<rightarrow> b = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> (1::'a) \<Longrightarrow> \<exists>n. a r-n\<rightarrow> b = (1::'a)
[PROOF STEP]
apply (subst lemma_2_4_7_b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> (1::'a) \<Longrightarrow> \<exists>n. a ^ n r\<rightarrow> b = (1::'a)
[PROOF STEP]
apply (subst right_lesseq [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> (1::'a) \<Longrightarrow> \<exists>n. a ^ n \<le> b
[PROOF STEP]
by (simp add: lemma_4_12_i_iii)


[STATEMENT]
lemma evnodd_empty: "evnodd {} b = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evnodd {} b = {}
[PROOF STEP]
by (simp add: evnodd_def)


[STATEMENT]
lemma gkernTr1_1:"\<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f \<subseteq> carrier F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f \<subseteq> carrier F
[PROOF STEP]
by (rule subsetI, simp add:gkernTr1)


[STATEMENT]
lemma (in fin_digraph) apaths_finite_triple:
  shows "finite {(u,p,v). apath u p v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(u, p, v). apath u p v}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {(u, p, v). apath u p v}
[PROOF STEP]
have "\<And>u p v. awalk u p v \<Longrightarrow> distinct (awalk_verts u p) \<Longrightarrow>length p \<le> card (verts G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u p v. \<lbrakk>awalk u p v; distinct (awalk_verts u p)\<rbrakk> \<Longrightarrow> length p \<le> card (verts G)
[PROOF STEP]
by (rule length_apath) (auto simp: apath_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>awalk ?u ?p ?v; distinct (awalk_verts ?u ?p)\<rbrakk> \<Longrightarrow> length ?p \<le> card (verts G)

goal (1 subgoal):
 1. finite {(u, p, v). apath u p v}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>awalk ?u ?p ?v; distinct (awalk_verts ?u ?p)\<rbrakk> \<Longrightarrow> length ?p \<le> card (verts G)
[PROOF STEP]
have "{(u,p,v). apath u p v} \<subseteq> verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>awalk ?u ?p ?v; distinct (awalk_verts ?u ?p)\<rbrakk> \<Longrightarrow> length ?p \<le> card (verts G)

goal (1 subgoal):
 1. {(u, p, v). apath u p v} \<subseteq> verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G
[PROOF STEP]
by (auto simp: apath_def)
[PROOF STATE]
proof (state)
this:
{(u, p, v). apath u p v} \<subseteq> verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G

goal (1 subgoal):
 1. finite {(u, p, v). apath u p v}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{(u, p, v). apath u p v} \<subseteq> verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G

goal (1 subgoal):
 1. finite {(u, p, v). apath u p v}
[PROOF STEP]
have "finite ..."
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G)
[PROOF STEP]
using finite_verts finite_arcs
[PROOF STATE]
proof (prove)
using this:
finite (verts G)
finite (arcs G)

goal (1 subgoal):
 1. finite (verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G)
[PROOF STEP]
by (intro finite_cartesian_product finite_lists_length_le)
[PROOF STATE]
proof (state)
this:
finite (verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G)

goal (1 subgoal):
 1. finite {(u, p, v). apath u p v}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{(u, p, v). apath u p v} \<subseteq> verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G
finite (verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{(u, p, v). apath u p v} \<subseteq> verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G
finite (verts G \<times> {es. set es \<subseteq> arcs G \<and> length es \<le> card (verts G)} \<times> verts G)

goal (1 subgoal):
 1. finite {(u, p, v). apath u p v}
[PROOF STEP]
by (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite {(u, p, v). apath u p v}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in fixed_carrier_mat) sum_mat_empty[simp]:
  shows "sum_mat A {} = 0\<^sub>m dimR dimC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
unfolding sum_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_with (+) (0\<^sub>m dimR dimC) A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
by simp


[STATEMENT]
lemma finite_enum_ext:
  assumes "\<And>i. i < card X \<Longrightarrow> enumerate X i = enumerate Y i" and "finite X" "finite Y" "card X = card Y"
  shows "X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y
[PROOF STEP]
by (intro antisym finite_enum_subset) (auto simp: assms)


[STATEMENT]
lemma joinTree_cases_ldeep: "left_deep t
    \<Longrightarrow> (\<exists>r. t=(Relation r)) \<or> (\<exists>l rr. t=(Join l (Relation rr)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_deep t \<Longrightarrow> (\<exists>r. t = Relation r) \<or> (\<exists>l rr. t = Join l (Relation rr))
[PROOF STEP]
apply(cases t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x1. \<lbrakk>left_deep t; t = Relation x1\<rbrakk> \<Longrightarrow> (\<exists>r. t = Relation r) \<or> (\<exists>l rr. t = Join l (Relation rr))
 2. \<And>x21 x22. \<lbrakk>left_deep t; t = Join x21 x22\<rbrakk> \<Longrightarrow> (\<exists>r. t = Relation r) \<or> (\<exists>l rr. t = Join l (Relation rr))
[PROOF STEP]
apply(auto)[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>left_deep (Join x21 x22); t = Join x21 x22\<rbrakk> \<Longrightarrow> \<exists>rr. x22 = Relation rr
[PROOF STEP]
using joinTree_cases
[PROOF STATE]
proof (prove)
using this:
(\<exists>r. ?t = Relation r) \<or> (\<exists>l rr. ?t = Join l (Relation rr)) \<or> (\<exists>l lr rr. ?t = Join l (Join lr rr))

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>left_deep (Join x21 x22); t = Join x21 x22\<rbrakk> \<Longrightarrow> \<exists>rr. x22 = Relation rr
[PROOF STEP]
by fastforce


[STATEMENT]
lemma mem_frontier_diff':
  assumes "t \<in>\<^sub>A frontier N - frontier M"
  shows   "zcount (frontier_changes M N) t = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
note assms
[PROOF STATE]
proof (state)
this:
t \<in>\<^sub>A frontier N - frontier M

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in>\<^sub>A frontier N - frontier M
[PROOF STEP]
have t: "t \<in>\<^sub>A frontier N" "t \<notin>\<^sub>A frontier M"
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>A frontier N - frontier M

goal (1 subgoal):
 1. t \<in>\<^sub>A frontier N &&& t \<notin>\<^sub>A frontier M
[PROOF STEP]
using ac_Diff_iff
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>A frontier N - frontier M
(?c \<in>\<^sub>A ?A - ?B) = (?c \<in>\<^sub>A ?A \<and> ?c \<notin>\<^sub>A ?B)

goal (1 subgoal):
 1. t \<in>\<^sub>A frontier N &&& t \<notin>\<^sub>A frontier M
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
t \<in>\<^sub>A frontier N
t \<notin>\<^sub>A frontier M

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
from t(2)
[PROOF STATE]
proof (chain)
picking this:
t \<notin>\<^sub>A frontier M
[PROOF STEP]
have "zcount (zmset_frontier M) t = 0"
[PROOF STATE]
proof (prove)
using this:
t \<notin>\<^sub>A frontier M

goal (1 subgoal):
 1. zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 0
[PROOF STEP]
by (simp add: member_antichain.rep_eq)
[PROOF STATE]
proof (state)
this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 0

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 0

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
from t(1)
[PROOF STATE]
proof (chain)
picking this:
t \<in>\<^sub>A frontier N
[PROOF STEP]
have "zcount (zmset_frontier N) t = 1"
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>A frontier N

goal (1 subgoal):
 1. zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 1
[PROOF STEP]
by (simp add: member_antichain.rep_eq)
[PROOF STATE]
proof (state)
this:
zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 1

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 0
zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 1
[PROOF STEP]
show "zcount (frontier_changes M N) t = -1"
[PROOF STATE]
proof (prove)
using this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 0
zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 1

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
zcount (frontier_changes M N) t = - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dividesD:
  fixes G (structure)
  assumes "a divides b"
  shows "\<exists>c\<in>carrier G. b = a \<otimes> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c\<in>carrier G. b = a \<otimes> c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a divides b

goal (1 subgoal):
 1. \<exists>c\<in>carrier G. b = a \<otimes> c
[PROOF STEP]
unfolding factor_def
[PROOF STATE]
proof (prove)
using this:
\<exists>c\<in>carrier G. b = a \<otimes> c

goal (1 subgoal):
 1. \<exists>c\<in>carrier G. b = a \<otimes> c
[PROOF STEP]
by fast


[STATEMENT]
lemma d_fixpoint:
  "(\<exists>y . x = d(y)) \<longleftrightarrow> x = d(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. x = d y) = (x = d x)
[PROOF STEP]
using d_involutive
[PROOF STATE]
proof (prove)
using this:
d (d ?x) = d ?x

goal (1 subgoal):
 1. (\<exists>y. x = d y) = (x = d x)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_iterator_key_filter_foldli_conv :
  "map_iterator_key_filter P (foldli kvs) =  foldli (filter (\<lambda>(k, v). P k) kvs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_iterator_key_filter P (foldli kvs) = foldli (filter (\<lambda>(k, v). P k) kvs)
[PROOF STEP]
unfolding map_iterator_key_filter_def set_iterator_filter_foldli_conv o_def split_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldli (filter (\<lambda>x. P (fst x)) kvs) = foldli (filter (\<lambda>p. P (fst p)) kvs)
[PROOF STEP]
by simp


[STATEMENT]
lemma zip_fill1:
  assumes "length ss < length ts"
  shows "zip_fill ss ts = zip (map Some ss) (map Some (take (length ss) ts)) @
    map (\<lambda> x. (None, Some x)) (drop (length ss) ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip_fill ss ts = zip (map Some ss) (map Some (take (length ss) ts)) @ map (\<lambda>x. (None, Some x)) (drop (length ss) ts)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length ss < length ts

goal (1 subgoal):
 1. zip_fill ss ts = zip (map Some ss) (map Some (take (length ss) ts)) @ map (\<lambda>x. (None, Some x)) (drop (length ss) ts)
[PROOF STEP]
by (auto simp: zip_fill_def list_eq_iff_nth_eq nth_append simp add: min.absorb2)


[STATEMENT]
theorem cesaro_imp_density_one:
  assumes "\<And>n. u n \<ge> (0::real)" "(\<lambda>n. (\<Sum>i<n. u i)/n) \<longlonglongrightarrow> 0"
  shows "\<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicator A n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
define B where "B = (\<lambda>e. {n. u n \<ge> e})"
[PROOF STATE]
proof (state)
this:
B = (\<lambda>e. {n. e \<le> u n})

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
text \<open>$B e$ is the set of bad times where $u_n \geq e$. It has density $0$ thanks to
  the assumption of Cesaro convergence to $0$.\<close>
[PROOF STATE]
proof (state)
this:
B = (\<lambda>e. {n. e \<le> u n})

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
have A: "upper_asymptotic_density (B e) = 0" if "e > 0" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density (B e) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. upper_asymptotic_density (B e) = 0
[PROOF STEP]
have *: "card (B e \<inter> {..<n}) / n \<le> (1/e) * ((\<Sum>i\<in>{..<n}. u i)/n)" if "n \<ge> 1" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
have "e * card (B e \<inter> {..<n}) = (\<Sum>i\<in>B e \<inter> {..<n}. e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e * real (card (B e \<inter> {..<n})) = (\<Sum>i\<in>B e \<inter> {..<n}. e)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
e * real (card (B e \<inter> {..<n})) = (\<Sum>i\<in>B e \<inter> {..<n}. e)

goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
e * real (card (B e \<inter> {..<n})) = (\<Sum>i\<in>B e \<inter> {..<n}. e)

goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>B e \<inter> {..<n}. u i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>B e \<inter> {..<n}. e) \<le> sum u (B e \<inter> {..<n})
[PROOF STEP]
apply (rule sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> B e \<inter> {..<n} \<Longrightarrow> e \<le> u i
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {n. e \<le> u n} \<inter> {..<n} \<Longrightarrow> e \<le> u i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B e \<inter> {..<n}. e) \<le> sum u (B e \<inter> {..<n})

goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B e \<inter> {..<n}. e) \<le> sum u (B e \<inter> {..<n})

goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>{..<n}. u i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u (B e \<inter> {..<n}) \<le> sum u {..<n}
[PROOF STEP]
apply (rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {..<n}
 2. B e \<inter> {..<n} \<subseteq> {..<n}
 3. \<And>b. b \<in> {..<n} - B e \<inter> {..<n} \<Longrightarrow> 0 \<le> u b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> u ?n
(\<lambda>n. sum u {..<n} / real n) \<longlonglongrightarrow> 0

goal (3 subgoals):
 1. finite {..<n}
 2. B e \<inter> {..<n} \<subseteq> {..<n}
 3. \<And>b. b \<in> {..<n} - B e \<inter> {..<n} \<Longrightarrow> 0 \<le> u b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum u (B e \<inter> {..<n}) \<le> sum u {..<n}

goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
e * real (card (B e \<inter> {..<n})) \<le> sum u {..<n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
e * real (card (B e \<inter> {..<n})) \<le> sum u {..<n}

goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
using \<open>e > 0\<close> \<open>n \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
e * real (card (B e \<inter> {..<n})) \<le> sum u {..<n}
0 < e
1 \<le> n

goal (1 subgoal):
 1. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
by (auto simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 \<le> ?n \<Longrightarrow> real (card (B e \<inter> {..<?n})) / real ?n \<le> 1 / e * (sum u {..<?n} / real ?n)

goal (1 subgoal):
 1. upper_asymptotic_density (B e) = 0
[PROOF STEP]
have "(\<lambda>n. card (B e \<inter> {..<n}) / n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real (card (B e \<inter> {..<n})) / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (rule tendsto_sandwich[of "\<lambda>_. 0" _ _ "\<lambda>n. (1/e) * ((\<Sum>i\<in>{..<n}. u i)/n)"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> real (card (B e \<inter> {..<n})) / real n
 2. \<forall>\<^sub>F n in sequentially. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
 3. (\<lambda>_. 0) \<longlonglongrightarrow> 0
 4. (\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. (1/e) * ((\<Sum>i\<in>{..<n}. u i)/n)) \<longlonglongrightarrow> (1/e) * 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 1 / e * 0
[PROOF STEP]
by (intro tendsto_intros assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 1 / e * 0

goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> real (card (B e \<inter> {..<n})) / real n
 2. \<forall>\<^sub>F n in sequentially. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
 3. (\<lambda>_. 0) \<longlonglongrightarrow> 0
 4. (\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 1 / e * 0
[PROOF STEP]
show "(\<lambda>n. (1/e) * ((\<Sum>i\<in>{..<n}. u i)/n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 1 / e * 0

goal (1 subgoal):
 1. (\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 / e * (sum u {..<n} / real n)) \<longlonglongrightarrow> 0

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> real (card (B e \<inter> {..<n})) / real n
 2. \<forall>\<^sub>F n in sequentially. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
 3. (\<lambda>_. 0) \<longlonglongrightarrow> 0
[PROOF STEP]
show "\<forall>\<^sub>F n in sequentially. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
1 \<le> ?n \<Longrightarrow> real (card (B e \<inter> {..<?n})) / real ?n \<le> 1 / e * (sum u {..<?n} / real ?n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
1 \<le> ?n \<Longrightarrow> real (card (B e \<inter> {..<?n})) / real ?n \<le> 1 / e * (sum u {..<?n} / real ?n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real (card (B e \<inter> {..<n})) / real n \<le> 1 / e * (sum u {..<n} / real n)

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> real (card (B e \<inter> {..<n})) / real n
 2. (\<lambda>_. 0) \<longlonglongrightarrow> 0
[PROOF STEP]
qed (auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real (card (B e \<inter> {..<n})) / real n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. upper_asymptotic_density (B e) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real (card (B e \<inter> {..<n})) / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (card (B e \<inter> {..<n})) / real n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. upper_asymptotic_density (B e) = 0
[PROOF STEP]
by (rule upper_asymptotic_density_lim)
[PROOF STATE]
proof (state)
this:
upper_asymptotic_density (B e) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> upper_asymptotic_density (B ?e) = 0

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
define C where "C = (\<lambda>n::nat. UNIV - B (((1::real)/2)^n))"
[PROOF STATE]
proof (state)
this:
C = (\<lambda>n. UNIV - B ((1 / 2) ^ n))

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
have "lower_asymptotic_density (C n) = 1" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_asymptotic_density (C n) = 1
[PROOF STEP]
unfolding C_def lower_upper_asymptotic_density_complement
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - upper_asymptotic_density (UNIV - (UNIV - B ((1 / 2) ^ n))) = 1
[PROOF STEP]
by (auto intro!: A)
[PROOF STATE]
proof (state)
this:
lower_asymptotic_density (C ?n) = 1

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lower_asymptotic_density (C ?n) = 1
[PROOF STEP]
obtain A where A: "lower_asymptotic_density A = 1" "\<And>n. \<exists>N. A \<inter> {N..} \<subseteq> C n"
[PROOF STATE]
proof (prove)
using this:
lower_asymptotic_density (C ?n) = 1

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>lower_asymptotic_density A = 1; \<And>n. \<exists>N. A \<inter> {N..} \<subseteq> C n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lower_asymptotic_density_one_Inter
[PROOF STATE]
proof (prove)
using this:
lower_asymptotic_density (C ?n) = 1
(\<And>n. lower_asymptotic_density (?A n) = 1) \<Longrightarrow> \<exists>B. lower_asymptotic_density B = 1 \<and> (\<forall>n. \<exists>N. B \<inter> {N..} \<subseteq> ?A n)

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>lower_asymptotic_density A = 1; \<And>n. \<exists>N. A \<inter> {N..} \<subseteq> C n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
lower_asymptotic_density A = 1
\<exists>N. A \<inter> {N..} \<subseteq> C ?n

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
have E: "eventually (\<lambda>n. u n * indicator A n < e) sequentially" if "e > 0" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e
[PROOF STEP]
have "eventually (\<lambda>n. ((1::real)/2)^n < e) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (1 / 2) ^ n < e
[PROOF STEP]
by (rule order_tendstoD[OF _ \<open>e > 0\<close>], intro tendsto_intros, auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (1 / 2) ^ n < e

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. (1 / 2) ^ n < e
[PROOF STEP]
obtain n where n: "((1::real)/2)^n < e"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (1 / 2) ^ n < e

goal (1 subgoal):
 1. (\<And>n. (1 / 2) ^ n < e \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. (1 / 2) ^ n < e

goal (1 subgoal):
 1. (\<And>n. (1 / 2) ^ n < e \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ n < e

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e
[PROOF STEP]
obtain N where N: "A \<inter> {N..} \<subseteq> C n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. A \<inter> {N..} \<subseteq> C n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using A(2)
[PROOF STATE]
proof (prove)
using this:
\<exists>N. A \<inter> {N..} \<subseteq> C ?n

goal (1 subgoal):
 1. (\<And>N. A \<inter> {N..} \<subseteq> C n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<inter> {N..} \<subseteq> C n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e
[PROOF STEP]
have "u k * indicator A k < e" if "k \<ge> N" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u k * indicat_real A k < e
[PROOF STEP]
proof (cases "k \<in> A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k \<in> A \<Longrightarrow> u k * indicat_real A k < e
 2. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k \<in> A

goal (2 subgoals):
 1. k \<in> A \<Longrightarrow> u k * indicat_real A k < e
 2. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<in> A
[PROOF STEP]
have "k \<in> C n"
[PROOF STATE]
proof (prove)
using this:
k \<in> A

goal (1 subgoal):
 1. k \<in> C n
[PROOF STEP]
using N that
[PROOF STATE]
proof (prove)
using this:
k \<in> A
A \<inter> {N..} \<subseteq> C n
N \<le> k

goal (1 subgoal):
 1. k \<in> C n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<in> C n

goal (2 subgoals):
 1. k \<in> A \<Longrightarrow> u k * indicat_real A k < e
 2. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<in> C n
[PROOF STEP]
have "u k < ((1::real)/2)^n"
[PROOF STATE]
proof (prove)
using this:
k \<in> C n

goal (1 subgoal):
 1. u k < (1 / 2) ^ n
[PROOF STEP]
unfolding C_def B_def
[PROOF STATE]
proof (prove)
using this:
k \<in> UNIV - {na. (1 / 2) ^ n \<le> u na}

goal (1 subgoal):
 1. u k < (1 / 2) ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u k < (1 / 2) ^ n

goal (2 subgoals):
 1. k \<in> A \<Longrightarrow> u k * indicat_real A k < e
 2. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u k < (1 / 2) ^ n
[PROOF STEP]
have "u k < e"
[PROOF STATE]
proof (prove)
using this:
u k < (1 / 2) ^ n

goal (1 subgoal):
 1. u k < e
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
u k < (1 / 2) ^ n
(1 / 2) ^ n < e

goal (1 subgoal):
 1. u k < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u k < e

goal (2 subgoals):
 1. k \<in> A \<Longrightarrow> u k * indicat_real A k < e
 2. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u k < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u k < e

goal (1 subgoal):
 1. u k * indicat_real A k < e
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
using this:
u k < e

goal (1 subgoal):
 1. u k * of_bool (k \<in> A) < e
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
u k < e
k \<in> A

goal (1 subgoal):
 1. u k * of_bool (k \<in> A) < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u k * indicat_real A k < e

goal (1 subgoal):
 1. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
k \<notin> A

goal (1 subgoal):
 1. k \<notin> A \<Longrightarrow> u k * indicat_real A k < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<notin> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<notin> A

goal (1 subgoal):
 1. u k * indicat_real A k < e
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
using this:
k \<notin> A

goal (1 subgoal):
 1. u k * of_bool (k \<in> A) < e
[PROOF STEP]
using \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
k \<notin> A
0 < e

goal (1 subgoal):
 1. u k * of_bool (k \<in> A) < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u k * indicat_real A k < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
N \<le> ?k \<Longrightarrow> u ?k * indicat_real A ?k < e

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> ?k \<Longrightarrow> u ?k * indicat_real A ?k < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
N \<le> ?k \<Longrightarrow> u ?k * indicat_real A ?k < e

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
N \<le> ?k \<Longrightarrow> u ?k * indicat_real A ?k < e

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. u n * indicat_real A n < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n * indicat_real A n < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<forall>\<^sub>F n in sequentially. u n * indicat_real A n < ?e

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. u n * indicator A n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule order_tendstoI[OF _ E])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < u x * indicat_real A x
 2. \<And>a. 0 < a \<Longrightarrow> 0 < a
[PROOF STEP]
unfolding indicator_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < u x * of_bool (x \<in> A)
 2. \<And>a. 0 < a \<Longrightarrow> 0 < a
[PROOF STEP]
using \<open>\<And>n. u n \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> u ?n

goal (2 subgoals):
 1. \<And>a. a < 0 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. a < u x * of_bool (x \<in> A)
 2. \<And>a. 0 < a \<Longrightarrow> 0 < a
[PROOF STEP]
by (simp add: less_le_trans)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
using \<open>lower_asymptotic_density A = 1\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
lower_asymptotic_density A = 1

goal (1 subgoal):
 1. \<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>A. lower_asymptotic_density A = 1 \<and> (\<lambda>n. u n * indicat_real A n) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_real_poly:
  "normalize p = smult (1/lead_coeff p) (p::real poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize p = smult (1 / lead_coeff p) p
[PROOF STEP]
unfolding normalize_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p div [:unit_factor (lead_coeff p):] = smult (1 / lead_coeff p) p
[PROOF STEP]
by (smt (z3) div_unit_factor normalize_eq_0_iff normalize_poly_def
      normalize_unit_factor smult_eq_0_iff smult_eq_iff
      smult_normalize_field_eq unit_factor_1)


[STATEMENT]
lemma subcocycle_avg_add:
  assumes "subcocycle u" "subcocycle v" "subcocycle_avg_ereal u > - \<infinity>" "subcocycle_avg_ereal v > - \<infinity>"
  shows "subcocycle_avg_ereal (\<lambda>n x. u n x + v n x) > -\<infinity>"
        "subcocycle_avg (\<lambda>n x. u n x + v n x) = subcocycle_avg u + subcocycle_avg v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> < subcocycle_avg_ereal (\<lambda>n x. u n x + v n x) &&& subcocycle_avg (\<lambda>n x. u n x + v n x) = subcocycle_avg u + subcocycle_avg v
[PROOF STEP]
using assms subcocycle_avg_finite real_of_ereal_add
[PROOF STATE]
proof (prove)
using this:
subcocycle u
subcocycle v
- \<infinity> < subcocycle_avg_ereal u
- \<infinity> < subcocycle_avg_ereal v
subcocycle_avg_ereal ?u < \<infinity>
real_of_ereal (?a + ?b) = (if \<bar>?a\<bar> = \<infinity> \<and> \<bar>?b\<bar> = \<infinity> \<or> \<bar>?a\<bar> \<noteq> \<infinity> \<and> \<bar>?b\<bar> \<noteq> \<infinity> then real_of_ereal ?a + real_of_ereal ?b else 0)

goal (1 subgoal):
 1. - \<infinity> < subcocycle_avg_ereal (\<lambda>n x. u n x + v n x) &&& subcocycle_avg (\<lambda>n x. u n x + v n x) = subcocycle_avg u + subcocycle_avg v
[PROOF STEP]
unfolding subcocycle_avg_def subcocycle_avg_ereal_add[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
subcocycle u
subcocycle v
- \<infinity> < subcocycle_avg_ereal u
- \<infinity> < subcocycle_avg_ereal v
subcocycle_avg_ereal ?u < \<infinity>
real_of_ereal (?a + ?b) = (if \<bar>?a\<bar> = \<infinity> \<and> \<bar>?b\<bar> = \<infinity> \<or> \<bar>?a\<bar> \<noteq> \<infinity> \<and> \<bar>?b\<bar> \<noteq> \<infinity> then real_of_ereal ?a + real_of_ereal ?b else 0)

goal (1 subgoal):
 1. - \<infinity> < subcocycle_avg_ereal u + subcocycle_avg_ereal v &&& real_of_ereal (subcocycle_avg_ereal u + subcocycle_avg_ereal v) = real_of_ereal (subcocycle_avg_ereal u) + real_of_ereal (subcocycle_avg_ereal v)
[PROOF STEP]
by auto


[STATEMENT]
lemma parAssoc:
  fixes P :: pi
  and   Q :: pi
  and   R :: pi

  shows "(P \<parallel> Q) \<parallel> R \<sim>\<^sup>s P \<parallel> (Q \<parallel> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<parallel> Q) \<parallel> R \<sim>\<^sup>s P \<parallel> Q \<parallel> R
[PROOF STEP]
by(force simp add: substClosed_def intro: Strong_Late_Bisim_SC.parAssoc)


[STATEMENT]
lemma swapidseq_ext_of_permutation:
  assumes "p permutes S" and "finite S" shows "\<exists>n. swapidseq_ext S n p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. swapidseq_ext S n p
[PROOF STEP]
using cycle_decomp_imp_swapidseq_ext[OF cycle_decomposition[OF assms]]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. swapidseq_ext S n p

goal (1 subgoal):
 1. \<exists>n. swapidseq_ext S n p
[PROOF STEP]
.


[STATEMENT]
lemma (in abelian_group) a_l_coset_carrier:
     "[| y \<in> x <+ H;  x \<in> carrier G;  subgroup H (add_monoid G) |] ==> y \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> x <+ H; x \<in> carrier G; subgroup H (add_monoid G)\<rbrakk> \<Longrightarrow> y \<in> carrier G
[PROOF STEP]
by (rule group.l_coset_carrier [OF a_group,
    folded a_l_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma iMin_the2: "iMin I = (THE x. x \<in> I \<and> (\<forall>y\<in>I. x \<le> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iMin I = (THE x. x \<in> I \<and> (\<forall>y\<in>I. x \<le> y))
[PROOF STEP]
apply (simp add: iMin_the)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE x. x \<in> I \<and> (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)) = (THE x. x \<in> I \<and> (\<forall>y\<in>I. x \<le> y))
[PROOF STEP]
apply (subgoal_tac "\<And>x. (\<forall>y \<in> I. x \<le> y) = (\<forall>y. y \<in> I \<longrightarrow> x \<le> y) ")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>x. (\<forall>y\<in>I. x \<le> y) = (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)) \<Longrightarrow> (THE x. x \<in> I \<and> (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)) = (THE x. x \<in> I \<and> (\<forall>y\<in>I. x \<le> y))
 2. \<And>x. (\<forall>y\<in>I. x \<le> y) = (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. (\<forall>y\<in>I. x \<le> y) = (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)
 2. (\<And>x. (\<forall>y\<in>I. x \<le> y) = (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)) \<Longrightarrow> (THE x. x \<in> I \<and> (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)) = (THE x. x \<in> I \<and> (\<forall>y\<in>I. x \<le> y))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. (\<forall>y\<in>I. x \<le> y) = (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)) \<Longrightarrow> (THE x. x \<in> I \<and> (\<forall>y. y \<in> I \<longrightarrow> x \<le> y)) = (THE x. x \<in> I \<and> (\<forall>y\<in>I. x \<le> y))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma splitDigit_list: "splitDigit p i d = (l,n,r) \<Longrightarrow>
  (digitToList d) = (nlistToList l) @ (nodeToList n) @ (nlistToList r)
  \<and> length l \<le> 4 \<and> length r \<le> 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. splitDigit p i d = (l, n, r) \<Longrightarrow> digitToList d = nlistToList l @ nodeToList n @ nlistToList r \<and> length l \<le> 4 \<and> length r \<le> 4
[PROOF STEP]
apply (unfold splitDigit_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. splitNlist p i (digitToNlist d) = (l, n, r) \<Longrightarrow> digitToList d = nlistToList l @ nodeToList n @ nlistToList r \<and> length l \<le> 4 \<and> length r \<le> 4
[PROOF STEP]
apply (cases d)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x1. \<lbrakk>splitNlist p i (digitToNlist d) = (l, n, r); d = One x1\<rbrakk> \<Longrightarrow> digitToList d = nlistToList l @ nodeToList n @ nlistToList r \<and> length l \<le> 4 \<and> length r \<le> 4
 2. \<And>x21 x22. \<lbrakk>splitNlist p i (digitToNlist d) = (l, n, r); d = Two x21 x22\<rbrakk> \<Longrightarrow> digitToList d = nlistToList l @ nodeToList n @ nlistToList r \<and> length l \<le> 4 \<and> length r \<le> 4
 3. \<And>x31 x32 x33. \<lbrakk>splitNlist p i (digitToNlist d) = (l, n, r); d = Three x31 x32 x33\<rbrakk> \<Longrightarrow> digitToList d = nlistToList l @ nodeToList n @ nlistToList r \<and> length l \<le> 4 \<and> length r \<le> 4
 4. \<And>x41 x42 x43 x44. \<lbrakk>splitNlist p i (digitToNlist d) = (l, n, r); d = Four x41 x42 x43 x44\<rbrakk> \<Longrightarrow> digitToList d = nlistToList l @ nodeToList n @ nlistToList r \<and> length l \<le> 4 \<and> length r \<le> 4
[PROOF STEP]
apply (auto split: if_split_asm simp add: Let_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma multiplicity_times_unit_right:
  assumes "is_unit c"
  shows   "multiplicity p (c * x) = multiplicity p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (c * x) = multiplicity p x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. multiplicity p (c * x) = multiplicity p x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_unit c
[PROOF STEP]
have "{n. p ^ n dvd c * x} = {n. p ^ n dvd x}"
[PROOF STATE]
proof (prove)
using this:
is_unit c

goal (1 subgoal):
 1. {n. p ^ n dvd c * x} = {n. p ^ n dvd x}
[PROOF STEP]
by (subst mult.commute) (simp add: dvd_mult_unit_iff)
[PROOF STATE]
proof (state)
this:
{n. p ^ n dvd c * x} = {n. p ^ n dvd x}

goal (1 subgoal):
 1. multiplicity p (c * x) = multiplicity p x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{n. p ^ n dvd c * x} = {n. p ^ n dvd x}

goal (1 subgoal):
 1. multiplicity p (c * x) = multiplicity p x
[PROOF STEP]
by (simp add: multiplicity_def)
[PROOF STATE]
proof (state)
this:
multiplicity p (c * x) = multiplicity p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_to_mpoly0: "poly_to_mpoly v 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_to_mpoly v 0 = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_to_mpoly v 0 = 0
[PROOF STEP]
have "\<And>m. (Polynomial.coeff 0 (Poly_Mapping.lookup m v) when Poly_Mapping.keys m \<subseteq> {v}) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. (poly.coeff 0 (lookup m v) when keys m \<subseteq> {v}) = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(poly.coeff 0 (lookup ?m v) when keys ?m \<subseteq> {v}) = (0::?'b1)

goal (1 subgoal):
 1. poly_to_mpoly v 0 = 0
[PROOF STEP]
have "Abs_poly_mapping (\<lambda>m. Polynomial.coeff 0 (Poly_Mapping.lookup m v) when Poly_Mapping.keys m \<subseteq> {v}) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_poly_mapping (\<lambda>m. poly.coeff 0 (lookup m v) when keys m \<subseteq> {v}) = 0
[PROOF STEP]
apply (rule Poly_Mapping.poly_mapping_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. lookup (Abs_poly_mapping (\<lambda>m. poly.coeff 0 (lookup m v) when keys m \<subseteq> {v})) k = lookup 0 k
[PROOF STEP]
unfolding lookup_Abs_poly_mapping[OF poly_to_mpoly_finite]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. (poly.coeff 0 (lookup k v) when keys k \<subseteq> {v}) = lookup 0 k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Abs_poly_mapping (\<lambda>m. poly.coeff 0 (lookup m v) when keys m \<subseteq> {v}) = 0

goal (1 subgoal):
 1. poly_to_mpoly v 0 = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Abs_poly_mapping (\<lambda>m. poly.coeff 0 (lookup m v) when keys m \<subseteq> {v}) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Abs_poly_mapping (\<lambda>m. poly.coeff 0 (lookup m v) when keys m \<subseteq> {v}) = 0

goal (1 subgoal):
 1. poly_to_mpoly v 0 = 0
[PROOF STEP]
using poly_to_mpoly_def zero_mpoly.abs_eq
[PROOF STATE]
proof (prove)
using this:
Abs_poly_mapping (\<lambda>m. poly.coeff 0 (lookup m v) when keys m \<subseteq> {v}) = 0
poly_to_mpoly ?v ?p = MPoly (Abs_poly_mapping (\<lambda>m. poly.coeff ?p (lookup m ?v) when keys m \<subseteq> {?v}))
0 = MPoly 0

goal (1 subgoal):
 1. poly_to_mpoly v 0 = 0
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
poly_to_mpoly v 0 = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma foldr_length_helper :
  assumes "length xs = length ys"
  shows "foldr (\<lambda>_ x . f x) xs b = foldr (\<lambda>a x . f x) ys b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>_. f) xs b = foldr (\<lambda>a. f) ys b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys

goal (1 subgoal):
 1. foldr (\<lambda>_. f) xs b = foldr (\<lambda>a. f) ys b
[PROOF STEP]
by (induction xs ys rule: list_induct2; auto)


[STATEMENT]
lemma map_unfold_tree [simp]: fixes l r x
 defines "unf \<equiv> unfold_tree (\<lambda>f. f x) (\<lambda>f. f \<circ> l) (\<lambda>f. f \<circ> r)"
 shows "map_tree G (unf F) = unf (G \<circ> F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_tree G (unf F) = unf (G \<circ> F)
[PROOF STEP]
by(coinduction arbitrary: F G)(auto 4 3 simp add: unf_def o_assoc)


[STATEMENT]
lemma ctermsl_stermsl_or_dtermsl:
  assumes "q \<in> ctermsl p"
    shows "q \<in> stermsl p \<or> (\<exists>p'\<in>dtermsl p. q \<in> ctermsl p')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<in> stermsl p \<or> (\<exists>p'\<in>dtermsl p. q \<in> ctermsl p')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
q \<in> ctermsl p

goal (1 subgoal):
 1. q \<in> stermsl p \<or> (\<exists>p'\<in>dtermsl p. q \<in> ctermsl p')
[PROOF STEP]
by (induct p) (auto dest: ctermsl_ex_stermsl)


[STATEMENT]
lemma trm_induct[case_names Var Fn, induct type: trm]:
assumes "\<And> x. \<phi> (Var x)"
and "\<And> f Tl. list_all \<phi> Tl \<Longrightarrow> \<phi> (Fn f Tl)"
shows "\<phi> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<phi> (Var ?x)
list_all \<phi> ?Tl \<Longrightarrow> \<phi> (Fn ?f ?Tl)

goal (1 subgoal):
 1. \<phi> T
[PROOF STEP]
unfolding list_all_iff
[PROOF STATE]
proof (prove)
using this:
\<phi> (Var ?x)
Ball (set ?Tl) \<phi> \<Longrightarrow> \<phi> (Fn ?f ?Tl)

goal (1 subgoal):
 1. \<phi> T
[PROOF STEP]
by (rule trm.induct) metis


[STATEMENT]
lemma strict_monoI_Suc:
  assumes ord [simp]: "(\<And>n. f n < f (Suc n))" shows "strict_mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono f
[PROOF STEP]
unfolding strict_mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> f x < f y
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
fix n m :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
assume "n < m"
[PROOF STATE]
proof (state)
this:
n < m

goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n < m
[PROOF STEP]
show "f n < f m"
[PROOF STATE]
proof (prove)
using this:
n < m

goal (1 subgoal):
 1. f n < f m
[PROOF STEP]
by (induct m) (auto simp: less_Suc_eq intro: less_trans ord)
[PROOF STATE]
proof (state)
this:
f n < f m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma injective_codomain:
  assumes "injective x"
  shows "x * (x \<sqinter> 1) = x \<sqinter> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (x \<sqinter> (1::'a)) = x \<sqinter> (1::'a)
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x * (x \<sqinter> (1::'a)) \<le> x \<sqinter> (1::'a)
 2. x \<sqinter> (1::'a) \<le> x * (x \<sqinter> (1::'a))
[PROOF STEP]
show "x * (x \<sqinter> 1) \<le> x \<sqinter> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (x \<sqinter> (1::'a)) \<le> x \<sqinter> (1::'a)
[PROOF STEP]
by (metis assms comp_right_one dual_order.trans inf.boundedI inf.cobounded1 inf.sup_monoid.add_commute mult_right_isotone one_inf_conv)
[PROOF STATE]
proof (state)
this:
x * (x \<sqinter> (1::'a)) \<le> x \<sqinter> (1::'a)

goal (1 subgoal):
 1. x \<sqinter> (1::'a) \<le> x * (x \<sqinter> (1::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> (1::'a) \<le> x * (x \<sqinter> (1::'a))
[PROOF STEP]
show "x \<sqinter> 1 \<le> x * (x \<sqinter> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (1::'a) \<le> x * (x \<sqinter> (1::'a))
[PROOF STEP]
by (metis coreflexive_idempotent inf.cobounded1 inf.cobounded2 mult_left_isotone)
[PROOF STATE]
proof (state)
this:
x \<sqinter> (1::'a) \<le> x * (x \<sqinter> (1::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lambert_W_eq_0_iff [simp]: "Lambert_W x = 0 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Lambert_W x = 0) = (x = 0)
[PROOF STEP]
using Lambert_W_eq_iff[of x 0]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- exp (- 1) \<le> x; - exp (- 1) \<le> 0\<rbrakk> \<Longrightarrow> (Lambert_W x = Lambert_W 0) = (x = 0)

goal (1 subgoal):
 1. (Lambert_W x = 0) = (x = 0)
[PROOF STEP]
by (cases "x \<ge> -exp (-1)") (auto simp: Lambert_W_le_minus_one simp del: Lambert_W_eq_iff)


[STATEMENT]
lemma exhaust_4:
  fixes x :: 4
  shows "x = 1 \<or> x = 2 \<or> x = 3 \<or> x = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = 1 \<or> x = 2 \<or> x = 3 \<or> x = 4
[PROOF STEP]
proof (induct x)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
case (of_int z)
[PROOF STATE]
proof (state)
this:
0 \<le> z
z < int CARD(4)

goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> z
z < int CARD(4)
[PROOF STEP]
have "0 \<le> z" and "z < 4"
[PROOF STATE]
proof (prove)
using this:
0 \<le> z
z < int CARD(4)

goal (1 subgoal):
 1. 0 \<le> z &&& z < 4
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 \<le> z
z < 4

goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> z
z < 4
[PROOF STEP]
have "z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3"
[PROOF STATE]
proof (prove)
using this:
0 \<le> z
z < 4

goal (1 subgoal):
 1. z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3

goal (1 subgoal):
 1. \<And>z. \<lbrakk>0 \<le> z; z < int CARD(4)\<rbrakk> \<Longrightarrow> of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z = 0 \<or> z = 1 \<or> z = 2 \<or> z = 3

goal (1 subgoal):
 1. of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_int z = 1 \<or> of_int z = 2 \<or> of_int z = 3 \<or> of_int z = 4

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_seg_drop:
  "\<Union>(set (drop i p)) = path_seg p i (length p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set (drop i p)) = path_seg p i (length p)
[PROOF STEP]
unfolding path_seg_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set (drop i p)) = \<Union> {p ! k |k. i \<le> k \<and> k < length p}
[PROOF STEP]
by (fastforce simp: in_set_drop_conv_nth Bex_def)


[STATEMENT]
lemma (in sigma_algebra) countable_UN':
  fixes A :: "'i \<Rightarrow> 'a set"
  assumes X: "countable X"
  assumes A: "A`X \<subseteq> M"
  shows  "(\<Union>x\<in>X. A x) \<in> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (A ` X) \<in> M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (A ` X) \<in> M
[PROOF STEP]
have "(\<Union>x\<in>X. A x) = (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (A ` X) = (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i))
[PROOF STEP]
using X
[PROOF STATE]
proof (prove)
using this:
countable X

goal (1 subgoal):
 1. \<Union> (A ` X) = (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (A ` X) = (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i))

goal (1 subgoal):
 1. \<Union> (A ` X) \<in> M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (A ` X) = (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i))

goal (1 subgoal):
 1. \<Union> (A ` X) \<in> M
[PROOF STEP]
have "\<dots> \<in> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i)) \<in> M
[PROOF STEP]
using A X
[PROOF STATE]
proof (prove)
using this:
A ` X \<subseteq> M
countable X

goal (1 subgoal):
 1. (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i)) \<in> M
[PROOF STEP]
by (intro countable_UN) auto
[PROOF STATE]
proof (state)
this:
(\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i)) \<in> M

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

goal (1 subgoal):
 1. \<Union> (A ` X) \<in> M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Union> (A ` X) \<in> M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_path_split'[simp]:
      "is_path v (p1@(u,u')#p2) v'
        \<longleftrightarrow> is_path v p1 u \<and> (u,u')\<in>E \<and> is_path u' p2 v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_path v (p1 @ (u, u') # p2) v' = (is_path v p1 u \<and> (u, u') \<in> E \<and> is_path u' p2 v')
[PROOF STEP]
by (auto simp add: is_path_split)


[STATEMENT]
lemma decidable_complement: "decidable X \<Longrightarrow> decidable (- X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
assume "decidable X"
[PROOF STATE]
proof (state)
this:
decidable X

goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
decidable X
[PROOF STEP]
obtain f where f: "recfn 1 f" "\<forall>x. eval f [x] \<down>= (if x \<in> X then 1 else 0)"
[PROOF STATE]
proof (prove)
using this:
decidable X

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>recfn 1 f; \<forall>x. eval f [x] \<down>= (if x \<in> X then 1 else 0)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using decidable_def
[PROOF STATE]
proof (prove)
using this:
decidable X
decidable ?X \<equiv> \<exists>f. recfn 1 f \<and> (\<forall>x. eval f [x] \<down>= (if x \<in> ?X then 1 else 0))

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>recfn 1 f; \<forall>x. eval f [x] \<down>= (if x \<in> X then 1 else 0)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
recfn 1 f
\<forall>x. eval f [x] \<down>= (if x \<in> X then 1 else 0)

goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
define g where "g = Cn 1 r_not [f]"
[PROOF STATE]
proof (state)
this:
g = Cn 1 r_not [f]

goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g = Cn 1 r_not [f]
[PROOF STEP]
have "recfn 1 g"
[PROOF STATE]
proof (prove)
using this:
g = Cn 1 r_not [f]

goal (1 subgoal):
 1. recfn 1 g
[PROOF STEP]
by (simp add: f(1))
[PROOF STATE]
proof (state)
this:
recfn 1 g

goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
recfn 1 g

goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
have "eval g [x] \<down>= (if x \<in> X then 0 else 1)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval g [x] \<down>= (if x \<in> X then 0 else 1)
[PROOF STEP]
by (simp add: g_def f)
[PROOF STATE]
proof (state)
this:
eval g [?x] \<down>= (if ?x \<in> X then 0 else 1)

goal (1 subgoal):
 1. decidable X \<Longrightarrow> decidable (- X)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
recfn 1 g
eval g [?x] \<down>= (if ?x \<in> X then 0 else 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
recfn 1 g
eval g [?x] \<down>= (if ?x \<in> X then 0 else 1)

goal (1 subgoal):
 1. decidable (- X)
[PROOF STEP]
using decidable_def
[PROOF STATE]
proof (prove)
using this:
recfn 1 g
eval g [?x] \<down>= (if ?x \<in> X then 0 else 1)
decidable ?X \<equiv> \<exists>f. recfn 1 f \<and> (\<forall>x. eval f [x] \<down>= (if x \<in> ?X then 1 else 0))

goal (1 subgoal):
 1. decidable (- X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
decidable (- X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_transpose_matrix [simp]: "x v* transpose A = A *v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x v* Finite_Cartesian_Product.transpose A = A *v x
[PROOF STEP]
unfolding transpose_def vector_matrix_mult_def matrix_vector_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>j. \<Sum>i\<in>UNIV. (\<chi>i j. A $ j $ i) $ i $ j * x $ i) = (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * x $ j)
[PROOF STEP]
by simp


[STATEMENT]
lemma locs_rev_stks:
  "x \<ge> z \<Longrightarrow>
  locs z
    (\<lambda>b.
      if z < b then loc (Suc y, b)
        else if b \<le> z
          then stk (y, x + b - Suc z)
          else arbitrary)
  @ [stk (y, x - Suc 0)]
  =
  stk (y, x - Suc (z))
  # rev (take z (stks x (\<lambda>a. stk(y, a))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<le> x \<Longrightarrow> locs z (\<lambda>b. if z < b then loc (Suc y, b) else if b \<le> z then stk (y, x + b - Suc z) else arbitrary) @ [stk (y, x - Suc 0)] = stk (y, x - Suc z) # rev (take z (stks x (\<lambda>a. stk (y, a))))
[PROOF STEP]
apply (rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. z \<le> x \<Longrightarrow> length (locs z (\<lambda>b. if z < b then loc (Suc y, b) else if b \<le> z then stk (y, x + b - Suc z) else arbitrary) @ [stk (y, x - Suc 0)]) = length (stk (y, x - Suc z) # rev (take z (stks x (\<lambda>a. stk (y, a)))))
 2. \<And>i. \<lbrakk>z \<le> x; i < length (locs z (\<lambda>b. if z < b then loc (Suc y, b) else if b \<le> z then stk (y, x + b - Suc z) else arbitrary) @ [stk (y, x - Suc 0)])\<rbrakk> \<Longrightarrow> (locs z (\<lambda>b. if z < b then loc (Suc y, b) else if b \<le> z then stk (y, x + b - Suc z) else arbitrary) @ [stk (y, x - Suc 0)]) ! i = (stk (y, x - Suc z) # rev (take z (stks x (\<lambda>a. stk (y, a))))) ! i
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>z \<le> x; i < length (locs z (\<lambda>b. if z < b then loc (Suc y, b) else if b \<le> z then stk (y, x + b - Suc z) else arbitrary) @ [stk (y, x - Suc 0)])\<rbrakk> \<Longrightarrow> (locs z (\<lambda>b. if z < b then loc (Suc y, b) else if b \<le> z then stk (y, x + b - Suc z) else arbitrary) @ [stk (y, x - Suc 0)]) ! i = (stk (y, x - Suc z) # rev (take z (stks x (\<lambda>a. stk (y, a))))) ! i
[PROOF STEP]
apply (auto simp: nth_append nth_Cons' (* nth_locs *) less_Suc_eq min.absorb2 max.absorb2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma num_gholes_greater0_fill_gholes_gmctxt [intro!]:
  assumes "num_gholes C = length Ds"
    and "\<exists> D \<in> set Ds. 0 < num_gholes D"
  shows "0 < sum_list (map num_gholes Ds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sum_list (map num_gholes Ds)
[PROOF STEP]
using assms gr_zeroI
[PROOF STATE]
proof (prove)
using this:
num_gholes C = length Ds
\<exists>D\<in>set Ds. 0 < num_gholes D
(?n = (0::?'a) \<Longrightarrow> False) \<Longrightarrow> (0::?'a) < ?n

goal (1 subgoal):
 1. 0 < sum_list (map num_gholes Ds)
[PROOF STEP]
by force


[STATEMENT]
lemma lang_pow_add: "A ^^ (n + m) = A ^^ n @@ A ^^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^^ (n + m) = A ^^ n @@ A ^^ m
[PROOF STEP]
by (induct n) (auto simp: conc_assoc)


[STATEMENT]
lemma l10_10:
  assumes "P' P Reflect A B" and
    "Q' Q Reflect A B"
  shows "Cong P Q P' Q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong P Q P' Q'
[PROOF STEP]
using Reflect_def assms(1) assms(2) cong_4321 l10_10_spec l7_13
[PROOF STATE]
proof (prove)
using this:
?P' ?P Reflect ?A ?B \<equiv> ?A \<noteq> ?B \<and> ?P' ?P ReflectL ?A ?B \<or> ?A = ?B \<and> ?A Midpoint ?P ?P'
P' P Reflect A B
Q' Q Reflect A B
Cong ?A ?B ?C ?D \<Longrightarrow> Cong ?D ?C ?B ?A
\<lbrakk>?P' ?P ReflectL ?A ?B; ?Q' ?Q ReflectL ?A ?B\<rbrakk> \<Longrightarrow> Cong ?P ?Q ?P' ?Q'
\<lbrakk>?A Midpoint ?P' ?P; ?A Midpoint ?Q' ?Q\<rbrakk> \<Longrightarrow> Cong ?P ?Q ?P' ?Q'

goal (1 subgoal):
 1. Cong P Q P' Q'
[PROOF STEP]
by auto


[STATEMENT]
lemma count_of_filter: "count_of (List.filter (P \<circ> fst) xs) x = (if P x then count_of xs x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_of (filter (P \<circ> fst) xs) x = (if P x then count_of xs x else 0)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma matricize_0:
shows "matricize I (tensor0 ds) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matricize I (tensor0 ds) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))
[PROOF STEP]
proof (rule eq_matI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))); j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))\<rbrakk> \<Longrightarrow> matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)
 2. dim_row (matricize I (tensor0 ds)) = dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
 3. dim_col (matricize I (tensor0 ds)) = dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
[PROOF STEP]
show "dim_row (matricize I (tensor0 ds)) = dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (matricize I (tensor0 ds)) = dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
[PROOF STEP]
unfolding zero_mat_def dim_row_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (matricize I (tensor0 ds)) = dim_row (matricize I (tensor0 ds))
[PROOF STEP]
by (simp add: dims_matricize(1))
[PROOF STATE]
proof (state)
this:
dim_row (matricize I (tensor0 ds)) = dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))); j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))\<rbrakk> \<Longrightarrow> matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)
 2. dim_col (matricize I (tensor0 ds)) = dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
[PROOF STEP]
show "dim_col (matricize I (tensor0 ds)) = dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (matricize I (tensor0 ds)) = dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
[PROOF STEP]
unfolding zero_mat_def dim_row_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (matricize I (tensor0 ds)) = dim_col (mat (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) (\<lambda>ij. 0::'e))
[PROOF STEP]
by (simp add: dims_matricize(2))
[PROOF STATE]
proof (state)
this:
dim_col (matricize I (tensor0 ds)) = dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))); j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))\<rbrakk> \<Longrightarrow> matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))); j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))\<rbrakk> \<Longrightarrow> matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)
[PROOF STEP]
assume ij_le1: "i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))"
                 "j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))"
[PROOF STATE]
proof (state)
this:
i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))); j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))\<rbrakk> \<Longrightarrow> matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
[PROOF STEP]
have ij_le2:"i < dim_row (matricize I (tensor0 ds))" "j < dim_col (matricize I (tensor0 ds))"
[PROOF STATE]
proof (prove)
using this:
i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))
j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))

goal (1 subgoal):
 1. i < dim_row (matricize I (tensor0 ds)) &&& j < dim_col (matricize I (tensor0 ds))
[PROOF STEP]
unfolding zero_mat_def dim_row_mat
[PROOF STATE]
proof (prove)
using this:
i < dim_row (matricize I (tensor0 ds))
j < dim_col (mat (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) (\<lambda>ij. 0::'g))

goal (1 subgoal):
 1. i < dim_row (matricize I (tensor0 ds)) &&& j < dim_col (matricize I (tensor0 ds))
[PROOF STEP]
by (simp_all add: dims_matricize)
[PROOF STATE]
proof (state)
this:
i < dim_row (matricize I (tensor0 ds))
j < dim_col (matricize I (tensor0 ds))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds)))); j < dim_col (0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))))\<rbrakk> \<Longrightarrow> matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)
[PROOF STEP]
show "matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)
[PROOF STEP]
unfolding zero_mat_def  index_mat[OF ij_le2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matricize I (tensor0 ds) $$ (i, j) = (0::'j)
[PROOF STEP]
unfolding matricize_def index_mat[OF ij_le2[unfolded dims_matricize]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (i, j) of (r, c) \<Rightarrow> lookup (tensor0 ds) (weave I (digit_encode (nths (dims (tensor0 ds)) I) r) (digit_encode (nths (dims (tensor0 ds)) (- I)) c))) = (0::'j)
[PROOF STEP]
by (simp, metis lookup_tensor0 digit_encode_valid_index dims_matricize(1) dims_matricize(2) dims_tensor0
    ij_le2(1) ij_le2(2) valid_index_weave(1))
[PROOF STATE]
proof (state)
this:
matricize I (tensor0 ds) $$ (i, j) = 0\<^sub>m (dim_row (matricize I (tensor0 ds))) (dim_col (matricize I (tensor0 ds))) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma setim_cmpfn: "\<lbrakk> f:A \<rightarrow> B; g:B \<rightarrow> C; A1 \<subseteq> A \<rbrakk> \<Longrightarrow>
               (compose A g f)` A1 = g`(f` A1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; g \<in> B \<rightarrow> C; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> compose A g f ` A1 = g ` f ` A1
[PROOF STEP]
apply (simp add:image_def compose_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; g \<in> B \<rightarrow> C; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> {y. \<exists>x\<in>A1 \<inter> A. y = g (f x)} \<union> {y. y = undefined \<and> (\<exists>x. x \<in> A1 \<and> x \<notin> A)} = {y. \<exists>x. (\<exists>xa\<in>A1. x = f xa) \<and> y = g x}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma borel_measurable_ereal_iff_Ioi:
  "(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {a <..} \<inter> space M \<in> sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> borel_measurable M) = (\<forall>a. f -` {a<..} \<inter> space M \<in> sets M)
[PROOF STEP]
by (auto simp: borel_Ioi measurable_iff_measure_of)


[STATEMENT]
lemma "!!a::real. a \<le> b ==> c \<le> d ==> x + y < z ==> a + c \<le> b + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<le> b; c \<le> d; x + y < z\<rbrakk> \<Longrightarrow> a + c \<le> b + d
[PROOF STEP]
by linarith


[STATEMENT]
lemma (in abelian_subgroup) a_rcos_sum:
     "\<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk>
      \<Longrightarrow> (H +> x) <+> (H +> y) = H +> (x \<oplus> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> H +> x <+> (H +> y) = H +> x \<oplus> y
[PROOF STEP]
by (rule normal.rcos_sum [OF a_normal,
    folded set_add_def a_r_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma IfmImp: " \<lbrakk> Ifm bs p = P ; Ifm bs q = Q\<rbrakk> \<Longrightarrow> (Ifm bs (Imp p q) = (P \<longrightarrow> Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ifm bs p = P; Ifm bs q = Q\<rbrakk> \<Longrightarrow> Ifm bs (Imp p q) = (P \<longrightarrow> Q)
[PROOF STEP]
by simp


[STATEMENT]
lemma get_odd_ex: "\<exists> k. Suc k = get_odd n \<and> odd (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. Suc k = get_odd n \<and> odd (Suc k)
[PROOF STEP]
by (auto simp: get_odd_def odd_pos intro!: exI[of _ "n - 1"])


[STATEMENT]
lemma invimage_vunion_left: "(r \<union>\<^sub>\<circ> s) -`\<^sub>\<circ> A = r -`\<^sub>\<circ> A \<union>\<^sub>\<circ> s -`\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r \<union>\<^sub>\<circ> s) -`\<^sub>\<circ> A = r -`\<^sub>\<circ> A \<union>\<^sub>\<circ> s -`\<^sub>\<circ> A
[PROOF STEP]
by (auto intro!: vsubset_antisym)


[STATEMENT]
lemma vint_mult_transfer[transfer_rule]:
  includes lifting_syntax
  shows "(cr_vint ===> cr_vint ===> cr_vint) (*\<^sub>\<int>) (*)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cr_vint ===> cr_vint ===> cr_vint) (*\<^sub>\<int>) (*)
[PROOF STEP]
using vint_fpair_in_fproduct_vint
[PROOF STATE]
proof (prove)
using this:
[?a\<^sub>\<int>, ?b\<^sub>\<int>]\<^sub>\<circ> \<in>\<^sub>\<circ> \<int>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat>

goal (1 subgoal):
 1. (cr_vint ===> cr_vint ===> cr_vint) (*\<^sub>\<int>) (*)
[PROOF STEP]
by (intro rel_funI, unfold vint_mult_def cr_vint_def cr_scalar_def)
    (simp add: nat_omega_simps)


[STATEMENT]
lemma epi_hom_induced_inclusion:
  assumes "homotopic_with (\<lambda>x. True) X X id f" and "f ` (topspace X) \<subseteq> S"
  shows "(hom_induced p (subtopology X S) {} X {} id)
   \<in> epi (homology_group p (subtopology X S)) (homology_group p X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (subtopology X S) {} X {} id \<in> epi (homology_group p (subtopology X S)) (homology_group p X)
[PROOF STEP]
proof (rule epi_right_invertible)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. hom_induced p (subtopology X S) {} X {} id \<in> hom (homology_group p (subtopology X S)) (homology_group p X)
 2. ?f \<in> carrier (homology_group p X) \<rightarrow> carrier (homology_group p (subtopology X S))
 3. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> hom_induced p (subtopology X S) {} X {} id (?f x) = x
[PROOF STEP]
show "hom_induced p (subtopology X S) {} X {} id
        \<in> hom (homology_group p (subtopology X S)) (homology_group p X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (subtopology X S) {} X {} id \<in> hom (homology_group p (subtopology X S)) (homology_group p X)
[PROOF STEP]
by (simp add: hom_induced_empty_hom)
[PROOF STATE]
proof (state)
this:
hom_induced p (subtopology X S) {} X {} id \<in> hom (homology_group p (subtopology X S)) (homology_group p X)

goal (2 subgoals):
 1. ?f \<in> carrier (homology_group p X) \<rightarrow> carrier (homology_group p (subtopology X S))
 2. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> hom_induced p (subtopology X S) {} X {} id (?f x) = x
[PROOF STEP]
show "hom_induced p X {} (subtopology X S) {} f
      \<in> carrier (homology_group p X) \<rightarrow> carrier (homology_group p (subtopology X S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p X {} (subtopology X S) {} f \<in> carrier (homology_group p X) \<rightarrow> carrier (homology_group p (subtopology X S))
[PROOF STEP]
by (simp add: hom_induced_carrier)
[PROOF STATE]
proof (state)
this:
hom_induced p X {} (subtopology X S) {} f \<in> carrier (homology_group p X) \<rightarrow> carrier (homology_group p (subtopology X S))

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> hom_induced p (subtopology X S) {} X {} id (hom_induced p X {} (subtopology X S) {} f x) = x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> hom_induced p (subtopology X S) {} X {} id (hom_induced p X {} (subtopology X S) {} f x) = x
[PROOF STEP]
assume "x \<in> carrier (homology_group p X)"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (homology_group p X)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (homology_group p X) \<Longrightarrow> hom_induced p (subtopology X S) {} X {} id (hom_induced p X {} (subtopology X S) {} f x) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier (homology_group p X)
[PROOF STEP]
show "hom_induced p (subtopology X S) {} X {} id (hom_induced p X {} (subtopology X S) {} f x) = x"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (homology_group p X)

goal (1 subgoal):
 1. hom_induced p (subtopology X S) {} X {} id (hom_induced p X {} (subtopology X S) {} f x) = x
[PROOF STEP]
by (metis  assms continuous_map_id_subt continuous_map_in_subtopology hom_induced_compose' hom_induced_id homology_homotopy_empty homotopic_with_imp_continuous_maps image_empty order_refl)
[PROOF STATE]
proof (state)
this:
hom_induced p (subtopology X S) {} X {} id (hom_induced p X {} (subtopology X S) {} f x) = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_list_zero_not_elem: "count_list xs x = 0 \<longleftrightarrow> x \<notin> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (count_list xs x = 0) = (x \<notin> set xs)
[PROOF STEP]
by(induct xs) auto


[STATEMENT]
lemma weighted_majority_swap: "weighted_majority R x y = -weighted_majority R y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weighted_majority R x y = - weighted_majority R y x
[PROOF STEP]
by (simp add: weighted_majority_def)


[STATEMENT]
lemma (in prob_space) split_indep_events:
  assumes "M = measure_pmf p"
  assumes "indep_vars (\<lambda>i. discrete) X' I"
  assumes "K \<subseteq> I" "finite K"
  shows "prob {\<omega>. \<forall>x \<in> K. P x (X' x \<omega>)} = (\<Prod>x \<in> K. prob {\<omega>. P x (X' x \<omega>)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
have [simp]: "space M = UNIV"  "events = UNIV"  "prob UNIV = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space M = UNIV &&& events = UNIV &&& prob UNIV = 1
[PROOF STEP]
by (simp add:assms(1))+
[PROOF STATE]
proof (state)
this:
space M = UNIV
events = UNIV
prob UNIV = 1

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
have "indep_vars (\<lambda>_. discrete) X' K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>_. discrete) X' K
[PROOF STEP]
using assms(2,3) indep_vars_subset
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>i. discrete) X' I
K \<subseteq> I
\<lbrakk>indep_vars ?M' ?X ?I; ?J \<subseteq> ?I\<rbrakk> \<Longrightarrow> indep_vars ?M' ?X ?J

goal (1 subgoal):
 1. indep_vars (\<lambda>_. discrete) X' K
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
indep_vars (\<lambda>_. discrete) X' K

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
hence "indep_events (\<lambda>x. {\<omega> \<in> space M. P x (X' x \<omega>)}) K"
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. discrete) X' K

goal (1 subgoal):
 1. indep_events (\<lambda>x. {\<omega> \<in> space M. P x (X' x \<omega>)}) K
[PROOF STEP]
using indep_eventsI_indep_vars
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>_. discrete) X' K
\<lbrakk>indep_vars ?N ?X ?I; \<And>i. i \<in> ?I \<Longrightarrow> {x \<in> space (?N i). ?P i x} \<in> sets (?N i)\<rbrakk> \<Longrightarrow> indep_events (\<lambda>i. {x \<in> space M. ?P i (?X i x)}) ?I

goal (1 subgoal):
 1. indep_events (\<lambda>x. {\<omega> \<in> space M. P x (X' x \<omega>)}) K
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
indep_events (\<lambda>x. {\<omega> \<in> space M. P x (X' x \<omega>)}) K

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
hence a:"indep_events (\<lambda>x. {\<omega>. P x (X' x \<omega>)}) K"
[PROOF STATE]
proof (prove)
using this:
indep_events (\<lambda>x. {\<omega> \<in> space M. P x (X' x \<omega>)}) K

goal (1 subgoal):
 1. indep_events (\<lambda>x. {\<omega>. P x (X' x \<omega>)}) K
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
indep_events (\<lambda>x. {\<omega>. P x (X' x \<omega>)}) K

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
have "prob  {\<omega>. \<forall>x \<in> K. P x (X' x \<omega>)} = prob (\<Inter>x \<in> K. {\<omega>. P x (X' x \<omega>)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = prob (\<Inter>x\<in>K. {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
by (simp add: measure_pmf_eq[OF assms(1)])
[PROOF STATE]
proof (state)
this:
prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = prob (\<Inter>x\<in>K. {\<omega>. P x (X' x \<omega>)})

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = prob (\<Inter>x\<in>K. {\<omega>. P x (X' x \<omega>)})

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
have "... =  (\<Prod> x \<in> K. prob {\<omega>. P x (X' x \<omega>)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (\<Inter>x\<in>K. {\<omega>. P x (X' x \<omega>)}) = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
using a assms(4)
[PROOF STATE]
proof (prove)
using this:
indep_events (\<lambda>x. {\<omega>. P x (X' x \<omega>)}) K
finite K

goal (1 subgoal):
 1. prob (\<Inter>x\<in>K. {\<omega>. P x (X' x \<omega>)}) = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
by (cases "K = {}", auto simp: indep_events_def)
[PROOF STATE]
proof (state)
this:
prob (\<Inter>x\<in>K. {\<omega>. P x (X' x \<omega>)}) = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})

goal (1 subgoal):
 1. prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prob {\<omega>. \<forall>x\<in>K. P x (X' x \<omega>)} = (\<Prod>x\<in>K. prob {\<omega>. P x (X' x \<omega>)})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma i_set0_mod_0_mult_in_i_set0_mult: "
  \<lbrakk> I \<in> i_set0; m mod k = 0 \<rbrakk> \<Longrightarrow> I \<otimes> m \<in> i_set0_mult k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<in> i_set0; m mod k = 0\<rbrakk> \<Longrightarrow> I \<otimes> m \<in> i_set0_mult k
[PROOF STEP]
apply (simp add: i_set0_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I = {} \<or> I \<in> i_set; m mod k = 0\<rbrakk> \<Longrightarrow> I \<otimes> m \<in> i_set0_mult k
[PROOF STEP]
apply (erule disjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>m mod k = 0; I = {}\<rbrakk> \<Longrightarrow> I \<otimes> m \<in> i_set0_mult k
 2. \<lbrakk>m mod k = 0; I \<in> i_set\<rbrakk> \<Longrightarrow> I \<otimes> m \<in> i_set0_mult k
[PROOF STEP]
apply (simp add: iT_Mult_empty i_set0_mult_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m mod k = 0; I \<in> i_set\<rbrakk> \<Longrightarrow> I \<otimes> m \<in> i_set0_mult k
[PROOF STEP]
apply (rule subsetD[OF i_set_mult_subset_i_set0_mult])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m mod k = 0; I \<in> i_set\<rbrakk> \<Longrightarrow> I \<otimes> m \<in> i_set_mult k
[PROOF STEP]
apply (simp add: i_set_mod_0_mult_in_i_set_mult)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fds_nth_deriv: "fds_nth (fds_deriv f) n = -ln (real n) *\<^sub>R fds_nth f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_deriv f) n = - ln (real n) *\<^sub>R fds_nth f n
[PROOF STEP]
by (cases "n = 0") (simp_all add: fds_deriv_def)


[STATEMENT]
lemma locally_path_connected_components:
  "\<lbrakk>locally path_connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally path_connected c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>locally path_connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally path_connected c
[PROOF STEP]
by (meson locally_connected_open_component locally_open_subset locally_path_connected_imp_locally_connected openin_subtopology_self)


[STATEMENT]
lemma prod_smult: "(\<Prod>x\<in>A. Polynomial.smult (c x) (p x)) = Polynomial.smult (prod c A) (prod p A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>A. smult (c x) (p x)) = smult (prod c A) (prod p A)
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (auto simp: mult_ac)


[STATEMENT]
lemma asi_le_rfst:
  "\<lbrakk>asi rank r cost; rank (rev U) \<le> rank (rev V); U\<noteq>[]; V\<noteq>[]; distinct (A@U@V@B);
    take 1 (A @ U @ V @ B) = [r]; take 1 (A @ V @ U @ B) = [r]\<rbrakk>
    \<Longrightarrow> cost (rev (A@U@V@B)) \<le> cost (rev (A@V@U@B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>asi rank r cost; rank (rev U) \<le> rank (rev V); U \<noteq> []; V \<noteq> []; distinct (A @ U @ V @ B); take 1 (A @ U @ V @ B) = [r]; take 1 (A @ V @ U @ B) = [r]\<rbrakk> \<Longrightarrow> cost (rev (A @ U @ V @ B)) \<le> cost (rev (A @ V @ U @ B))
[PROOF STEP]
unfolding asi_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>A U V B. distinct (A @ U @ V @ B) \<and> U \<noteq> [] \<and> V \<noteq> [] \<and> (r \<notin> set (A @ U @ V @ B) \<or> take 1 (A @ U @ V @ B) = [r] \<and> take 1 (A @ V @ U @ B) = [r]) \<longrightarrow> (cost (rev (A @ U @ V @ B)) \<le> cost (rev (A @ V @ U @ B))) = (rank (rev U) \<le> rank (rev V)); rank (rev U) \<le> rank (rev V); U \<noteq> []; V \<noteq> []; distinct (A @ U @ V @ B); take 1 (A @ U @ V @ B) = [r]; take 1 (A @ V @ U @ B) = [r]\<rbrakk> \<Longrightarrow> cost (rev (A @ U @ V @ B)) \<le> cost (rev (A @ V @ U @ B))
[PROOF STEP]
by blast


[STATEMENT]
lemma not_true_eq_false: "(~ True) = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> True) = False
[PROOF STEP]
by simp


[STATEMENT]
lemma finite_imp_inj_to_nat_seg':
    fixes A :: "'a set"
    assumes A: "finite A"
    obtains f::"'a \<Rightarrow> nat" and n::"nat" where
      "f`A = {i. i<n}"
      "inj_on f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f n. \<lbrakk>f ` A = {i. i < n}; inj_on f A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis A finite_imp_inj_to_nat_seg)


[STATEMENT]
lemma Lambert_W'_le_iff [simp]:
  "x \<in> {-exp(-1)..<0} \<Longrightarrow> y \<in> {-exp(-1)..<0} \<Longrightarrow> Lambert_W' x \<le> Lambert_W' y \<longleftrightarrow> x \<ge> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> {- exp (- 1)..<0}; y \<in> {- exp (- 1)..<0}\<rbrakk> \<Longrightarrow> (Lambert_W' x \<le> Lambert_W' y) = (y \<le> x)
[PROOF STEP]
using Lambert_W'_strict_antimono[of x y] Lambert_W'_strict_antimono[of y x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- exp (- 1) \<le> x; x < y; y < 0\<rbrakk> \<Longrightarrow> Lambert_W' y < Lambert_W' x
\<lbrakk>- exp (- 1) \<le> y; y < x; x < 0\<rbrakk> \<Longrightarrow> Lambert_W' x < Lambert_W' y

goal (1 subgoal):
 1. \<lbrakk>x \<in> {- exp (- 1)..<0}; y \<in> {- exp (- 1)..<0}\<rbrakk> \<Longrightarrow> (Lambert_W' x \<le> Lambert_W' y) = (y \<le> x)
[PROOF STEP]
by (cases x y rule: linorder_cases) auto


[STATEMENT]
lemma ordinal_times_oLimit [simp]: "x * oLimit f = oLimit (\<lambda>n. x * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * oLimit f = oLimit (\<lambda>n. x * f n)
[PROOF STEP]
by (simp add: times_ordinal_def ordinal_rec_oLimit)


[STATEMENT]
lemma min_height_size_if_incomplete:
  "\<not> complete kdt \<Longrightarrow> 2 ^ min_height kdt < size_kdt kdt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> 2 ^ min_height kdt < KD_Tree.size_kdt kdt
[PROOF STEP]
by (metis complete_if_size_min_height le_less min_height_size)


[STATEMENT]
lemma reachable_is_V[simp]: "reachableNodes s = V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachableNodes s = V
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. reachableNodes s \<subseteq> V
 2. V \<subseteq> reachableNodes s
[PROOF STEP]
show "V \<subseteq> reachableNodes s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<subseteq> reachableNodes s
[PROOF STEP]
unfolding reachableNodes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<subseteq> {v. connected s v}
[PROOF STEP]
using s_node nodes_on_st_path
[PROOF STATE]
proof (prove)
using this:
s \<in> V
\<forall>v\<in>V. connected s v \<and> connected v t

goal (1 subgoal):
 1. V \<subseteq> {v. connected s v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V \<subseteq> reachableNodes s

goal (1 subgoal):
 1. reachableNodes s \<subseteq> V
[PROOF STEP]
qed (simp add: reachable_ss_V)


[STATEMENT]
lemma poincare_map_tendsto:
  assumes "(return_time P \<longlongrightarrow> return_time P x) (at x within S)"
    "returns_to P x" "closed P"
  shows "(poincare_map P \<longlongrightarrow> poincare_map P x) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poincare_map P \<longlongrightarrow> poincare_map P x) (at x within S)
[PROOF STEP]
unfolding poincare_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. flow0 x (return_time P x)) \<longlongrightarrow> flow0 x (return_time P x)) (at x within S)
[PROOF STEP]
by (rule tendsto_eq_intros refl assms return_time_exivl)+


[STATEMENT]
lemma coeff_sum: "coeff (sum (f :: _ \<Rightarrow> linear_poly) is) x = sum (\<lambda> i. coeff (f i) x) is"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (sum f is) x = (\<Sum>i\<in>is. coeff (f i) x)
[PROOF STEP]
by (induct "is" rule: infinite_finite_induct, auto)