[STATEMENT]
lemma homeomorphic_Euclidean_space_product_topology:
  "Euclidean_space n homeomorphic_space product_topology (\<lambda>i. euclideanreal) {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Euclidean_space n homeomorphic_space powertop_real {..<n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Euclidean_space n homeomorphic_space powertop_real {..<n}
[PROOF STEP]
have cm: "continuous_map (product_topology (\<lambda>i. euclideanreal) {..<n})
          euclideanreal (\<lambda>x. if k < n then x k else 0)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (powertop_real {..<n}) euclideanreal (\<lambda>x. if k < n then x k else 0)
[PROOF STEP]
by (auto intro: continuous_map_if continuous_map_product_projection)
[PROOF STATE]
proof (state)
this:
continuous_map (powertop_real {..<n}) euclideanreal (\<lambda>x. if ?k < n then x ?k else 0)

goal (1 subgoal):
 1. Euclidean_space n homeomorphic_space powertop_real {..<n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Euclidean_space n homeomorphic_space powertop_real {..<n}
[PROOF STEP]
unfolding homeomorphic_space_def homeomorphic_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f g. continuous_map (Euclidean_space n) (powertop_real {..<n}) f \<and> continuous_map (powertop_real {..<n}) (Euclidean_space n) g \<and> (\<forall>x\<in>topspace (Euclidean_space n). g (f x) = x) \<and> (\<forall>y\<in>topspace (powertop_real {..<n}). f (g y) = y)
[PROOF STEP]
apply (rule_tac x="\<lambda>f. restrict f {..<n}" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. continuous_map (Euclidean_space n) (powertop_real {..<n}) (\<lambda>f. restrict f {..<n}) \<and> continuous_map (powertop_real {..<n}) (Euclidean_space n) g \<and> (\<forall>x\<in>topspace (Euclidean_space n). g (restrict x {..<n}) = x) \<and> (\<forall>y\<in>topspace (powertop_real {..<n}). restrict (g y) {..<n} = y)
[PROOF STEP]
apply (rule_tac x="\<lambda>f i. if i < n then f i else 0" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (Euclidean_space n) (powertop_real {..<n}) (\<lambda>f. restrict f {..<n}) \<and> continuous_map (powertop_real {..<n}) (Euclidean_space n) (\<lambda>f i. if i < n then f i else 0) \<and> (\<forall>x\<in>topspace (Euclidean_space n). (\<lambda>i. if i < n then restrict x {..<n} i else 0) = x) \<and> (\<forall>y\<in>topspace (powertop_real {..<n}). (\<lambda>i\<in>{..<n}. if i < n then y i else 0) = y)
[PROOF STEP]
apply (simp add: Euclidean_space_def continuous_map_in_subtopology)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (subtopology (powertop_real UNIV) {x. \<forall>i\<ge>n. x i = 0}) (powertop_real {..<n}) (\<lambda>f. restrict f {..<n}) \<and> continuous_map (powertop_real {..<n}) (powertop_real UNIV) (\<lambda>f i. if i < n then f i else 0) \<and> (\<lambda>x i. if i < n then x i else 0) ` ({..<n} \<rightarrow>\<^sub>E UNIV) \<subseteq> {x. \<forall>i\<ge>n. x i = 0} \<and> (\<forall>x. (\<forall>i\<ge>n. x i = 0) \<longrightarrow> (\<lambda>i. if i < n then restrict x {..<n} i else 0) = x) \<and> (\<forall>y\<in>{..<n} \<rightarrow>\<^sub>E UNIV. (\<lambda>i\<in>{..<n}. if i < n then y i else 0) = y)
[PROOF STEP]
apply (intro conjI continuous_map_from_subtopology)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. continuous_map (powertop_real UNIV) (powertop_real {..<n}) (\<lambda>f. restrict f {..<n})
 2. continuous_map (powertop_real {..<n}) (powertop_real UNIV) (\<lambda>f i. if i < n then f i else 0)
 3. (\<lambda>x i. if i < n then x i else 0) ` ({..<n} \<rightarrow>\<^sub>E UNIV) \<subseteq> {x. \<forall>i\<ge>n. x i = 0}
 4. \<forall>x. (\<forall>i\<ge>n. x i = 0) \<longrightarrow> (\<lambda>i. if i < n then restrict x {..<n} i else 0) = x
 5. \<forall>y\<in>{..<n} \<rightarrow>\<^sub>E UNIV. (\<lambda>i\<in>{..<n}. if i < n then y i else 0) = y
[PROOF STEP]
apply (force simp: continuous_map_componentwise cm intro: continuous_map_product_projection)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Euclidean_space n homeomorphic_space powertop_real {..<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma build_range[simp]: "range (a ## w) = insert a (range w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (a ## w) = insert a (range w)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x xa. \<lbrakk>xa \<in> UNIV; (a ## w) xa \<notin> range w\<rbrakk> \<Longrightarrow> (a ## w) xa = a
 2. \<And>x. a \<in> range (a ## w)
 3. \<And>x xa. xa \<in> UNIV \<Longrightarrow> w xa \<in> range (a ## w)
[PROOF STEP]
show "(a ## w) i \<notin> range w \<Longrightarrow> (a ## w) i = a" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a ## w) i \<notin> range w \<Longrightarrow> (a ## w) i = a
[PROOF STEP]
by (cases i) auto
[PROOF STATE]
proof (state)
this:
(a ## w) ?i \<notin> range w \<Longrightarrow> (a ## w) ?i = a

goal (2 subgoals):
 1. \<And>x. a \<in> range (a ## w)
 2. \<And>x xa. xa \<in> UNIV \<Longrightarrow> w xa \<in> range (a ## w)
[PROOF STEP]
show "a \<in> range (a ## w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> range (a ## w)
[PROOF STEP]
proof (rule range_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = (a ## w) ?x
[PROOF STEP]
show "a = (a ## w) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = (a ## w) 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a = (a ## w) 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<in> range (a ## w)

goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> w xa \<in> range (a ## w)
[PROOF STEP]
show "w i \<in> range (a ## w)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w i \<in> range (a ## w)
[PROOF STEP]
proof (rule range_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w i = (a ## w) ?x
[PROOF STEP]
show "w i = (a ## w) (Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w i = (a ## w) (Suc i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w i = (a ## w) (Suc i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w ?i \<in> range (a ## w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invertible_left_cancel [simp]:
  "\<lbrakk> invertible x; x \<in> M; y \<in> M; z \<in> M \<rbrakk> \<Longrightarrow> x \<cdot> y = x \<cdot> z \<longleftrightarrow> y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invertible x; x \<in> M; y \<in> M; z \<in> M\<rbrakk> \<Longrightarrow> (x \<cdot> y = x \<cdot> z) = (y = z)
[PROOF STEP]
by (metis associative invertible_def left_unit)


[STATEMENT]
lemma vrat_assoc_law_multiplication:
  assumes "x \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>" and "z \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>"
  shows "(x *\<^sub>\<rat> y) *\<^sub>\<rat> z = x *\<^sub>\<rat> (y *\<^sub>\<rat> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>\<rat> y *\<^sub>\<rat> z = x *\<^sub>\<rat> (y *\<^sub>\<rat> z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>\<rat> y *\<^sub>\<rat> z = x *\<^sub>\<rat> (y *\<^sub>\<rat> z)
[PROOF STEP]
have "(x' * y') * z' = x' * (y' * z')" for x' y' z' :: rat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' * y' * z' = x' * (y' * z')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' * ?y' * ?z' = ?x' * (?y' * ?z')

goal (1 subgoal):
 1. x *\<^sub>\<rat> y *\<^sub>\<rat> z = x *\<^sub>\<rat> (y *\<^sub>\<rat> z)
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>\<rat> y *\<^sub>\<rat> z = x *\<^sub>\<rat> (y *\<^sub>\<rat> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>\<rat> y *\<^sub>\<rat> z = x *\<^sub>\<rat> (y *\<^sub>\<rat> z)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem TESL_interpretation_image:
  \<open>\<lbrakk>\<lbrakk> \<Phi> \<rbrakk>\<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Inter> ((\<lambda>\<phi>. \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L) ` set \<Phi>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk> \<Phi> \<rbrakk>\<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Inter> (TESL_interpretation_atomic ` set \<Phi>)
[PROOF STEP]
by (induction \<Phi>, simp+)


[STATEMENT]
lemma pn_atoms_atoms: "atoms F = fst (pn_atoms F) \<union> snd (pn_atoms F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms F = fst (pn_atoms F) \<union> snd (pn_atoms F)
[PROOF STEP]
by(induction F) (auto simp add: prod_unions_def split: prod.splits)


[STATEMENT]
lemma plus_right_mono: "y \<ge> (z :: 'a :: ordered_ab_semigroup) \<Longrightarrow> x + y \<ge> x + z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<le> y \<Longrightarrow> x + z \<le> x + y
[PROOF STEP]
by (simp add: add.commute[of x], rule plus_left_mono, auto)


[STATEMENT]
lemma merge_hd_exists_preserv:
  "\<lbrakk>\<exists>(t1,e1) \<in> fset xs. hd as = (root t1,e1); \<exists>(t1,e1) \<in> fset xs. hd bs = (root t1,e1)\<rbrakk>
    \<Longrightarrow> \<exists>(t1,e1) \<in> fset xs. hd (Sorting_Algorithms.merge cmp as bs) = (root t1,e1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>(t1, e1)\<in>fset xs. hd as = (dtree.root t1, e1); \<exists>(t1, e1)\<in>fset xs. hd bs = (dtree.root t1, e1)\<rbrakk> \<Longrightarrow> \<exists>(t1, e1)\<in>fset xs. hd (Sorting_Algorithms.merge cmp as bs) = (dtree.root t1, e1)
[PROOF STEP]
by(induction as bs rule: Sorting_Algorithms.merge.induct) auto


[STATEMENT]
lemma delete_append_prefix_trie:
  "delete (xs @ ys) (prefix_trie xs t)
   = (if delete ys t = Lf then Lf else prefix_trie xs (delete ys t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. delete (xs @ ys) (prefix_trie xs t) = (if delete ys t = Lf then Lf else prefix_trie xs (delete ys t))
[PROOF STEP]
by(induction xs)(auto simp: prefix_trie_Lf)


[STATEMENT]
lemma has_fps_expansion_exp_neg1 [fps_expansion_intros]:
  "(\<lambda>x::'a :: {banach, real_normed_field}. exp (-x)) has_fps_expansion fps_exp (-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp (- x)) has_fps_expansion fps_exp (- (1::'a))
[PROOF STEP]
using has_fps_expansion_exp[of "-1"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. exp (- (1::?'b1) * x)) has_fps_expansion fps_exp (- (1::?'b1))

goal (1 subgoal):
 1. (\<lambda>x. exp (- x)) has_fps_expansion fps_exp (- (1::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma prod_quotient [quot_thm]:
  assumes "Quotient3 R1 Abs1 Rep1"
  assumes "Quotient3 R2 Abs2 Rep2"
  shows "Quotient3 (rel_prod R1 R2) (map_prod Abs1 Abs2) (map_prod Rep1 Rep2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quotient3 (rel_prod R1 R2) (map_prod Abs1 Abs2) (map_prod Rep1 Rep2)
[PROOF STEP]
apply (rule Quotient3I)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a. map_prod Abs1 Abs2 (map_prod Rep1 Rep2 a) = a
 2. \<And>a. rel_prod R1 R2 (map_prod Rep1 Rep2 a) (map_prod Rep1 Rep2 a)
 3. \<And>r s. rel_prod R1 R2 r s = (rel_prod R1 R2 r r \<and> rel_prod R1 R2 s s \<and> map_prod Abs1 Abs2 r = map_prod Abs1 Abs2 s)
[PROOF STEP]
apply (simp add: map_prod.compositionality comp_def map_prod.identity
     Quotient3_abs_rep [OF assms(1)] Quotient3_abs_rep [OF assms(2)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. rel_prod R1 R2 (map_prod Rep1 Rep2 a) (map_prod Rep1 Rep2 a)
 2. \<And>r s. rel_prod R1 R2 r s = (rel_prod R1 R2 r r \<and> rel_prod R1 R2 s s \<and> map_prod Abs1 Abs2 r = map_prod Abs1 Abs2 s)
[PROOF STEP]
apply (simp add: split_paired_all Quotient3_rel_rep [OF assms(1)] Quotient3_rel_rep [OF assms(2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r s. rel_prod R1 R2 r s = (rel_prod R1 R2 r r \<and> rel_prod R1 R2 s s \<and> map_prod Abs1 Abs2 r = map_prod Abs1 Abs2 s)
[PROOF STEP]
using Quotient3_rel [OF assms(1)] Quotient3_rel [OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
(R1 ?r ?r \<and> R1 ?s ?s \<and> Abs1 ?r = Abs1 ?s) = R1 ?r ?s
(R2 ?r ?r \<and> R2 ?s ?s \<and> Abs2 ?r = Abs2 ?s) = R2 ?r ?s

goal (1 subgoal):
 1. \<And>r s. rel_prod R1 R2 r s = (rel_prod R1 R2 r r \<and> rel_prod R1 R2 s s \<and> map_prod Abs1 Abs2 r = map_prod Abs1 Abs2 s)
[PROOF STEP]
apply (auto simp add: split_paired_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma acc_relfunD:
  assumes "(s, s') \<in> acc"
  obtains n where "((\<lambda> a b. b \<in> K a) ^^ n) s s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. ((\<lambda>a b. b \<in> set_pmf (K a)) ^^ n) s s' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(s, s') \<in> acc

goal (1 subgoal):
 1. (\<And>n. ((\<lambda>a b. b \<in> set_pmf (K a)) ^^ n) s s' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply atomize_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s, s') \<in> acc \<Longrightarrow> \<exists>n. ((\<lambda>a b. b \<in> set_pmf (K a)) ^^ n) s s'
[PROOF STEP]
apply (drule rtrancl_imp_relpow)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. (s, s') \<in> (SIGMA x:UNIV. set_pmf (K x)) ^^ n \<Longrightarrow> \<exists>n. ((\<lambda>a b. b \<in> set_pmf (K a)) ^^ n) s s'
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (s, s') \<in> (SIGMA x:UNIV. set_pmf (K x)) ^^ n \<Longrightarrow> \<exists>n. ((\<lambda>a b. b \<in> set_pmf (K a)) ^^ n) s s'
[PROOF STEP]
subgoal for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s, s') \<in> (SIGMA x:UNIV. set_pmf (K x)) ^^ n \<Longrightarrow> \<exists>n. ((\<lambda>a b. b \<in> set_pmf (K a)) ^^ n) s s'
[PROOF STEP]
by (inst_existentials n) (induction n arbitrary: s'; auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ennreal_of_nat_neq_top[simp]: "of_nat i \<noteq> (top::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat i \<noteq> top
[PROOF STEP]
by (induction i) auto


[STATEMENT]
lemma poly_subst_monomial: "poly_subst f (monomial c t) = punit.monom_mult c 0 (subst_pp f t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_subst f (monomial c t) = punit.monom_mult c 0 (subst_pp f t)
[PROOF STEP]
by (simp add: poly_subst_def lookup_single)


[STATEMENT]
lemma eint_nat_times':
  assumes "(c::eint) \<ge> 0"
  shows "(Suc n)*c \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Suc n * c
[PROOF STEP]
using assms zero_eint_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> eint (int c)
0 = eint 0

goal (1 subgoal):
 1. 0 \<le> Suc n * c
[PROOF STEP]
by fastforce


[STATEMENT]
lemma subset_snd_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> x \<in> A \<Longrightarrow> B \<subseteq> snd ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<times> B \<subseteq> S; x \<in> A\<rbrakk> \<Longrightarrow> B \<subseteq> snd ` S
[PROOF STEP]
unfolding image_def subset_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A \<times> B. x \<in> S; x \<in> A\<rbrakk> \<Longrightarrow> \<forall>x\<in>B. x \<in> {y. \<exists>x\<in>S. y = snd x}
[PROOF STEP]
by force


[STATEMENT]
lemma (in information_space) entropy_partition:
  assumes X: "simple_function M X"
  shows "\<H>(X) = \<H>(f \<circ> X) + \<H>(X|f \<circ> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) = \<H>(f \<circ> X) + \<H>(X | f \<circ> X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<H>(X) = \<H>(f \<circ> X) + \<H>(X | f \<circ> X)
[PROOF STEP]
note fX = simple_function_compose[OF X, of f]
[PROOF STATE]
proof (state)
this:
simple_function M (f \<circ> X)

goal (1 subgoal):
 1. \<H>(X) = \<H>(f \<circ> X) + \<H>(X | f \<circ> X)
[PROOF STEP]
have eq: "(\<lambda>x. ((f \<circ> X) x, X x)) ` space M = (\<lambda>x. (f x, x)) ` X ` space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ((f \<circ> X) x, X x)) ` space M = (\<lambda>x. (f x, x)) ` X ` space M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ((f \<circ> X) x, X x)) ` space M = (\<lambda>x. (f x, x)) ` X ` space M

goal (1 subgoal):
 1. \<H>(X) = \<H>(f \<circ> X) + \<H>(X | f \<circ> X)
[PROOF STEP]
have inj: "\<And>A. inj_on (\<lambda>x. (f x, x)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. inj_on (\<lambda>x. (f x, x)) A
[PROOF STEP]
by (auto simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>x. (f x, x)) ?A13

goal (1 subgoal):
 1. \<H>(X) = \<H>(f \<circ> X) + \<H>(X | f \<circ> X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) = \<H>(f \<circ> X) + \<H>(X | f \<circ> X)
[PROOF STEP]
apply (subst entropy_chain_rule[symmetric, OF fX X])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) = \<H>(\<lambda>x. ((f \<circ> X) x, X x))
[PROOF STEP]
apply (subst entropy_simple_distributed[OF simple_distributedI[OF simple_function_Pair[OF fX X] measure_nonneg refl]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>(X) = - (\<Sum>x\<in>(\<lambda>x. ((f \<circ> X) x, X x)) ` space M. prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M) * log b (prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M)))
[PROOF STEP]
apply (subst entropy_simple_distributed[OF simple_distributedI[OF X measure_nonneg refl]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>x\<in>X ` space M. prob (X -` {x} \<inter> space M) * log b (prob (X -` {x} \<inter> space M))) = - (\<Sum>x\<in>(\<lambda>x. ((f \<circ> X) x, X x)) ` space M. prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M) * log b (prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M)))
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>x\<in>X ` space M. prob (X -` {x} \<inter> space M) * log b (prob (X -` {x} \<inter> space M))) = - (\<Sum>x\<in>(\<lambda>x. (f x, x)) ` X ` space M. prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M) * log b (prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M)))
[PROOF STEP]
apply (subst sum.reindex[OF inj])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>x\<in>X ` space M. prob (X -` {x} \<inter> space M) * log b (prob (X -` {x} \<inter> space M))) = - sum ((\<lambda>x. prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M) * log b (prob ((\<lambda>x. ((f \<circ> X) x, X x)) -` {x} \<inter> space M))) \<circ> (\<lambda>x. (f x, x))) (X ` space M)
[PROOF STEP]
apply (auto intro!: sum.cong arg_cong[where f="\<lambda>A. prob A * log b (prob A)"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<H>(X) = \<H>(f \<circ> X) + \<H>(X | f \<circ> X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VSigma_iff [simp]: "\<langle>a,b\<rangle> \<in> elts (VSigma A B) \<longleftrightarrow> a \<in> elts A \<and> b \<in> elts (B a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>a, b\<rangle> \<in> elts (VSigma A B)) = (a \<in> elts A \<and> b \<in> elts (B a))
[PROOF STEP]
by (auto simp: VSigma_def UNION_singleton_eq_range)


[STATEMENT]
lemma sterms_sterms [simp]:
  assumes "wellformed \<Gamma>"
    shows "(\<Union>x\<in>sterms \<Gamma> p. sterms \<Gamma> x) = sterms \<Gamma> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (sterms \<Gamma> ` sterms \<Gamma> p) = sterms \<Gamma> p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wellformed \<Gamma>

goal (1 subgoal):
 1. \<Union> (sterms \<Gamma> ` sterms \<Gamma> p) = sterms \<Gamma> p
[PROOF STEP]
by induction simp_all


[STATEMENT]
lemma HInfinite_hypreal_sqrt_imp_HInfinite:
     "\<lbrakk>0 \<le> x; ( *f* sqrt) x \<in> HInfinite\<rbrakk> \<Longrightarrow> x \<in> HInfinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; (*f* sqrt) x \<in> HInfinite\<rbrakk> \<Longrightarrow> x \<in> HInfinite
[PROOF STEP]
using HFinite_hypreal_sqrt_iff HInfinite_HFinite_iff
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?x \<Longrightarrow> ((*f* sqrt) ?x \<in> HFinite) = (?x \<in> HFinite)
(?x \<in> HInfinite) = (?x \<notin> HFinite)

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; (*f* sqrt) x \<in> HInfinite\<rbrakk> \<Longrightarrow> x \<in> HInfinite
[PROOF STEP]
by blast


[STATEMENT]
lemma landau_symbol_at_top_imp_at_left:
  "(\<lambda>x. f (a - inverse x)) \<in> L' at_top (\<lambda>x. g (a - inverse x)) \<Longrightarrow> f \<in> L (at_left a) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (a - inverse x)) \<in> L' at_top (\<lambda>x. g (a - inverse x)) \<Longrightarrow> f \<in> L (at_left a) g
[PROOF STEP]
by (simp add: in_filtermap_iff at_left_to_top')


[STATEMENT]
lemma cf_cn_cov_comp_ArrMap_vdomain[cat_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<D>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
interpret L: is_functor \<alpha> \<open>op_cat \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_cat \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
interpret R: is_functor \<alpha> \<AA> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
by
      (
        rule smcf_cn_cov_comp_ArrMap_vdomain
          [
            OF
              L.cf_is_semifunctor[unfolded slicing_commute[symmetric]]
              R.cf_is_semifunctor,
            unfolded slicing_commute slicing_simps
          ]
      )
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> ((\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma append_cols_mult_right_id2:
 assumes A: "(A::'a::semiring_1 mat) \<in> carrier_mat n a"
   and B: "B \<in> carrier_mat n b"
   and C: "C = four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)"
   and D: "D \<in> carrier_mat a a"
shows "(A @\<^sub>c B) * C = (A * D) @\<^sub>c B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
let ?C = "four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
have "(A @\<^sub>c B) * C = (A @\<^sub>c B) * ?C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = (A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)
[PROOF STEP]
unfolding C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = (A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * C = (A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * C = (A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
have "... = four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * ?C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n a
B \<in> carrier_mat n b

goal (1 subgoal):
 1. four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
have "... = four_block_mat (A * D + B * 0\<^sub>m b a) (A * 0\<^sub>m a b + B * 1\<^sub>m b)
    (0\<^sub>m 0 a * D + 0\<^sub>m 0 b * 0\<^sub>m b a) (0\<^sub>m 0 a * 0\<^sub>m a b + 0\<^sub>m 0 b * 1\<^sub>m b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat (A * D + B * 0\<^sub>m b a) (A * 0\<^sub>m a b + B * 1\<^sub>m b) (0\<^sub>m 0 a * D + 0\<^sub>m 0 b * 0\<^sub>m b a) (0\<^sub>m 0 a * 0\<^sub>m a b + 0\<^sub>m 0 b * 1\<^sub>m b)
[PROOF STEP]
by (rule mult_four_block_mat, insert A B C D, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat (A * D + B * 0\<^sub>m b a) (A * 0\<^sub>m a b + B * 1\<^sub>m b) (0\<^sub>m 0 a * D + 0\<^sub>m 0 b * 0\<^sub>m b a) (0\<^sub>m 0 a * 0\<^sub>m a b + 0\<^sub>m 0 b * 1\<^sub>m b)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat A B (0\<^sub>m 0 a) (0\<^sub>m 0 b) * four_block_mat D (0\<^sub>m a b) (0\<^sub>m b a) (1\<^sub>m b) = four_block_mat (A * D + B * 0\<^sub>m b a) (A * 0\<^sub>m a b + B * 1\<^sub>m b) (0\<^sub>m 0 a * D + 0\<^sub>m 0 b * 0\<^sub>m b a) (0\<^sub>m 0 a * 0\<^sub>m a b + 0\<^sub>m 0 b * 1\<^sub>m b)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
have "... = four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A*D))) (0\<^sub>m 0 (dim_col B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (A * D + B * 0\<^sub>m b a) (A * 0\<^sub>m a b + B * 1\<^sub>m b) (0\<^sub>m 0 a * D + 0\<^sub>m 0 b * 0\<^sub>m b a) (0\<^sub>m 0 a * 0\<^sub>m a b + 0\<^sub>m 0 b * 1\<^sub>m b) = four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A * D))) (0\<^sub>m 0 (dim_col B))
[PROOF STEP]
by (rule cong_four_block_mat, insert assms, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat (A * D + B * 0\<^sub>m b a) (A * 0\<^sub>m a b + B * 1\<^sub>m b) (0\<^sub>m 0 a * D + 0\<^sub>m 0 b * 0\<^sub>m b a) (0\<^sub>m 0 a * 0\<^sub>m a b + 0\<^sub>m 0 b * 1\<^sub>m b) = four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A * D))) (0\<^sub>m 0 (dim_col B))

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat (A * D + B * 0\<^sub>m b a) (A * 0\<^sub>m a b + B * 1\<^sub>m b) (0\<^sub>m 0 a * D + 0\<^sub>m 0 b * 0\<^sub>m b a) (0\<^sub>m 0 a * 0\<^sub>m a b + 0\<^sub>m 0 b * 1\<^sub>m b) = four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A * D))) (0\<^sub>m 0 (dim_col B))

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
have "... = (A * D) @\<^sub>c B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A * D))) (0\<^sub>m 0 (dim_col B)) = A * D @\<^sub>c B
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A * D))) (0\<^sub>m 0 (dim_col B)) = four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A * D))) (0\<^sub>m 0 (dim_col B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_mat (A * D) B (0\<^sub>m 0 (dim_col (A * D))) (0\<^sub>m 0 (dim_col B)) = A * D @\<^sub>c B

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(A @\<^sub>c B) * C = A * D @\<^sub>c B

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A * D @\<^sub>c B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * C = A * D @\<^sub>c B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma contour_integral_local_primitive:
  fixes f :: "complex \<Rightarrow> complex"
  assumes g: "valid_path g" "path_image g \<subseteq> S"
      and dh: "\<And>x. x \<in> S
               \<Longrightarrow> \<exists>d h. 0 < d \<and>
                         (\<forall>y. norm(y - x) < d \<longrightarrow> (h has_field_derivative f y) (at y within S))"
    shows "f contour_integrable_on g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f contour_integrable_on g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f contour_integrable_on g
[PROOF STEP]
have "(\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}
[PROOF STEP]
using contour_integral_local_primitive_any [OF _ dh] g
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?g piecewise_differentiable_on {?a..?b}; \<And>x. x \<in> S \<Longrightarrow> x \<in> S; \<And>x. x \<in> {?a..?b} \<Longrightarrow> ?g x \<in> S\<rbrakk> \<Longrightarrow> (\<lambda>x. f (?g x) * vector_derivative ?g (at x)) integrable_on {?a..?b}
valid_path g
path_image g \<subseteq> S

goal (1 subgoal):
 1. (\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}
[PROOF STEP]
unfolding path_image_def valid_path_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?g piecewise_differentiable_on {?a..?b}; \<And>x. x \<in> S \<Longrightarrow> x \<in> S; \<And>x. x \<in> {?a..?b} \<Longrightarrow> ?g x \<in> S\<rbrakk> \<Longrightarrow> (\<lambda>x. f (?g x) * vector_derivative ?g (at x)) integrable_on {?a..?b}
g piecewise_C1_differentiable_on {0..1}
g ` {0..1} \<subseteq> S

goal (1 subgoal):
 1. (\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}
[PROOF STEP]
by (metis (no_types, lifting) image_subset_iff piecewise_C1_imp_differentiable)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}

goal (1 subgoal):
 1. f contour_integrable_on g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}

goal (1 subgoal):
 1. f contour_integrable_on g
[PROOF STEP]
using contour_integrable_on
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {0..1}
(?f contour_integrable_on ?g) = ((\<lambda>t. ?f (?g t) * vector_derivative ?g (at t)) integrable_on {0..1})

goal (1 subgoal):
 1. f contour_integrable_on g
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
f contour_integrable_on g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) subgroup_carrier_complementary:
  assumes "complementary H J" "subgroup I (G\<lparr>carrier := H\<rparr>)" "subgroup K (G\<lparr>carrier := J\<rparr>)"
  shows "complementary I K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complementary I K
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. complementary I K
[PROOF STEP]
have "\<one> \<in> I"  "\<one> \<in> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one> \<in> I &&& \<one> \<in> K
[PROOF STEP]
using subgroup.one_closed assms
[PROOF STATE]
proof (prove)
using this:
subgroup ?H ?G \<Longrightarrow> \<one>\<^bsub>?G\<^esub> \<in> ?H
complementary H J
subgroup I (G\<lparr>carrier := H\<rparr>)
subgroup K (G\<lparr>carrier := J\<rparr>)

goal (1 subgoal):
 1. \<one> \<in> I &&& \<one> \<in> K
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
\<one> \<in> I
\<one> \<in> K

goal (1 subgoal):
 1. complementary I K
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<one> \<in> I
\<one> \<in> K

goal (1 subgoal):
 1. complementary I K
[PROOF STEP]
have "I \<inter> K \<subseteq> H \<inter> J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<inter> K \<subseteq> H \<inter> J
[PROOF STEP]
using subgroup.subset assms
[PROOF STATE]
proof (prove)
using this:
subgroup ?H ?G \<Longrightarrow> ?H \<subseteq> carrier ?G
complementary H J
subgroup I (G\<lparr>carrier := H\<rparr>)
subgroup K (G\<lparr>carrier := J\<rparr>)

goal (1 subgoal):
 1. I \<inter> K \<subseteq> H \<inter> J
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
I \<inter> K \<subseteq> H \<inter> J

goal (1 subgoal):
 1. complementary I K
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<one> \<in> I
\<one> \<in> K
I \<inter> K \<subseteq> H \<inter> J
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<one> \<in> I
\<one> \<in> K
I \<inter> K \<subseteq> H \<inter> J

goal (1 subgoal):
 1. complementary I K
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<one> \<in> I
\<one> \<in> K
I \<inter> K \<subseteq> H \<inter> J
complementary H J
subgroup I (G\<lparr>carrier := H\<rparr>)
subgroup K (G\<lparr>carrier := J\<rparr>)

goal (1 subgoal):
 1. complementary I K
[PROOF STEP]
unfolding complementary_def
[PROOF STATE]
proof (prove)
using this:
\<one> \<in> I
\<one> \<in> K
I \<inter> K \<subseteq> H \<inter> J
H \<inter> J = {\<one>}
subgroup I (G\<lparr>carrier := H\<rparr>)
subgroup K (G\<lparr>carrier := J\<rparr>)

goal (1 subgoal):
 1. I \<inter> K = {\<one>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
complementary I K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_eq_univariate_degree: "MPoly_Type.degree p v =
    (if p = 0 then 0 else Polynomial.degree (mpoly_to_nested_poly p v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.degree p v = (if p = 0 then 0 else Polynomial.degree (mpoly_to_nested_poly p v))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> MPoly_Type.degree p v = Polynomial.degree (mpoly_to_nested_poly p v)
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. p \<noteq> 0 \<Longrightarrow> MPoly_Type.degree p v \<le> Polynomial.degree (mpoly_to_nested_poly p v)
 2. p \<noteq> 0 \<Longrightarrow> Polynomial.degree (mpoly_to_nested_poly p v) \<le> MPoly_Type.degree p v
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> MPoly_Type.degree p v \<le> Polynomial.degree (mpoly_to_nested_poly p v)
[PROOF STEP]
apply (rule Polynomial.le_degree)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> poly.coeff (mpoly_to_nested_poly p v) (MPoly_Type.degree p v) \<noteq> 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<noteq> 0; poly.coeff (mpoly_to_nested_poly p v) (MPoly_Type.degree p v) = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply transfer'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p v. \<lbrakk>p \<noteq> 0; isolate_variable_sparse p v (MPoly_Type.degree p v) = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (simp add: isolate_variable_sparse_degree_eq_zero_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> Polynomial.degree (mpoly_to_nested_poly p v) \<le> MPoly_Type.degree p v
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> Polynomial.degree (mpoly_to_nested_poly p v) \<le> MPoly_Type.degree p v
[PROOF STEP]
apply (rule Polynomial.degree_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<forall>i>MPoly_Type.degree p v. poly.coeff (mpoly_to_nested_poly p v) i = 0
[PROOF STEP]
apply (auto simp: elim!: degree_eq_zeroE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>p \<noteq> 0; MPoly_Type.degree p v < i\<rbrakk> \<Longrightarrow> poly.coeff (mpoly_to_nested_poly p v) i = 0
[PROOF STEP]
apply transfer'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i p v. \<lbrakk>p \<noteq> 0; MPoly_Type.degree p v < i\<rbrakk> \<Longrightarrow> isolate_variable_sparse p v i = 0
[PROOF STEP]
by (simp add: isovar_greater_degree)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_count_list_pos:
  assumes "x \<in> set as"
  shows "real (count_list as x) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < real (count_list as x)
[PROOF STEP]
using count_list_gr_1 assms
[PROOF STATE]
proof (prove)
using this:
(?x \<in> set ?xs) = (1 \<le> count_list ?xs ?x)
x \<in> set as

goal (1 subgoal):
 1. 0 < real (count_list as x)
[PROOF STEP]
by force


[STATEMENT]
lemma continuous_image_closed_interval:
  fixes a b and f :: "real \<Rightarrow> real"
  defines "S \<equiv> {a..b}"
  assumes "a \<le> b" and f: "continuous_on S f"
  shows "\<exists>c d. f`S = {c..d} \<and> c \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
have S: "compact S" "S \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact S &&& S \<noteq> {}
[PROOF STEP]
using \<open>a \<le> b\<close>
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. compact S &&& S \<noteq> {}
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
compact S
S \<noteq> {}

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
obtain c where "c \<in> S" "\<forall>d\<in>S. f d \<le> f c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<in> S; \<forall>d\<in>S. f d \<le> f c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using continuous_attains_sup[OF S f]
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. \<forall>y\<in>S. f y \<le> f x

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<in> S; \<forall>d\<in>S. f d \<le> f c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<in> S
\<forall>d\<in>S. f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c \<in> S
\<forall>d\<in>S. f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
obtain d where "d \<in> S" "\<forall>c\<in>S. f d \<le> f c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>d \<in> S; \<forall>c\<in>S. f d \<le> f c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using continuous_attains_inf[OF S f]
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. \<forall>y\<in>S. f x \<le> f y

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>d \<in> S; \<forall>c\<in>S. f d \<le> f c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d \<in> S
\<forall>c\<in>S. f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
d \<in> S
\<forall>c\<in>S. f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
have "connected (f`S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (f ` S)
[PROOF STEP]
using connected_continuous_image[OF f] connected_Icc
[PROOF STATE]
proof (prove)
using this:
connected S \<Longrightarrow> connected (f ` S)
connected {?a..?b}

goal (1 subgoal):
 1. connected (f ` S)
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
connected (f ` S)

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c \<in> S
\<forall>d\<in>S. f d \<le> f c
d \<in> S
\<forall>c\<in>S. f d \<le> f c
connected (f ` S)
[PROOF STEP]
have "f ` S = {f d .. f c} \<and> f d \<le> f c"
[PROOF STATE]
proof (prove)
using this:
c \<in> S
\<forall>d\<in>S. f d \<le> f c
d \<in> S
\<forall>c\<in>S. f d \<le> f c
connected (f ` S)

goal (1 subgoal):
 1. f ` S = {f d..f c} \<and> f d \<le> f c
[PROOF STEP]
by (auto simp: connected_iff_interval)
[PROOF STATE]
proof (state)
this:
f ` S = {f d..f c} \<and> f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ` S = {f d..f c} \<and> f d \<le> f c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f ` S = {f d..f c} \<and> f d \<le> f c

goal (1 subgoal):
 1. \<exists>c d. f ` S = {c..d} \<and> c \<le> d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c d. f ` S = {c..d} \<and> c \<le> d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_col_last_dim[simp]:
  "dim_row (mat_col_last A n) = dim_row A"
  "dim_col (mat_col_last A n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_col_last A n) = dim_row A &&& dim_col (mat_col_last A n) = n
[PROOF STEP]
unfolding mat_col_last_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_row_last A\<^sup>T n)\<^sup>T = dim_row A &&& dim_col (mat_row_last A\<^sup>T n)\<^sup>T = n
[PROOF STEP]
by simp_all


[STATEMENT]
lemma directed_extend:
  assumes X: "directed X (\<sqsubseteq>)" and Y: "directed Y (\<sqsubseteq>)" and XY: "\<forall>x\<in>X. \<forall>y\<in>Y. x \<sqsubseteq> y"
  shows "directed (X \<union> Y) (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
assume xX: "x \<in> X" and yY: "y \<in> Y"
[PROOF STATE]
proof (state)
this:
x \<in> X
y \<in> Y

goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
let ?g = "\<exists>z\<in>X \<union> Y. x \<sqsubseteq> z \<and> y \<sqsubseteq> z"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
from directedD[OF Y yY yY]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z\<in>Y. y \<sqsubseteq> z \<and> y \<sqsubseteq> z
[PROOF STEP]
obtain z where zY: "z \<in> Y" and yz: "y \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
using this:
\<exists>z\<in>Y. y \<sqsubseteq> z \<and> y \<sqsubseteq> z

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> Y; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> Y
y \<sqsubseteq> z

goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
from xX XY zY yz
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
\<forall>x\<in>X. \<forall>y\<in>Y. x \<sqsubseteq> y
z \<in> Y
y \<sqsubseteq> z
[PROOF STEP]
have ?g
[PROOF STATE]
proof (prove)
using this:
x \<in> X
\<forall>x\<in>X. \<forall>y\<in>Y. x \<sqsubseteq> y
z \<in> Y
y \<sqsubseteq> z

goal (1 subgoal):
 1. \<exists>z\<in>X \<union> Y. x \<sqsubseteq> z \<and> y \<sqsubseteq> z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z\<in>X \<union> Y. x \<sqsubseteq> z \<and> y \<sqsubseteq> z

goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x2 \<in> X; ?y2 \<in> Y\<rbrakk> \<Longrightarrow> \<exists>z\<in>X \<union> Y. ?x2 \<sqsubseteq> z \<and> ?y2 \<sqsubseteq> z

goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x2 \<in> X; ?y2 \<in> Y\<rbrakk> \<Longrightarrow> \<exists>z\<in>X \<union> Y. ?x2 \<sqsubseteq> z \<and> ?y2 \<sqsubseteq> z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x2 \<in> X; ?y2 \<in> Y\<rbrakk> \<Longrightarrow> \<exists>z\<in>X \<union> Y. ?x2 \<sqsubseteq> z \<and> ?y2 \<sqsubseteq> z

goal (1 subgoal):
 1. directed (X \<union> Y) (\<sqsubseteq>)
[PROOF STEP]
by (auto intro!: directed_union[OF X Y])
[PROOF STATE]
proof (state)
this:
directed (X \<union> Y) (\<sqsubseteq>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_add:  "take (i+j) xs = take i xs @ take j (drop i xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take (i + j) xs = take i xs @ take j (drop i xs)
[PROOF STEP]
proof (induct xs arbitrary: i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. take (i + j) [] = take i [] @ take j (drop i [])
 2. \<And>a xs i. (\<And>i. take (i + j) xs = take i xs @ take j (drop i xs)) \<Longrightarrow> take (i + j) (a # xs) = take i (a # xs) @ take j (drop i (a # xs))
[PROOF STEP]
case (Cons x xs i)
[PROOF STATE]
proof (state)
this:
take (?i + j) xs = take ?i xs @ take j (drop ?i xs)

goal (2 subgoals):
 1. \<And>i. take (i + j) [] = take i [] @ take j (drop i [])
 2. \<And>a xs i. (\<And>i. take (i + j) xs = take i xs @ take j (drop i xs)) \<Longrightarrow> take (i + j) (a # xs) = take i (a # xs) @ take j (drop i (a # xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take (?i + j) xs = take ?i xs @ take j (drop ?i xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
take (?i + j) xs = take ?i xs @ take j (drop ?i xs)

goal (1 subgoal):
 1. take (i + j) (x # xs) = take i (x # xs) @ take j (drop i (x # xs))
[PROOF STEP]
by (cases i, auto)
[PROOF STATE]
proof (state)
this:
take (i + j) (x # xs) = take i (x # xs) @ take j (drop i (x # xs))

goal (1 subgoal):
 1. \<And>i. take (i + j) [] = take i [] @ take j (drop i [])
[PROOF STEP]
qed auto


[STATEMENT]
lemma not_alw_iff: "\<not> (alw P \<omega>) \<longleftrightarrow> ev (not P) \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> alw P \<omega>) = ev (\<lambda>xs. \<not> P xs) \<omega>
[PROOF STEP]
using not_alw[of P]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xs. \<not> alw P xs) = ev (\<lambda>xs. \<not> P xs)

goal (1 subgoal):
 1. (\<not> alw P \<omega>) = ev (\<lambda>xs. \<not> P xs) \<omega>
[PROOF STEP]
by (simp add: fun_eq_iff)


[STATEMENT]
lemma phi_finite: "finite (dom (phi g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
let ?f = "\<lambda>v. (defNode g v,v)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
have "phi g = phis g \<circ> ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phi g = phis g \<circ> (\<lambda>v. (defNode g v, v))
[PROOF STEP]
by (auto simp add:phi_def)
[PROOF STATE]
proof (state)
this:
phi g = phis g \<circ> (\<lambda>v. (defNode g v, v))

goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
phi g = phis g \<circ> (\<lambda>v. (defNode g v, v))

goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
have "inj ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>v. (defNode g v, v))
[PROOF STEP]
by (auto intro:injI)
[PROOF STATE]
proof (state)
this:
inj (\<lambda>v. (defNode g v, v))

goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
hence "finite (dom (phis g \<circ> ?f))"
[PROOF STATE]
proof (prove)
using this:
inj (\<lambda>v. (defNode g v, v))

goal (1 subgoal):
 1. finite (dom (phis g \<circ> (\<lambda>v. (defNode g v, v))))
[PROOF STEP]
by - (rule finite_dom_comp, auto simp add:phis_finite inj_on_def)
[PROOF STATE]
proof (state)
this:
finite (dom (phis g \<circ> (\<lambda>v. (defNode g v, v))))

goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
phi g = phis g \<circ> (\<lambda>v. (defNode g v, v))
finite (dom (phis g \<circ> (\<lambda>v. (defNode g v, v))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
phi g = phis g \<circ> (\<lambda>v. (defNode g v, v))
finite (dom (phis g \<circ> (\<lambda>v. (defNode g v, v))))

goal (1 subgoal):
 1. finite (dom (phi g))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (dom (phi g))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enumerator_correctness: "2 < m \<Longrightarrow> 1 < nmax \<Longrightarrow>
  ls \<in> set (enumerator m nmax) \<Longrightarrow>
  incrIndexList ls m nmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>2 < m; 1 < nmax; ls \<in> set (enumerator m nmax)\<rbrakk> \<Longrightarrow> incrIndexList ls m nmax
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>2 < m; 1 < nmax; ls \<in> set (enumerator m nmax)\<rbrakk> \<Longrightarrow> incrIndexList ls m nmax
[PROOF STEP]
assume m: "2 < m" and nmax: "1 < nmax" and enum: "ls \<in> set (enumerator m nmax)"
[PROOF STATE]
proof (state)
this:
2 < m
1 < nmax
ls \<in> set (enumerator m nmax)

goal (1 subgoal):
 1. \<lbrakk>2 < m; 1 < nmax; ls \<in> set (enumerator m nmax)\<rbrakk> \<Longrightarrow> incrIndexList ls m nmax
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 < m
1 < nmax
ls \<in> set (enumerator m nmax)
[PROOF STEP]
have "(hd ls = 0 \<and> last ls = (nmax - 1) \<and> length ls = m \<and> last (butlast ls) < last ls \<and>  increasing ls)"
[PROOF STATE]
proof (prove)
using this:
2 < m
1 < nmax
ls \<in> set (enumerator m nmax)

goal (1 subgoal):
 1. hd ls = 0 \<and> last ls = nmax - 1 \<and> |ls| = m \<and> last (butlast ls) < last ls \<and> increasing ls
[PROOF STEP]
by (auto intro: enumerator_increasing enumerator_hd enumerator_last enumerator_length2 enumerator_bound3 simp: set_enumerator_simps)
[PROOF STATE]
proof (state)
this:
hd ls = 0 \<and> last ls = nmax - 1 \<and> |ls| = m \<and> last (butlast ls) < last ls \<and> increasing ls

goal (1 subgoal):
 1. \<lbrakk>2 < m; 1 < nmax; ls \<in> set (enumerator m nmax)\<rbrakk> \<Longrightarrow> incrIndexList ls m nmax
[PROOF STEP]
with m nmax
[PROOF STATE]
proof (chain)
picking this:
2 < m
1 < nmax
hd ls = 0 \<and> last ls = nmax - 1 \<and> |ls| = m \<and> last (butlast ls) < last ls \<and> increasing ls
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 < m
1 < nmax
hd ls = 0 \<and> last ls = nmax - 1 \<and> |ls| = m \<and> last (butlast ls) < last ls \<and> increasing ls

goal (1 subgoal):
 1. incrIndexList ls m nmax
[PROOF STEP]
by (unfold incrIndexList_def) auto
[PROOF STATE]
proof (state)
this:
incrIndexList ls m nmax

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma partn_lst_VWF_imp_partn_lst_eq:
  assumes part: "partn_lst_VWF \<beta> \<alpha> n" and \<beta>: "ordertype U r = \<beta>" "small U"
    and r: "wf r" "trans r" "total_on U r"
  shows "partn_lst r U \<alpha> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partitions.partn_lst r U \<alpha> n
[PROOF STEP]
unfolding partn_lst_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>[U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}. \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
assume f: "f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}"
[PROOF STATE]
proof (state)
this:
f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
define cv where "cv \<equiv> \<lambda>X. inv_into U (ordermap U r) ` X"
[PROOF STATE]
proof (state)
this:
cv \<equiv> (`) (inv_into U (ordermap U r))

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
have bij: "bij_betw (ordermap U r) U (elts \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (ordermap U r) U (elts \<beta>)
[PROOF STEP]
using ordermap_bij [of "r" U] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>wf r; total_on U r; small U\<rbrakk> \<Longrightarrow> bij_betw (ordermap U r) U (elts (ordertype U r))
partn_lst_VWF \<beta> \<alpha> n
ordertype U r = \<beta>
small U
wf r
trans r
total_on U r

goal (1 subgoal):
 1. bij_betw (ordermap U r) U (elts \<beta>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw (ordermap U r) U (elts \<beta>)

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw (ordermap U r) U (elts \<beta>)
[PROOF STEP]
have bij_cv: "bij_betw cv ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
using this:
bij_betw (ordermap U r) U (elts \<beta>)

goal (1 subgoal):
 1. bij_betw cv ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)
[PROOF STEP]
using bij_betw_nsets bij_betw_inv_into
[PROOF STATE]
proof (prove)
using this:
bij_betw (ordermap U r) U (elts \<beta>)
bij_betw ?f ?A ?B \<Longrightarrow> bij_betw ((`) ?f) ([?A]\<^bsup>?n\<^esup>) ([?B]\<^bsup>?n\<^esup>)
bij_betw ?f ?A ?B \<Longrightarrow> bij_betw (inv_into ?A ?f) ?B ?A

goal (1 subgoal):
 1. bij_betw cv ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)
[PROOF STEP]
unfolding cv_def
[PROOF STATE]
proof (prove)
using this:
bij_betw (ordermap U r) U (elts \<beta>)
bij_betw ?f ?A ?B \<Longrightarrow> bij_betw ((`) ?f) ([?A]\<^bsup>?n\<^esup>) ([?B]\<^bsup>?n\<^esup>)
bij_betw ?f ?A ?B \<Longrightarrow> bij_betw (inv_into ?A ?f) ?B ?A

goal (1 subgoal):
 1. bij_betw ((`) (inv_into U (ordermap U r))) ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw cv ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw cv ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)
[PROOF STEP]
have func: "f \<circ> cv \<in> [elts \<beta>]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}"
[PROOF STATE]
proof (prove)
using this:
bij_betw cv ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. f \<circ> cv \<in> [elts \<beta>]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}
[PROOF STEP]
using bij_betw_apply f
[PROOF STATE]
proof (prove)
using this:
bij_betw cv ([elts \<beta>]\<^bsup>n\<^esup>) ([U]\<^bsup>n\<^esup>)
\<lbrakk>bij_betw ?f ?A ?B; ?a \<in> ?A\<rbrakk> \<Longrightarrow> ?f ?a \<in> ?B
f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}

goal (1 subgoal):
 1. f \<circ> cv \<in> [elts \<beta>]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f \<circ> cv \<in> [elts \<beta>]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
have "inj_on (ordermap U r) U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (ordermap U r) U
[PROOF STEP]
using bij bij_betw_def
[PROOF STATE]
proof (prove)
using this:
bij_betw (ordermap U r) U (elts \<beta>)
bij_betw ?f ?A ?B = (inj_on ?f ?A \<and> ?f ` ?A = ?B)

goal (1 subgoal):
 1. inj_on (ordermap U r) U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on (ordermap U r) U

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on (ordermap U r) U
[PROOF STEP]
have cv_part: "\<lbrakk>\<forall>x\<in>[X]\<^bsup>n\<^esup>. f (cv x) = i; X \<subseteq> elts \<beta>; a \<in> [cv X]\<^bsup>n\<^esup>\<rbrakk> \<Longrightarrow> f a = i" for a X i n
[PROOF STATE]
proof (prove)
using this:
inj_on (ordermap U r) U

goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>[X]\<^bsup>n\<^esup>. f (cv x) = i; X \<subseteq> elts \<beta>; a \<in> [cv X]\<^bsup>n\<^esup>\<rbrakk> \<Longrightarrow> f a = i
[PROOF STEP]
apply ( simp add: cv_def nsets_def subset_image_iff inj_on_subset finite_image_iff card_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. x \<subseteq> X \<and> finite x \<and> card x = n \<longrightarrow> f (inv_into U (ordermap U r) ` x) = i; X \<subseteq> elts \<beta>; (\<exists>AA\<subseteq>X. a = inv_into U (ordermap U r) ` AA) \<and> finite a \<and> card a = n; inj_on (ordermap U r) U\<rbrakk> \<Longrightarrow> f a = i
[PROOF STEP]
by (metis bij bij_betw_def card_image inj_on_finite inj_on_inv_into subset_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>x\<in>[?X]\<^bsup>?n\<^esup>. f (cv x) = ?i; ?X \<subseteq> elts \<beta>; ?a \<in> [cv ?X]\<^bsup>?n\<^esup>\<rbrakk> \<Longrightarrow> f ?a = ?i

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
have ot_eq [simp]: "ordertype (cv X) r = tp X" if "X \<subseteq> elts \<beta>" for X
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (cv X) r = tp X
[PROOF STEP]
unfolding cv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (inv_into U (ordermap U r) ` X) r = tp X
[PROOF STEP]
proof (rule ordertype_inc_eq)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. small X
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X; (x, y) \<in> VWF\<rbrakk> \<Longrightarrow> (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
 3. wf VWF
 4. total_on X VWF
 5. wf r
[PROOF STEP]
show "small X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small X
[PROOF STEP]
using down that
[PROOF STATE]
proof (prove)
using this:
?Y \<subseteq> elts ?x \<Longrightarrow> small ?Y
X \<subseteq> elts \<beta>

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

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X; (x, y) \<in> VWF\<rbrakk> \<Longrightarrow> (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
 2. wf VWF
 3. total_on X VWF
 4. wf r
[PROOF STEP]
show "(inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r"
      if "x \<in> X" "y \<in> X" and "(x,y) \<in> VWF" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
[PROOF STEP]
have xy: "x \<in> ordermap U r ` U" "y \<in> ordermap U r ` U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> ordermap U r ` U &&& y \<in> ordermap U r ` U
[PROOF STEP]
using \<open>X \<subseteq> elts \<beta>\<close> \<open>x \<in> X\<close> \<open>y \<in> X\<close> bij bij_betw_imp_surj_on
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> elts \<beta>
x \<in> X
y \<in> X
bij_betw (ordermap U r) U (elts \<beta>)
bij_betw ?f ?A ?B \<Longrightarrow> ?f ` ?A = ?B

goal (1 subgoal):
 1. x \<in> ordermap U r ` U &&& y \<in> ordermap U r ` U
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
x \<in> ordermap U r ` U
y \<in> ordermap U r ` U

goal (1 subgoal):
 1. (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> ordermap U r ` U
y \<in> ordermap U r ` U
[PROOF STEP]
have eq: "ordermap U r (inv_into U (ordermap U r) x) = x" "ordermap U r (inv_into U (ordermap U r) y) = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> ordermap U r ` U
y \<in> ordermap U r ` U

goal (1 subgoal):
 1. ordermap U r (inv_into U (ordermap U r) x) = x &&& ordermap U r (inv_into U (ordermap U r) y) = y
[PROOF STEP]
by (meson f_inv_into_f)+
[PROOF STATE]
proof (state)
this:
ordermap U r (inv_into U (ordermap U r) x) = x
ordermap U r (inv_into U (ordermap U r) y) = y

goal (1 subgoal):
 1. (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ordermap U r (inv_into U (ordermap U r) x) = x
ordermap U r (inv_into U (ordermap U r) y) = y
[PROOF STEP]
have "y \<notin> elts x"
[PROOF STATE]
proof (prove)
using this:
ordermap U r (inv_into U (ordermap U r) x) = x
ordermap U r (inv_into U (ordermap U r) y) = y

goal (1 subgoal):
 1. y \<notin> elts x
[PROOF STEP]
by (metis (no_types) VWF_non_refl mem_imp_VWF that(3) trans_VWF trans_def)
[PROOF STATE]
proof (state)
this:
y \<notin> elts x

goal (1 subgoal):
 1. (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<notin> elts x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<notin> elts x

goal (1 subgoal):
 1. (inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r
[PROOF STEP]
by (metis (no_types) VWF_non_refl xy eq assms(3) inv_into_into ordermap_mono r(1) r(3) that(3) total_on_def)
[PROOF STATE]
proof (state)
this:
(inv_into U (ordermap U r) x, inv_into U (ordermap U r) y) \<in> r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> X; ?y \<in> X; (?x, ?y) \<in> VWF\<rbrakk> \<Longrightarrow> (inv_into U (ordermap U r) ?x, inv_into U (ordermap U r) ?y) \<in> r

goal (3 subgoals):
 1. wf VWF
 2. total_on X VWF
 3. wf r
[PROOF STEP]
qed (use r in auto)
[PROOF STATE]
proof (state)
this:
?X \<subseteq> elts \<beta> \<Longrightarrow> ordertype (cv ?X) r = tp ?X

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
obtain X i where "X \<subseteq> elts \<beta>" and X: "tp X = \<alpha>!i" "(f \<circ> cv) ` [X]\<^bsup>n\<^esup> \<subseteq> {i}"
    and "i < length \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X i. \<lbrakk>X \<subseteq> elts \<beta>; tp X = \<alpha> ! i; (f \<circ> cv) ` [X]\<^bsup>n\<^esup> \<subseteq> {i}; i < length \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using part func
[PROOF STATE]
proof (prove)
using this:
partn_lst_VWF \<beta> \<alpha> n
f \<circ> cv \<in> [elts \<beta>]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>}

goal (1 subgoal):
 1. (\<And>X i. \<lbrakk>X \<subseteq> elts \<beta>; tp X = \<alpha> ! i; (f \<circ> cv) ` [X]\<^bsup>n\<^esup> \<subseteq> {i}; i < length \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: partn_lst_def)
[PROOF STATE]
proof (state)
this:
X \<subseteq> elts \<beta>
tp X = \<alpha> ! i
(f \<circ> cv) ` [X]\<^bsup>n\<^esup> \<subseteq> {i}
i < length \<alpha>

goal (1 subgoal):
 1. \<And>f. f \<in> [U]\<^bsup>n\<^esup> \<rightarrow> {..<length \<alpha>} \<Longrightarrow> \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
show "\<exists>i < length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha>!i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
proof (intro exI conjI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?i < length \<alpha>
 2. ?H2 \<subseteq> U
 3. ordertype ?H2 r = \<alpha> ! ?i
 4. f ` [?H2]\<^bsup>n\<^esup> \<subseteq> {?i}
[PROOF STEP]
show "i < length \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length \<alpha>
[PROOF STEP]
by (simp add: \<open>i < length \<alpha>\<close>)
[PROOF STATE]
proof (state)
this:
i < length \<alpha>

goal (3 subgoals):
 1. ?H2 \<subseteq> U
 2. ordertype ?H2 r = \<alpha> ! i
 3. f ` [?H2]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
show "cv X \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cv X \<subseteq> U
[PROOF STEP]
using \<open>X \<subseteq> elts \<beta>\<close> bij bij_betw_imp_surj_on bij_betw_inv_into cv_def
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> elts \<beta>
bij_betw (ordermap U r) U (elts \<beta>)
bij_betw ?f ?A ?B \<Longrightarrow> ?f ` ?A = ?B
bij_betw ?f ?A ?B \<Longrightarrow> bij_betw (inv_into ?A ?f) ?B ?A
cv \<equiv> (`) (inv_into U (ordermap U r))

goal (1 subgoal):
 1. cv X \<subseteq> U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cv X \<subseteq> U

goal (2 subgoals):
 1. ordertype (cv X) r = \<alpha> ! i
 2. f ` [cv X]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
show "ordertype (cv X) r = \<alpha> ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (cv X) r = \<alpha> ! i
[PROOF STEP]
by (simp add: X(1) \<open>X \<subseteq> elts \<beta>\<close>)
[PROOF STATE]
proof (state)
this:
ordertype (cv X) r = \<alpha> ! i

goal (1 subgoal):
 1. f ` [cv X]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
show "f ` [cv X]\<^bsup>n\<^esup> \<subseteq> {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` [cv X]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
using X \<open>X \<subseteq> elts \<beta>\<close> cv_part
[PROOF STATE]
proof (prove)
using this:
tp X = \<alpha> ! i
(f \<circ> cv) ` [X]\<^bsup>n\<^esup> \<subseteq> {i}
X \<subseteq> elts \<beta>
\<lbrakk>\<forall>x\<in>[?X]\<^bsup>?n\<^esup>. f (cv x) = ?i; ?X \<subseteq> elts \<beta>; ?a \<in> [cv ?X]\<^bsup>?n\<^esup>\<rbrakk> \<Longrightarrow> f ?a = ?i

goal (1 subgoal):
 1. f ` [cv X]\<^bsup>n\<^esup> \<subseteq> {i}
[PROOF STEP]
unfolding image_subset_iff cv_def
[PROOF STATE]
proof (prove)
using this:
tp X = \<alpha> ! i
\<forall>x\<in>[X]\<^bsup>n\<^esup>. (f \<circ> (`) (inv_into U (ordermap U r))) x \<in> {i}
X \<subseteq> elts \<beta>
\<lbrakk>\<forall>x\<in>[?X]\<^bsup>?n\<^esup>. f (inv_into U (ordermap U r) ` x) = ?i; ?X \<subseteq> elts \<beta>; ?a \<in> [inv_into U (ordermap U r) ` ?X]\<^bsup>?n\<^esup>\<rbrakk> \<Longrightarrow> f ?a = ?i

goal (1 subgoal):
 1. \<forall>x\<in>[inv_into U (ordermap U r) ` X]\<^bsup>n\<^esup>. f x \<in> {i}
[PROOF STEP]
by (metis comp_apply insertCI singletonD)
[PROOF STATE]
proof (state)
this:
f ` [cv X]\<^bsup>n\<^esup> \<subseteq> {i}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>i<length \<alpha>. \<exists>H\<subseteq>U. ordertype H r = \<alpha> ! i \<and> f ` [H]\<^bsup>n\<^esup> \<subseteq> {i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_row_first_last_append:
  assumes "dim_row A = m + n"
  shows "(mat_row_first A m) @\<^sub>r (mat_row_last A n) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_row_first A m @\<^sub>r mat_row_last A n = A
[PROOF STEP]
proof (rule eq_rowI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i. i < dim_row A \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
 2. dim_row (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_row A
 3. dim_col (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_col A
[PROOF STEP]
show "dim_row (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_row A
[PROOF STEP]
unfolding append_rows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (four_block_mat (mat_row_first A m) (0\<^sub>m (dim_row (mat_row_first A m)) 0) (mat_row_last A n) (0\<^sub>m (dim_row (mat_row_last A n)) 0)) = dim_row A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dim_row A = m + n

goal (1 subgoal):
 1. dim_row (four_block_mat (mat_row_first A m) (0\<^sub>m (dim_row (mat_row_first A m)) 0) (mat_row_last A n) (0\<^sub>m (dim_row (mat_row_last A n)) 0)) = dim_row A
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dim_row (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_row A

goal (2 subgoals):
 1. \<And>i. i < dim_row A \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
 2. dim_col (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_col A
[PROOF STEP]
show "dim_col (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_col A
[PROOF STEP]
unfolding append_rows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (four_block_mat (mat_row_first A m) (0\<^sub>m (dim_row (mat_row_first A m)) 0) (mat_row_last A n) (0\<^sub>m (dim_row (mat_row_last A n)) 0)) = dim_col A
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dim_col (mat_row_first A m @\<^sub>r mat_row_last A n) = dim_col A

goal (1 subgoal):
 1. \<And>i. i < dim_row A \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_row A \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
assume i: "i < dim_row A"
[PROOF STATE]
proof (state)
this:
i < dim_row A

goal (1 subgoal):
 1. \<And>i. i < dim_row A \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
show "row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
 2. \<not> ?P \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
assume i: "i < m"
[PROOF STATE]
proof (state)
this:
i < m

goal (2 subgoals):
 1. ?P \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
 2. \<not> ?P \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i < m

goal (1 subgoal):
 1. row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
using append_rows_nth(1)[OF mat_row_first_carrier[of A m]
          mat_row_last_carrier[of A n] i]
[PROOF STATE]
proof (prove)
using this:
i < m
row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row (mat_row_first A m) i

goal (1 subgoal):
 1. row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i

goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
assume i': "\<not> i < m"
[PROOF STATE]
proof (state)
this:
\<not> i < m

goal (1 subgoal):
 1. \<not> i < m \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> i < m

goal (1 subgoal):
 1. row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
using append_rows_nth(2)[OF mat_row_first_carrier[of A m]
          mat_row_last_carrier[of A n]] i assms
[PROOF STATE]
proof (prove)
using this:
\<not> i < m
\<lbrakk>m \<le> ?i; ?i < m + n\<rbrakk> \<Longrightarrow> row (mat_row_first A m @\<^sub>r mat_row_last A n) ?i = row (mat_row_last A n) (?i - m)
i < dim_row A
dim_row A = m + n

goal (1 subgoal):
 1. row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row (mat_row_first A m @\<^sub>r mat_row_last A n) i = row A i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_converges_cong:
  assumes "eventually (\<lambda>n. fds_nth f n = fds_nth g n) at_top" "s = s'"
  shows   "fds_converges f s \<longleftrightarrow> fds_converges g s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_converges f s = fds_converges g s'
[PROOF STEP]
unfolding fds_converges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. fds_nth f n / nat_power n s) = summable (\<lambda>n. fds_nth g n / nat_power n s')
[PROOF STEP]
by (intro summable_cong eventually_mono[OF assms(1)]) (simp_all add: assms)


[STATEMENT]
lemma SUPSEQ_conc [simp]:
  shows "SUPSEQ (A \<cdot> B) = SUPSEQ A \<cdot> SUPSEQ B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SUPSEQ (A \<cdot> B) = SUPSEQ A \<cdot> SUPSEQ B
[PROOF STEP]
unfolding SUPSEQ_def conc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>y\<in>{xs @ ys |xs ys. xs \<in> A \<and> ys \<in> B}. subseq y x} = {xs @ ys |xs ys. xs \<in> {x. \<exists>y\<in>A. subseq y x} \<and> ys \<in> {x. \<exists>y\<in>B. subseq y x}}
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs ys. \<lbrakk>subseq (xs @ ys) x; xs \<in> A; ys \<in> B\<rbrakk> \<Longrightarrow> \<exists>xs ys. x = xs @ ys \<and> (\<exists>y\<in>A. subseq y xs) \<and> (\<exists>y\<in>B. subseq y ys)
 2. \<And>xs ys y ya. \<lbrakk>y \<in> A; subseq y xs; ya \<in> B; subseq ya ys\<rbrakk> \<Longrightarrow> \<exists>y. (\<exists>xs ys. y = xs @ ys \<and> xs \<in> A \<and> ys \<in> B) \<and> subseq y (xs @ ys)
[PROOF STEP]
apply(drule list_emb_appendD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs ys. \<lbrakk>xs \<in> A; ys \<in> B; \<exists>us vs. x = us @ vs \<and> subseq xs us \<and> subseq ys vs\<rbrakk> \<Longrightarrow> \<exists>xs ys. x = xs @ ys \<and> (\<exists>y\<in>A. subseq y xs) \<and> (\<exists>y\<in>B. subseq y ys)
 2. \<And>xs ys y ya. \<lbrakk>y \<in> A; subseq y xs; ya \<in> B; subseq ya ys\<rbrakk> \<Longrightarrow> \<exists>y. (\<exists>xs ys. y = xs @ ys \<and> xs \<in> A \<and> ys \<in> B) \<and> subseq y (xs @ ys)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs ys y ya. \<lbrakk>y \<in> A; subseq y xs; ya \<in> B; subseq ya ys\<rbrakk> \<Longrightarrow> \<exists>y. (\<exists>xs ys. y = xs @ ys \<and> xs \<in> A \<and> ys \<in> B) \<and> subseq y (xs @ ys)
[PROOF STEP]
by (metis list_emb_append_mono)


[STATEMENT]
lemma next_disj_distrib:
  "(\<circle>(P \<^bold>\<or> Q)) = (\<circle>P \<^bold>\<or> \<circle>Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<circle>(\<lambda>s. P s \<or> Q s) = (\<lambda>s. (\<circle>P) s \<or> (\<circle>Q) s)
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>\<sigma>. P (\<sigma> |\<^sub>s 1) \<or> Q (\<sigma> |\<^sub>s 1)) = (\<lambda>s. P (s |\<^sub>s 1) \<or> Q (s |\<^sub>s 1))
[PROOF STEP]
by auto


[STATEMENT]
lemma asymp_equiv_imp_bigomega:
  "f \<sim>[F] g \<Longrightarrow> f \<in> \<Omega>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<sim>[F] g \<Longrightarrow> f \<in> \<Omega>[F](g)
[PROOF STEP]
using asymp_equiv_imp_bigo[of g F f]
[PROOF STATE]
proof (prove)
using this:
g \<sim>[F] f \<Longrightarrow> g \<in> O[F](f)

goal (1 subgoal):
 1. f \<sim>[F] g \<Longrightarrow> f \<in> \<Omega>[F](g)
[PROOF STEP]
by (simp add: asymp_equiv_sym bigomega_iff_bigo)


[STATEMENT]
lemma kparts_set: "\<exists>l'. kparts (set l) = set l' & cnb l' = cnb l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l'. kparts (set l) = set l' \<and> cnb l' = cnb l
[PROOF STEP]
apply (induct l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>l'. kparts (set []) = set l' \<and> cnb l' = cnb []
 2. \<And>a l. \<exists>l'. kparts (set l) = set l' \<and> cnb l' = cnb l \<Longrightarrow> \<exists>l'. kparts (set (a # l)) = set l' \<and> cnb l' = cnb (a # l)
[PROOF STEP]
apply (rule_tac x="[]" in exI, simp, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l l'. \<lbrakk>kparts (set l) = set l'; cnb l' = cnb l\<rbrakk> \<Longrightarrow> \<exists>l'. kparts (insert a (set l)) = set l' \<and> cnb l' = crypt_nb a + cnb l
[PROOF STEP]
apply (rename_tac a b l')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l'. \<lbrakk>kparts (set b) = set l'; cnb l' = cnb b\<rbrakk> \<Longrightarrow> \<exists>l'. kparts (insert a (set b)) = set l' \<and> cnb l' = crypt_nb a + cnb b
[PROOF STEP]
apply (subgoal_tac "\<exists>l''.  kparts {a} = set l'' & cnb l'' = crypt_nb a", clarify)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b l' l''. \<lbrakk>kparts (set b) = set l'; cnb l' = cnb b; kparts {a} = set l''; cnb l'' = crypt_nb a\<rbrakk> \<Longrightarrow> \<exists>l'. kparts (insert a (set b)) = set l' \<and> cnb l' = crypt_nb a + cnb b
 2. \<And>a b l'. \<lbrakk>kparts (set b) = set l'; cnb l' = cnb b\<rbrakk> \<Longrightarrow> \<exists>l''. kparts {a} = set l'' \<and> cnb l'' = crypt_nb a
[PROOF STEP]
apply (rule_tac x="l''@l'" in exI, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b l' l''. \<lbrakk>kparts (set b) = set l'; cnb l' = cnb b; kparts {a} = set l''; cnb l'' = crypt_nb a\<rbrakk> \<Longrightarrow> kparts (insert a (set b)) = set l'' \<union> set l'
 2. \<And>a b l'. \<lbrakk>kparts (set b) = set l'; cnb l' = cnb b\<rbrakk> \<Longrightarrow> \<exists>l''. kparts {a} = set l'' \<and> cnb l'' = crypt_nb a
[PROOF STEP]
apply (rule kparts_insert_substI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l'. \<lbrakk>kparts (set b) = set l'; cnb l' = cnb b\<rbrakk> \<Longrightarrow> \<exists>l''. kparts {a} = set l'' \<and> cnb l'' = crypt_nb a
[PROOF STEP]
by (rule kparts_msg_set)


[STATEMENT]
lemma convolution_distrib_left :
  fixes   g h f :: "'a::group_add \<Rightarrow> 'b::semiring_0"
  assumes "g \<in> aezfun_set" "h \<in> aezfun_set"
  shows   "convolution f (g + h) = convolution f g + convolution f h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution f (g + h) = convolution f g + convolution f h
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
define gh GH where "gh = g + h" and "GH = supp g \<union> supp h"
[PROOF STATE]
proof (state)
this:
gh = g + h
GH = supp g \<union> supp h

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
have fin_GH: "finite GH"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite GH
[PROOF STEP]
using GH_def assms
[PROOF STATE]
proof (prove)
using this:
GH = supp g \<union> supp h
g \<in> aezfun_set
h \<in> aezfun_set

goal (1 subgoal):
 1. finite GH
[PROOF STEP]
unfolding aezfun_set_def
[PROOF STATE]
proof (prove)
using this:
GH = supp g \<union> supp h
g \<in> {f. finite (supp f)}
h \<in> {f. finite (supp f)}

goal (1 subgoal):
 1. finite GH
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
finite GH

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
have gh_aezfun: "gh \<in> aezfun_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gh \<in> aezfun_set
[PROOF STEP]
using gh_def assms sum_of_aezfun_is_aezfun
[PROOF STATE]
proof (prove)
using this:
gh = g + h
g \<in> aezfun_set
h \<in> aezfun_set
\<lbrakk>?f \<in> aezfun_set; ?g \<in> aezfun_set\<rbrakk> \<Longrightarrow> ?f + ?g \<in> aezfun_set

goal (1 subgoal):
 1. gh \<in> aezfun_set
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
gh \<in> aezfun_set

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
fix x::'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
have zero_ext_g : "\<And>y. y \<in> GH - supp g \<Longrightarrow> (f (x - y)) * g y = 0"
  and  zero_ext_h : "\<And>y. y \<in> GH - supp h \<Longrightarrow> (f (x - y)) * h y = 0"
  and  zero_ext_gh: "\<And>y. y \<in> GH - supp gh \<Longrightarrow> (f (x - y)) * gh y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> GH - supp g \<Longrightarrow> f (x - y) * g y = (0::'b)) &&& (\<And>y. y \<in> GH - supp h \<Longrightarrow> f (x - y) * h y = (0::'b)) &&& (\<And>y. y \<in> GH - supp gh \<Longrightarrow> f (x - y) * gh y = (0::'b))
[PROOF STEP]
unfolding supp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> GH - {x. g x \<noteq> (0::'b)} \<Longrightarrow> f (x - y) * g y = (0::'b)) &&& (\<And>y. y \<in> GH - {x. h x \<noteq> (0::'b)} \<Longrightarrow> f (x - y) * h y = (0::'b)) &&& (\<And>y. y \<in> GH - {x. gh x \<noteq> (0::'b)} \<Longrightarrow> f (x - y) * gh y = (0::'b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y \<in> GH - supp g \<Longrightarrow> f (x - ?y) * g ?y = (0::'b)
?y \<in> GH - supp h \<Longrightarrow> f (x - ?y) * h ?y = (0::'b)
?y \<in> GH - supp gh \<Longrightarrow> f (x - ?y) * gh ?y = (0::'b)

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
have "convolution f gh x = (\<Sum>y\<in>supp gh. (f (x - y)) * gh y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp gh. f (x - y) * gh y)
[PROOF STEP]
using assms gh_aezfun convolution_eq_sum_over_supp_right[of gh f]
[PROOF STATE]
proof (prove)
using this:
g \<in> aezfun_set
h \<in> aezfun_set
gh \<in> aezfun_set
gh \<in> aezfun_set \<Longrightarrow> convolution f gh = (\<lambda>x. \<Sum>y\<in>supp gh. f (x - y) * gh y)

goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp gh. f (x - y) * gh y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convolution f gh x = (\<Sum>y\<in>supp gh. f (x - y) * gh y)

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
convolution f gh x = (\<Sum>y\<in>supp gh. f (x - y) * gh y)

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
from gh_def GH_def
[PROOF STATE]
proof (chain)
picking this:
gh = g + h
GH = supp g \<union> supp h
[PROOF STEP]
have "\<dots> = (\<Sum>y\<in>GH. (f (x - y)) * gh y)"
[PROOF STATE]
proof (prove)
using this:
gh = g + h
GH = supp g \<union> supp h

goal (1 subgoal):
 1. (\<Sum>y\<in>supp gh. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * gh y)
[PROOF STEP]
using fin_GH supp_sum_subset_union_supp zero_ext_gh
          sum.mono_neutral_left[of GH "supp gh" "(\<lambda>y. (f (x - y)) * gh y)"]
[PROOF STATE]
proof (prove)
using this:
gh = g + h
GH = supp g \<union> supp h
finite GH
supp (?f + ?g) \<subseteq> supp ?f \<union> supp ?g
?y \<in> GH - supp gh \<Longrightarrow> f (x - ?y) * gh ?y = (0::'b)
\<lbrakk>finite GH; supp gh \<subseteq> GH; \<forall>i\<in>GH - supp gh. f (x - i) * gh i = (0::'b)\<rbrakk> \<Longrightarrow> (\<Sum>y\<in>supp gh. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * gh y)

goal (1 subgoal):
 1. (\<Sum>y\<in>supp gh. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * gh y)
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>supp gh. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * gh y)

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>supp gh. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * gh y)

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
from gh_def
[PROOF STATE]
proof (chain)
picking this:
gh = g + h
[PROOF STEP]
have  "\<dots> = (\<Sum>y\<in>GH. (f (x - y)) * g y) + (\<Sum>y\<in>GH. (f (x - y)) * h y)"
[PROOF STATE]
proof (prove)
using this:
gh = g + h

goal (1 subgoal):
 1. (\<Sum>y\<in>GH. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * g y) + (\<Sum>y\<in>GH. f (x - y) * h y)
[PROOF STEP]
using sum.distrib
[PROOF STATE]
proof (prove)
using this:
gh = g + h
(\<Sum>x\<in>?A. ?g x + ?h x) = sum ?g ?A + sum ?h ?A

goal (1 subgoal):
 1. (\<Sum>y\<in>GH. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * g y) + (\<Sum>y\<in>GH. f (x - y) * h y)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>GH. f (x - y) * gh y) = (\<Sum>y\<in>GH. f (x - y) * g y) + (\<Sum>y\<in>GH. f (x - y) * h y)

goal (1 subgoal):
 1. \<And>x. convolution f (g + h) x = (convolution f g + convolution f h) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
convolution f gh x = (\<Sum>y\<in>GH. f (x - y) * g y) + (\<Sum>y\<in>GH. f (x - y) * h y)
[PROOF STEP]
show "convolution f gh x = (convolution f g + convolution f h) x"
[PROOF STATE]
proof (prove)
using this:
convolution f gh x = (\<Sum>y\<in>GH. f (x - y) * g y) + (\<Sum>y\<in>GH. f (x - y) * h y)

goal (1 subgoal):
 1. convolution f gh x = (convolution f g + convolution f h) x
[PROOF STEP]
using assms GH_def fin_GH zero_ext_g zero_ext_h
          sum.mono_neutral_right[of GH "supp g" "(\<lambda>y. (f (x - y)) * g y)"]
          sum.mono_neutral_right[of GH "supp h" "(\<lambda>y. (f (x - y)) * h y)"]
          convolution_eq_sum_over_supp_right[of g f]
          convolution_eq_sum_over_supp_right[of h f]
[PROOF STATE]
proof (prove)
using this:
convolution f gh x = (\<Sum>y\<in>GH. f (x - y) * g y) + (\<Sum>y\<in>GH. f (x - y) * h y)
g \<in> aezfun_set
h \<in> aezfun_set
GH = supp g \<union> supp h
finite GH
?y \<in> GH - supp g \<Longrightarrow> f (x - ?y) * g ?y = (0::'b)
?y \<in> GH - supp h \<Longrightarrow> f (x - ?y) * h ?y = (0::'b)
\<lbrakk>finite GH; supp g \<subseteq> GH; \<forall>i\<in>GH - supp g. f (x - i) * g i = (0::'b)\<rbrakk> \<Longrightarrow> (\<Sum>y\<in>GH. f (x - y) * g y) = (\<Sum>y\<in>supp g. f (x - y) * g y)
\<lbrakk>finite GH; supp h \<subseteq> GH; \<forall>i\<in>GH - supp h. f (x - i) * h i = (0::'b)\<rbrakk> \<Longrightarrow> (\<Sum>y\<in>GH. f (x - y) * h y) = (\<Sum>y\<in>supp h. f (x - y) * h y)
g \<in> aezfun_set \<Longrightarrow> convolution f g = (\<lambda>x. \<Sum>y\<in>supp g. f (x - y) * g y)
h \<in> aezfun_set \<Longrightarrow> convolution f h = (\<lambda>x. \<Sum>y\<in>supp h. f (x - y) * h y)

goal (1 subgoal):
 1. convolution f gh x = (convolution f g + convolution f h) x
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
convolution f gh x = (convolution f g + convolution f h) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma relImage_mono:
  "R1 \<subseteq> R2 \<Longrightarrow> relImage R1 f \<subseteq> relImage R2 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> relImage R1 f \<subseteq> relImage R2 f
[PROOF STEP]
unfolding relImage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> {(f a1, f a2) |a1 a2. (a1, a2) \<in> R1} \<subseteq> {(f a1, f a2) |a1 a2. (a1, a2) \<in> R2}
[PROOF STEP]
by auto


[STATEMENT]
lemma period_rev_conv [reversal_rule]: "period (rev w) n \<longleftrightarrow> period w n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. period (rev w) n = period w n
[PROOF STEP]
using period_rev period_rev[of "rev w"]
[PROOF STATE]
proof (prove)
using this:
period ?w ?p \<Longrightarrow> period (rev ?w) ?p
period (rev w) ?p \<Longrightarrow> period (rev (rev w)) ?p

goal (1 subgoal):
 1. period (rev w) n = period w n
[PROOF STEP]
unfolding rev_rev_ident
[PROOF STATE]
proof (prove)
using this:
period ?w ?p \<Longrightarrow> period (rev ?w) ?p
period (rev w) ?p \<Longrightarrow> period w ?p

goal (1 subgoal):
 1. period (rev w) n = period w n
[PROOF STEP]
by (intro iffI)


[STATEMENT]
lemma filterlim_tendsto_pos_mult_at_top:
  assumes f: "(f \<longlongrightarrow> c) F"
    and c: "0 < c"
    and g: "LIM x F. g x :> at_top"
  shows "LIM x F. (f x * g x :: real) :> at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x F. f x * g x :> at_top
[PROOF STEP]
unfolding filterlim_at_top_gt[where c=0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Z>0. \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
fix Z :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
assume "0 < Z"
[PROOF STATE]
proof (state)
this:
0 < Z

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
from f \<open>0 < c\<close>
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> c) F
0 < c
[PROOF STEP]
have "eventually (\<lambda>x. c / 2 < f x) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> c) F
0 < c

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. c / 2 < f x
[PROOF STEP]
by (auto dest!: tendstoD[where e="c / 2"] elim!: eventually_mono
        simp: dist_real_def abs_real_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. c / 2 < f x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. c / 2 < f x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
from g
[PROOF STATE]
proof (chain)
picking this:
filterlim g at_top F
[PROOF STEP]
have "eventually (\<lambda>x. (Z / c * 2) \<le> g x) F"
[PROOF STATE]
proof (prove)
using this:
filterlim g at_top F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z / c * 2 \<le> g x
[PROOF STEP]
unfolding filterlim_at_top
[PROOF STATE]
proof (prove)
using this:
\<forall>Z. \<forall>\<^sub>F x in F. Z \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z / c * 2 \<le> g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. Z / c * 2 \<le> g x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. c / 2 < f x
\<forall>\<^sub>F x in F. Z / c * 2 \<le> g x
[PROOF STEP]
show "eventually (\<lambda>x. Z \<le> f x * g x) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. c / 2 < f x
\<forall>\<^sub>F x in F. Z / c * 2 \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z \<le> f x * g x
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>c / 2 < f x; Z / c * 2 \<le> g x\<rbrakk> \<Longrightarrow> Z \<le> f x * g x
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
c / 2 < f x
Z / c * 2 \<le> g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>c / 2 < f x; Z / c * 2 \<le> g x\<rbrakk> \<Longrightarrow> Z \<le> f x * g x
[PROOF STEP]
with \<open>0 < Z\<close> \<open>0 < c\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < Z
0 < c
c / 2 < f x
Z / c * 2 \<le> g x
[PROOF STEP]
have "c / 2 * (Z / c * 2) \<le> f x * g x"
[PROOF STATE]
proof (prove)
using this:
0 < Z
0 < c
c / 2 < f x
Z / c * 2 \<le> g x

goal (1 subgoal):
 1. c / 2 * (Z / c * 2) \<le> f x * g x
[PROOF STEP]
by (intro mult_mono) (auto simp: zero_le_divide_iff)
[PROOF STATE]
proof (state)
this:
c / 2 * (Z / c * 2) \<le> f x * g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>c / 2 < f x; Z / c * 2 \<le> g x\<rbrakk> \<Longrightarrow> Z \<le> f x * g x
[PROOF STEP]
with \<open>0 < c\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < c
c / 2 * (Z / c * 2) \<le> f x * g x
[PROOF STEP]
show "Z \<le> f x * g x"
[PROOF STATE]
proof (prove)
using this:
0 < c
c / 2 * (Z / c * 2) \<le> f x * g x

goal (1 subgoal):
 1. Z \<le> f x * g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Z \<le> f x * g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. Z \<le> f x * g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lt_set_iff:
  shows "t \<in> lt_set F \<longleftrightarrow> (\<exists>f\<in>F. f \<noteq> 0 \<and> lt f = t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<in> lt_set F) = (\<exists>f\<in>F. f \<noteq> 0 \<and> lt f = t)
[PROOF STEP]
unfolding lt_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<in> lt ` (F - {0})) = (\<exists>f\<in>F. f \<noteq> 0 \<and> lt f = t)
[PROOF STEP]
by auto


[STATEMENT]
lemma fds_truncate_const [simp]: "m > 0 \<Longrightarrow> fds_truncate m (fds_const c) = fds_const c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> fds_truncate m (fds_const c) = fds_const c
[PROOF STEP]
by (simp add: fds_truncate_def fds_eq_iff)


[STATEMENT]
lemma conjugate_sprod_vec:
  fixes v w :: "'a :: conjugatable_ring vec"
  assumes v: "v : carrier_vec n" and w: "w : carrier_vec n"
  shows "conjugate (v \<bullet> w) = conjugate v \<bullet> conjugate w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (v \<bullet> w) = conjugate v \<bullet> conjugate w
[PROOF STEP]
proof (insert w v, induct w arbitrary: v rule:carrier_vec_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>v. v \<in> carrier_vec 0 \<Longrightarrow> conjugate (v \<bullet> vNil) = conjugate v \<bullet> conjugate vNil
 2. \<And>n a v va. \<lbrakk>v \<in> carrier_vec n; \<And>va. va \<in> carrier_vec n \<Longrightarrow> conjugate (va \<bullet> v) = conjugate va \<bullet> conjugate v; va \<in> carrier_vec (Suc n)\<rbrakk> \<Longrightarrow> conjugate (va \<bullet> vCons a v) = conjugate va \<bullet> conjugate (vCons a v)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec 0

goal (2 subgoals):
 1. \<And>v. v \<in> carrier_vec 0 \<Longrightarrow> conjugate (v \<bullet> vNil) = conjugate v \<bullet> conjugate vNil
 2. \<And>n a v va. \<lbrakk>v \<in> carrier_vec n; \<And>va. va \<in> carrier_vec n \<Longrightarrow> conjugate (va \<bullet> v) = conjugate va \<bullet> conjugate v; va \<in> carrier_vec (Suc n)\<rbrakk> \<Longrightarrow> conjugate (va \<bullet> vCons a v) = conjugate va \<bullet> conjugate (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec 0

goal (1 subgoal):
 1. conjugate (v \<bullet> vNil) = conjugate v \<bullet> conjugate vNil
[PROOF STEP]
by (cases v, auto)
[PROOF STATE]
proof (state)
this:
conjugate (v \<bullet> vNil) = conjugate v \<bullet> conjugate vNil

goal (1 subgoal):
 1. \<And>n a v va. \<lbrakk>v \<in> carrier_vec n; \<And>va. va \<in> carrier_vec n \<Longrightarrow> conjugate (va \<bullet> v) = conjugate va \<bullet> conjugate v; va \<in> carrier_vec (Suc n)\<rbrakk> \<Longrightarrow> conjugate (va \<bullet> vCons a v) = conjugate va \<bullet> conjugate (vCons a v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n a v va. \<lbrakk>v \<in> carrier_vec n; \<And>va. va \<in> carrier_vec n \<Longrightarrow> conjugate (va \<bullet> v) = conjugate va \<bullet> conjugate v; va \<in> carrier_vec (Suc n)\<rbrakk> \<Longrightarrow> conjugate (va \<bullet> vCons a v) = conjugate va \<bullet> conjugate (vCons a v)
[PROOF STEP]
case (Suc n b w)
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec n
?v \<in> carrier_vec n \<Longrightarrow> conjugate (?v \<bullet> w) = conjugate ?v \<bullet> conjugate w
v \<in> carrier_vec (Suc n)

goal (1 subgoal):
 1. \<And>n a v va. \<lbrakk>v \<in> carrier_vec n; \<And>va. va \<in> carrier_vec n \<Longrightarrow> conjugate (va \<bullet> v) = conjugate va \<bullet> conjugate v; va \<in> carrier_vec (Suc n)\<rbrakk> \<Longrightarrow> conjugate (va \<bullet> vCons a v) = conjugate va \<bullet> conjugate (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> carrier_vec n
?v \<in> carrier_vec n \<Longrightarrow> conjugate (?v \<bullet> w) = conjugate ?v \<bullet> conjugate w
v \<in> carrier_vec (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
?v \<in> carrier_vec n \<Longrightarrow> conjugate (?v \<bullet> w) = conjugate ?v \<bullet> conjugate w
v \<in> carrier_vec (Suc n)

goal (1 subgoal):
 1. conjugate (v \<bullet> vCons b w) = conjugate v \<bullet> conjugate (vCons b w)
[PROOF STEP]
by (cases v, auto dest: carrier_vecD simp:conjugate_dist_add conjugate_dist_mul)
[PROOF STATE]
proof (state)
this:
conjugate (v \<bullet> vCons b w) = conjugate v \<bullet> conjugate (vCons b w)

goal:
No subgoals!
[PROOF STEP]
qed