[STATEMENT]
lemma norm_1_bound_mignotte: "norm1 f \<le> 2^(degree f) * mahler_measure f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
proof (cases "f = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
case f0: False
[PROOF STATE]
proof (state)
this:
f \<noteq> 0

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
have cf: "coeffs f = map (\<lambda> i. coeff f i) [0 ..< Suc( degree f)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeffs f = map (poly.coeff f) [0..<Suc (degree f)]
[PROOF STEP]
unfolding coeffs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if f = 0 then [] else map (poly.coeff f) [0..<Suc (degree f)]) = map (poly.coeff f) [0..<Suc (degree f)]
[PROOF STEP]
using f0
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0

goal (1 subgoal):
 1. (if f = 0 then [] else map (poly.coeff f) [0..<Suc (degree f)]) = map (poly.coeff f) [0..<Suc (degree f)]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coeffs f = map (poly.coeff f) [0..<Suc (degree f)]

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
have "real_of_int (sum_list (map abs (coeffs f)))
    = (\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (sum_list (map abs (coeffs f))) = (\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>)
[PROOF STEP]
unfolding cf of_int_hom.hom_sum_list
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map real_of_int (map abs (map (poly.coeff f) [0..<Suc (degree f)]))) = (\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>)
[PROOF STEP]
unfolding sum_list_sum_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((!) (map real_of_int (map abs (map (poly.coeff f) [0..<Suc (degree f)])))) {0..<length (map real_of_int (map abs (map (poly.coeff f) [0..<Suc (degree f)])))} = (\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>)
[PROOF STEP]
by (rule sum.cong, force, auto simp: o_def nth_append)
[PROOF STATE]
proof (state)
this:
real_of_int (sum_list (map abs (coeffs f))) = (\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>)

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (sum_list (map abs (coeffs f))) = (\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>)

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
have "\<dots> \<le> (\<Sum>i\<le>degree f. real (degree f choose i) * mahler_measure f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>) \<le> (\<Sum>i\<le>degree f. real (degree f choose i) * mahler_measure f)
[PROOF STEP]
by (rule sum_mono, rule Mignotte_bound)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>) \<le> (\<Sum>i\<le>degree f. real (degree f choose i) * mahler_measure f)

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>degree f. real_of_int \<bar>poly.coeff f i\<bar>) \<le> (\<Sum>i\<le>degree f. real (degree f choose i) * mahler_measure f)

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
have "\<dots> = real (sum (\<lambda> i. (degree f choose i)) {..degree f}) * mahler_measure f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree f. real (degree f choose i) * mahler_measure f) = real (sum ((choose) (degree f)) {..degree f}) * mahler_measure f
[PROOF STEP]
unfolding sum_distrib_right[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree f. real (degree f choose i)) * mahler_measure f = real (sum ((choose) (degree f)) {..degree f}) * mahler_measure f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>degree f. real (degree f choose i) * mahler_measure f) = real (sum ((choose) (degree f)) {..degree f}) * mahler_measure f

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>degree f. real (degree f choose i) * mahler_measure f) = real (sum ((choose) (degree f)) {..degree f}) * mahler_measure f

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
have "\<dots> = 2^(degree f) * mahler_measure f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (sum ((choose) (degree f)) {..degree f}) * mahler_measure f = 2 ^ degree f * mahler_measure f
[PROOF STEP]
unfolding choose_row_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (2 ^ degree f) * mahler_measure f = 2 ^ degree f * mahler_measure f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (sum ((choose) (degree f)) {..degree f}) * mahler_measure f = 2 ^ degree f * mahler_measure f

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
 2. f \<noteq> 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (sum_list (map abs (coeffs f))) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int (sum_list (map abs (coeffs f))) \<le> 2 ^ degree f * mahler_measure f

goal (1 subgoal):
 1. real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
unfolding norm1_def
[PROOF STATE]
proof (prove)
using this:
real_of_int (sum_list (map abs (coeffs f))) \<le> 2 ^ degree f * mahler_measure f

goal (1 subgoal):
 1. real_of_int (sum_list (map abs (coeffs f))) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f

goal (1 subgoal):
 1. f = 0 \<Longrightarrow> real_of_int (norm1 f) \<le> 2 ^ degree f * mahler_measure f
[PROOF STEP]
qed (auto simp: mahler_measure_ge_0 norm1_def)


[STATEMENT]
theorem while_false: "while false do P od = II"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. while\<^sup>\<top> false do P od = II
[PROOF STEP]
by (subst while_unfold, rel_auto)


[STATEMENT]
lemma vcomp_atI[intro, simp]:
  assumes "vsv r"
    and "vsv s"
    and "a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> r"
    and "b \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> s"
    and "s\<lparr>b\<rparr> = c"
    and "r\<lparr>a\<rparr> = b"
  shows "(s \<circ>\<^sub>\<circ> r)\<lparr>a\<rparr> = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<circ>\<^sub>\<circ> r)\<lparr>a\<rparr> = c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vsv r
vsv s
a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> r
b \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> s
s\<lparr>b\<rparr> = c
r\<lparr>a\<rparr> = b

goal (1 subgoal):
 1. (s \<circ>\<^sub>\<circ> r)\<lparr>a\<rparr> = c
[PROOF STEP]
by (auto simp: app_invimageI intro!: vsv_vcomp)


[STATEMENT]
lemma (in group) P_fixed_point_of_P_conj:
  assumes fin:"finite (carrier G)"
  assumes P:"P \<in> subgroups_of_size p"
  shows "P \<in> group_action.fixed_points (G\<lparr>carrier := P\<rparr>) (conjugation_action p) (subgroups_of_size p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<in> group_action.fixed_points (G\<lparr>carrier := P\<rparr>) (conjugation_action p) (subgroups_of_size p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> group_action.fixed_points (G\<lparr>carrier := P\<rparr>) (conjugation_action p) (subgroups_of_size p)
[PROOF STEP]
from fin
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
[PROOF STEP]
interpret conjG: group_action G "conjugation_action p" "subgroups_of_size p"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)

goal (1 subgoal):
 1. group_action G (conjugation_action p) (subgroups_of_size p)
[PROOF STEP]
by (rule acts_on_subsets)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> group_action.fixed_points (G\<lparr>carrier := P\<rparr>) (conjugation_action p) (subgroups_of_size p)
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
P \<in> subgroups_of_size p
[PROOF STEP]
have "subgroup P G"
[PROOF STATE]
proof (prove)
using this:
P \<in> subgroups_of_size p

goal (1 subgoal):
 1. subgroup P G
[PROOF STEP]
unfolding subgroups_of_size_def
[PROOF STATE]
proof (prove)
using this:
P \<in> {H. subgroup H G \<and> card H = p}

goal (1 subgoal):
 1. subgroup P G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subgroup P G

goal (1 subgoal):
 1. P \<in> group_action.fixed_points (G\<lparr>carrier := P\<rparr>) (conjugation_action p) (subgroups_of_size p)
[PROOF STEP]
with fin
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
subgroup P G
[PROOF STEP]
interpret conjP: group_action "G\<lparr>carrier := P\<rparr>" "(conjugation_action p)" "(subgroups_of_size p)"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
subgroup P G

goal (1 subgoal):
 1. group_action (G\<lparr>carrier := P\<rparr>) (conjugation_action p) (subgroups_of_size p)
[PROOF STEP]
by (metis acts_on_subsets group_action.subgroup_action)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<in> conjP.fixed_points
[PROOF STEP]
from fin P
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
P \<in> subgroups_of_size p
[PROOF STEP]
have "P \<subseteq> conjG.stabilizer P"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
P \<in> subgroups_of_size p

goal (1 subgoal):
 1. P \<subseteq> conjG.stabilizer P
[PROOF STEP]
by (rule stabilizer_contains_P)
[PROOF STATE]
proof (state)
this:
P \<subseteq> conjG.stabilizer P

goal (1 subgoal):
 1. P \<in> conjP.fixed_points
[PROOF STEP]
hence "P \<subseteq> conjP.stabilizer P"
[PROOF STATE]
proof (prove)
using this:
P \<subseteq> conjG.stabilizer P

goal (1 subgoal):
 1. P \<subseteq> conjP.stabilizer P
[PROOF STEP]
using conjG.stabilizer_def conjP.stabilizer_def
[PROOF STATE]
proof (prove)
using this:
P \<subseteq> conjG.stabilizer P
conjG.stabilizer ?m = {g \<in> carrier G. conjugation_action p g ?m = ?m}
conjP.stabilizer ?m = {g \<in> carrier (G\<lparr>carrier := P\<rparr>). conjugation_action p g ?m = ?m}

goal (1 subgoal):
 1. P \<subseteq> conjP.stabilizer P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<subseteq> conjP.stabilizer P

goal (1 subgoal):
 1. P \<in> conjP.fixed_points
[PROOF STEP]
with P
[PROOF STATE]
proof (chain)
picking this:
P \<in> subgroups_of_size p
P \<subseteq> conjP.stabilizer P
[PROOF STEP]
show "P \<in> conjP.fixed_points"
[PROOF STATE]
proof (prove)
using this:
P \<in> subgroups_of_size p
P \<subseteq> conjP.stabilizer P

goal (1 subgoal):
 1. P \<in> conjP.fixed_points
[PROOF STEP]
unfolding conjP.fixed_points_def
[PROOF STATE]
proof (prove)
using this:
P \<in> subgroups_of_size p
P \<subseteq> conjP.stabilizer P

goal (1 subgoal):
 1. P \<in> {m \<in> subgroups_of_size p. carrier (G\<lparr>carrier := P\<rparr>) \<subseteq> conjP.stabilizer m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<in> conjP.fixed_points

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniform_groups_groups_of_size_m: "groups_of_size \<m> = card \<G>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. groups_of_size \<m> = card \<G>
[PROOF STEP]
proof(simp add: groups_of_size_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {G \<in> \<G>. card G = \<m>} = card \<G>
[PROOF STEP]
have "{G \<in> \<G>. card G = \<m>} = \<G>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {G \<in> \<G>. card G = \<m>} = \<G>
[PROOF STEP]
using uniform_groups_alt set_filter_eq_P_forall
[PROOF STATE]
proof (prove)
using this:
\<forall>G\<in>\<G>. card G = \<m>
\<forall>x\<in>?X. ?P x \<Longrightarrow> Set.filter ?P ?X = ?X

goal (1 subgoal):
 1. {G \<in> \<G>. card G = \<m>} = \<G>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{G \<in> \<G>. card G = \<m>} = \<G>

goal (1 subgoal):
 1. card {G \<in> \<G>. card G = \<m>} = card \<G>
[PROOF STEP]
thus "card {G \<in> \<G>. card G = \<m>} = card \<G>"
[PROOF STATE]
proof (prove)
using this:
{G \<in> \<G>. card G = \<m>} = \<G>

goal (1 subgoal):
 1. card {G \<in> \<G>. card G = \<m>} = card \<G>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {G \<in> \<G>. card G = \<m>} = card \<G>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sigma_eqpoll_cong:
  assumes h: "bij_betw h A C"  and BD: "\<And>x. x \<in> A \<Longrightarrow> B x \<approx> D (h x)"
  shows "Sigma A B \<approx> Sigma C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma A B \<approx> Sigma C D
[PROOF STEP]
proof (intro lepoll_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sigma A B \<lesssim> Sigma C D
 2. Sigma C D \<lesssim> Sigma A B
[PROOF STEP]
show "Sigma A B \<lesssim> Sigma C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma A B \<lesssim> Sigma C D
[PROOF STEP]
by (metis Sigma_inj_lepoll_mono bij_betw_def eqpoll_imp_lepoll subset_refl assms)
[PROOF STATE]
proof (state)
this:
Sigma A B \<lesssim> Sigma C D

goal (1 subgoal):
 1. Sigma C D \<lesssim> Sigma A B
[PROOF STEP]
have "inj_on (inv_into A h) C \<and> inv_into A h ` C \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (inv_into A h) C \<and> inv_into A h ` C \<subseteq> A
[PROOF STEP]
by (metis bij_betw_def bij_betw_inv_into h set_eq_subset)
[PROOF STATE]
proof (state)
this:
inj_on (inv_into A h) C \<and> inv_into A h ` C \<subseteq> A

goal (1 subgoal):
 1. Sigma C D \<lesssim> Sigma A B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on (inv_into A h) C \<and> inv_into A h ` C \<subseteq> A
[PROOF STEP]
show "Sigma C D \<lesssim> Sigma A B"
[PROOF STATE]
proof (prove)
using this:
inj_on (inv_into A h) C \<and> inv_into A h ` C \<subseteq> A

goal (1 subgoal):
 1. Sigma C D \<lesssim> Sigma A B
[PROOF STEP]
by (smt (verit, best) BD Sigma_inj_lepoll_mono bij_betw_inv_into_right eqpoll_sym h image_subset_iff lepoll_refl lepoll_trans2)
[PROOF STATE]
proof (state)
this:
Sigma C D \<lesssim> Sigma A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convergent_bounded_family:
  fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> real"
  assumes bounded: "\<And>x. x \<in> A \<Longrightarrow> bounded (range (\<lambda>n. f n x))"
  and A: "countable A"
  obtains k where "strict_mono k" "\<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof(cases "A = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (2 subgoals):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
define f' where "f' n x = f n (from_nat_into A x)" for n x
[PROOF STATE]
proof (state)
this:
f' ?n ?x = f ?n (from_nat_into A ?x)

goal (2 subgoals):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "bounded (range (\<lambda>n. f' n x))" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range (\<lambda>n. f' n x))
[PROOF STEP]
unfolding f'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range (\<lambda>n. f n (from_nat_into A x)))
[PROOF STEP]
using from_nat_into[OF False]
[PROOF STATE]
proof (prove)
using this:
from_nat_into A ?n \<in> A

goal (1 subgoal):
 1. bounded (range (\<lambda>n. f n (from_nat_into A x)))
[PROOF STEP]
by(rule bounded)
[PROOF STATE]
proof (state)
this:
bounded (range (\<lambda>n. f' n ?x))

goal (2 subgoals):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded (range (\<lambda>n. f' n ?x))
[PROOF STEP]
obtain k where k: "strict_mono k"
    and conv: "convergent (\<lambda>n. f' (k n) x)" for x
[PROOF STATE]
proof (prove)
using this:
bounded (range (\<lambda>n. f' n ?x))

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>strict_mono k; \<And>x. convergent (\<lambda>n. f' (k n) x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(rule convergent_bounded_family_nat) iprover
[PROOF STATE]
proof (state)
this:
strict_mono k
convergent (\<lambda>n. f' (k n) ?x)

goal (2 subgoals):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "convergent (\<lambda>n. f (k n) x)" if "x \<in> A" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f (k n) x)
[PROOF STEP]
using conv[of "to_nat_on A x"] A that
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. f' (k n) (to_nat_on A x))
countable A
x \<in> A

goal (1 subgoal):
 1. convergent (\<lambda>n. f (k n) x)
[PROOF STEP]
by(simp add: f'_def)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) ?x)

goal (2 subgoals):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with k
[PROOF STATE]
proof (chain)
picking this:
strict_mono k
?x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) ?x)
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
strict_mono k
?x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) ?x)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal (1 subgoal):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A = {}

goal (1 subgoal):
 1. \<lbrakk>\<And>k. \<lbrakk>strict_mono k; \<And>x. x \<in> A \<Longrightarrow> convergent (\<lambda>n. f (k n) x)\<rbrakk> \<Longrightarrow> thesis; A = {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with strict_mono_id
[PROOF STATE]
proof (chain)
picking this:
strict_mono id
A = {}
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
strict_mono id
A = {}

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(blast intro!: that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_Zfun_iff: "(f \<longlongrightarrow> a) F = Zfun (\<lambda>x. f x - a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> a) F = Zfun (\<lambda>x. f x - a) F
[PROOF STEP]
by (simp only: tendsto_iff Zfun_def dist_norm)


[STATEMENT]
lemma openin_trans_full:
   "\<lbrakk>openin (subtopology X U) S; openin X U\<rbrakk> \<Longrightarrow> openin X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>openin (subtopology X U) S; openin X U\<rbrakk> \<Longrightarrow> openin X S
[PROOF STEP]
by (simp add: openin_open_subtopology)


[STATEMENT]
lemma dim_row_echelon[simp]:
  shows "dim_row (row_echelon A) = dim_row A" and "dim_col (row_echelon A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (row_echelon A) = dim_row A &&& dim_col (row_echelon A) = dim_col A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_row (row_echelon A) = dim_row A
 2. dim_col (row_echelon A) = dim_col A
[PROOF STEP]
have "A \<in> carrier_mat (dim_row A) (dim_col A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat (dim_row A) (dim_col A)

goal (2 subgoals):
 1. dim_row (row_echelon A) = dim_row A
 2. dim_col (row_echelon A) = dim_col A
[PROOF STEP]
hence "row_echelon A \<in> carrier_mat (dim_row A) (dim_col A)"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. row_echelon A \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
by (rule row_echelon_carrier)
[PROOF STATE]
proof (state)
this:
row_echelon A \<in> carrier_mat (dim_row A) (dim_col A)

goal (2 subgoals):
 1. dim_row (row_echelon A) = dim_row A
 2. dim_col (row_echelon A) = dim_col A
[PROOF STEP]
thus "dim_row (row_echelon A) = dim_row A" and "dim_col (row_echelon A) = dim_col A"
[PROOF STATE]
proof (prove)
using this:
row_echelon A \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. dim_row (row_echelon A) = dim_row A &&& dim_col (row_echelon A) = dim_col A
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
dim_row (row_echelon A) = dim_row A
dim_col (row_echelon A) = dim_col A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_set_remove_last:
  assumes "distinct (xs @ [x])"
  shows "set xs = set (xs @ [x]) - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs = set (xs @ [x]) - {x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct (xs @ [x])

goal (1 subgoal):
 1. set xs = set (xs @ [x]) - {x}
[PROOF STEP]
by force


[STATEMENT]
theorem gen_kleene_lfp:
  fixes f:: "'a::complete_lattice \<Rightarrow> 'a"
  assumes CONT: "cont f"
  shows "lfp (\<lambda>x. sup m (f x)) = (SUP i. (f^^i) m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp (\<lambda>x. sup m (f x)) = (SUP i. (f ^^ i) m)
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
let ?f = "(\<lambda>x. sup m (f x))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
let ?K="{ (f^^i) m | i . True}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
note MONO=cont_is_mono[OF CONT]
[PROOF STATE]
proof (state)
this:
mono f

goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
note MONO'[refine_mono] = monoD[OF MONO]
[PROOF STATE]
proof (state)
this:
?x \<le> ?y \<Longrightarrow> f ?x \<le> f ?y

goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x \<le> ?y \<Longrightarrow> f ?x \<le> f ?y

goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
have "(f^^i) m \<le> lfp ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
apply (induct i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f ^^ 0) m \<le> lfp (\<lambda>x. sup m (f x))
 2. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> (f ^^ Suc i) m \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. m \<le> lfp (\<lambda>x. sup m (f x))
 2. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> (f ^^ Suc i) m \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
apply (subst lfp_unfold)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. mono (\<lambda>x. sup m (f x))
 2. m \<le> sup m (f (lfp (\<lambda>x. sup m (f x))))
 3. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> (f ^^ Suc i) m \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
apply (meson MONO' monoI order_mono_setup.refl sup_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. m \<le> sup m (f (lfp (\<lambda>x. sup m (f x))))
 2. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> (f ^^ Suc i) m \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> (f ^^ Suc i) m \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
apply (subst lfp_unfold)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> mono (\<lambda>x. sup m (f x))
 2. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> (f ^^ Suc i) m \<le> sup m (f (lfp (\<lambda>x. sup m (f x))))
[PROOF STEP]
apply (meson MONO' monoI order_mono_setup.refl sup_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> (f ^^ Suc i) m \<le> sup m (f (lfp (\<lambda>x. sup m (f x))))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x)) \<Longrightarrow> f ((f ^^ i) m) \<le> sup m (f (lfp (\<lambda>x. sup m (f x))))
[PROOF STEP]
by (metis MONO' le_supI2)
[PROOF STATE]
proof (state)
this:
(f ^^ i) m \<le> lfp (\<lambda>x. sup m (f x))

goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(f ^^ ?i2) m \<le> lfp (\<lambda>x. sup m (f x))

goal (2 subgoals):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
 2. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
thus "(SUP i. (f^^i) m) \<le> lfp ?f"
[PROOF STATE]
proof (prove)
using this:
(f ^^ ?i2) m \<le> lfp (\<lambda>x. sup m (f x))

goal (1 subgoal):
 1. (SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))
[PROOF STEP]
by (blast intro: SUP_least)
[PROOF STATE]
proof (state)
this:
(SUP i. (f ^^ i) m) \<le> lfp (\<lambda>x. sup m (f x))

goal (1 subgoal):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
let ?f = "(\<lambda>x. sup m (f x))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
show "lfp ?f \<le> (SUP i. (f^^i) m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (rule lfp_lowerbound)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup m (f (SUP i. (f ^^ i) m)) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (rule sup_least)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. m \<le> (SUP i. (f ^^ i) m)
 2. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (rule order_trans[OF _ SUP_upper[where i=0]], simp_all) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (simp add: contD [OF CONT])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (f ` range (\<lambda>i. (f ^^ i) m)) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (rule Sup_subset_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` range (\<lambda>i. (f ^^ i) m) \<subseteq> range (\<lambda>i. (f ^^ i) m)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. f ((f ^^ i) m) \<in> range (\<lambda>i. (f ^^ i) m)
[PROOF STEP]
apply (rule_tac x="Suc i" in range_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. f ((f ^^ i) m) = (f ^^ Suc i) m
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
lfp (\<lambda>x. sup m (f x)) \<le> (SUP i. (f ^^ i) m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sup_homomorphism_mono:
  "sup_homomorphism (f::'a::semilattice_sup \<Rightarrow> 'b::semilattice_sup) \<Longrightarrow> mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_homomorphism f \<Longrightarrow> mono f
[PROOF STEP]
by (metis le_iff_sup monoI)


[STATEMENT]
lemma cinner_adj_right:
  fixes G :: "'b::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'a::complex_inner"
  shows \<open>x \<bullet>\<^sub>C (G* *\<^sub>V y) = (G *\<^sub>V x) \<bullet>\<^sub>C y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet>\<^sub>C (G* *\<^sub>V y) = (G *\<^sub>V x) \<bullet>\<^sub>C y
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x G y. bounded_clinear G \<Longrightarrow> x \<bullet>\<^sub>C (G\<^sup>\<dagger>) y = G x \<bullet>\<^sub>C y
[PROOF STEP]
using cadjoint_univ_prop'
[PROOF STATE]
proof (prove)
using this:
bounded_clinear ?G \<Longrightarrow> ?x \<bullet>\<^sub>C (?G\<^sup>\<dagger>) ?y = ?G ?x \<bullet>\<^sub>C ?y

goal (1 subgoal):
 1. \<And>x G y. bounded_clinear G \<Longrightarrow> x \<bullet>\<^sub>C (G\<^sup>\<dagger>) y = G x \<bullet>\<^sub>C y
[PROOF STEP]
by blast


[STATEMENT]
lemma point_eqI [intro?]:
  "\<lbrakk>abscissa M = abscissa N; ordinate M = ordinate N\<rbrakk> \<Longrightarrow> M = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>abscissa M = abscissa N; ordinate M = ordinate N\<rbrakk> \<Longrightarrow> M = N
[PROOF STEP]
by (induct M, induct N) simp


[STATEMENT]
lemma rpr_le_trans[trans]: "\<lbrakk> x \<^bsub>r\<^esub>\<preceq> y; y \<^bsub>r\<^esub>\<preceq> z; rpr A r \<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<preceq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<preceq> y; y \<^bsub>r\<^esub>\<preceq> z; rpr A r\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<preceq> z
[PROOF STEP]
unfolding rpr_def trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<preceq> y; y \<^bsub>r\<^esub>\<preceq> z; complete A r \<and> refl_on A r \<and> (\<forall>x y z. x \<^bsub>r\<^esub>\<preceq> y \<longrightarrow> y \<^bsub>r\<^esub>\<preceq> z \<longrightarrow> x \<^bsub>r\<^esub>\<preceq> z)\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<preceq> z
[PROOF STEP]
by blast


[STATEMENT]
lemma countable_int: "countable \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable \<int>
[PROOF STEP]
unfolding Ints_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (range of_int)
[PROOF STEP]
by auto


[STATEMENT]
lemma T_intersec_meas [measurable]:
  assumes [measurable]: "A \<in> sets M" "B \<in> sets M"
  shows "A \<inter> T-`B \<in> sets M"
        "A \<inter> (T^^n)-`B \<in> sets M"
        "T-`A \<inter> B \<in> sets M"
        "(T^^n)-`A \<inter> B \<in> sets M"
        "A \<inter> (T \<circ> T ^^ n) -` B \<in> sets M"
        "(T \<circ> T ^^ n) -` A \<inter> B \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<inter> T -` B \<in> sets M &&& A \<inter> (T ^^ n) -` B \<in> sets M &&& T -` A \<inter> B \<in> sets M) &&& (T ^^ n) -` A \<inter> B \<in> sets M &&& A \<inter> (T \<circ> T ^^ n) -` B \<in> sets M &&& (T \<circ> T ^^ n) -` A \<inter> B \<in> sets M
[PROOF STEP]
by (metis T_meas Tn_meas assms(1) assms(2) measurable_comp sets.Int inf_commute
      vrestr_intersec_in_space vrestr_meas)+


[STATEMENT]
lemma openin_Union[intro]: "(\<And>S. S \<in> K \<Longrightarrow> openin U S) \<Longrightarrow> openin U (\<Union>K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. S \<in> K \<Longrightarrow> openin U S) \<Longrightarrow> openin U (\<Union> K)
[PROOF STEP]
using openin_clauses
[PROOF STATE]
proof (prove)
using this:
openin ?U {}
\<lbrakk>openin ?U ?S; openin ?U ?T\<rbrakk> \<Longrightarrow> openin ?U (?S \<inter> ?T)
\<forall>S\<in>?K. openin ?U S \<Longrightarrow> openin ?U (\<Union> ?K)

goal (1 subgoal):
 1. (\<And>S. S \<in> K \<Longrightarrow> openin U S) \<Longrightarrow> openin U (\<Union> K)
[PROOF STEP]
by blast


[STATEMENT]
lemma approachable_lt_le2:
    "(\<exists>(d::real) > 0. \<forall>x. Q x \<longrightarrow> f x < d \<longrightarrow> P x) \<longleftrightarrow> (\<exists>d>0. \<forall>x. f x \<le> d \<longrightarrow> Q x \<longrightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d>0. \<forall>x. Q x \<longrightarrow> f x < d \<longrightarrow> P x) = (\<exists>d>0. \<forall>x. f x \<le> d \<longrightarrow> Q x \<longrightarrow> P x)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>d. \<lbrakk>0 < d; \<forall>x. Q x \<longrightarrow> f x < d \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x. f x \<le> d \<longrightarrow> Q x \<longrightarrow> P x
[PROOF STEP]
apply (rule_tac x="d/2" in exI, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iRelease_iWeakUntil_conv: "(P t'. t' \<R> t I. Q t) = (Q t'. t' \<W> t I. (Q t \<and> P t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t'. t' \<R> t I. Q t) = (Q t'. t' \<W> t I. Q t \<and> P t)
[PROOF STEP]
apply (unfold iRelease_def iWeakUntil_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<box> t I. Q t) \<or> (\<diamond> t I. P t \<and> (\<box> t' I \<down>\<le> t. Q t'))) = ((\<box> t I. Q t) \<or> (\<diamond> t I. (Q t \<and> P t) \<and> (\<box> t' I \<down>< t. Q t')))
[PROOF STEP]
apply (simp add: cut_le_less_conv_if)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<box> t I. Q t) \<or> (\<diamond> t I. (t \<in> I \<longrightarrow> P t \<and> (\<box> t' insert t (I \<down>< t). Q t')) \<and> (t \<notin> I \<longrightarrow> P t \<and> (\<box> t' I \<down>< t. Q t')))) = ((\<box> t I. Q t) \<or> (\<diamond> t I. Q t \<and> P t \<and> iAll (I \<down>< t) Q))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem Derivation_implies_leftderives_gen:
  "Derivation a D (u@v) \<Longrightarrow> is_word u \<Longrightarrow> (\<exists> w.
          leftderives a (u@w) \<and>
          (v = [] \<longrightarrow> w = []) \<and>
          (\<forall> X. is_first X v \<longrightarrow> is_first X w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
proof (induct "length D" arbitrary: D a u v)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>D a u v. \<lbrakk>0 = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 = length D
Derivation a D (u @ v)
is_word u

goal (2 subgoals):
 1. \<And>D a u v. \<lbrakk>0 = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 = length D
Derivation a D (u @ v)
is_word u
[PROOF STEP]
have "a = u@v"
[PROOF STATE]
proof (prove)
using this:
0 = length D
Derivation a D (u @ v)
is_word u

goal (1 subgoal):
 1. a = u @ v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = u @ v

goal (2 subgoals):
 1. \<And>D a u v. \<lbrakk>0 = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
a = u @ v

goal (1 subgoal):
 1. \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
by (rule_tac x = v in exI, auto)
[PROOF STATE]
proof (state)
this:
\<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)

goal (1 subgoal):
 1. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = length ?D; Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
Suc n = length D
Derivation a D (u @ v)
is_word u

goal (1 subgoal):
 1. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = length ?D; Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
Suc n = length D
Derivation a D (u @ v)
is_word u
[PROOF STEP]
have "D \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = length ?D; Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
Suc n = length D
Derivation a D (u @ v)
is_word u

goal (1 subgoal):
 1. D \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D \<noteq> []

goal (1 subgoal):
 1. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
with Suc Derivation_leftmost
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = length ?D; Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
Suc n = length D
Derivation a D (u @ v)
is_word u
\<lbrakk>?D \<noteq> []; Derivation ?a ?D ?b\<rbrakk> \<Longrightarrow> \<exists>i. leftmost i ?a
D \<noteq> []
[PROOF STEP]
have "\<exists> i. leftmost i a"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = length ?D; Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
Suc n = length D
Derivation a D (u @ v)
is_word u
\<lbrakk>?D \<noteq> []; Derivation ?a ?D ?b\<rbrakk> \<Longrightarrow> \<exists>i. leftmost i ?a
D \<noteq> []

goal (1 subgoal):
 1. \<exists>i. leftmost i a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>i. leftmost i a

goal (1 subgoal):
 1. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>i. leftmost i a
[PROOF STEP]
obtain i where i: "leftmost i a"
[PROOF STATE]
proof (prove)
using this:
\<exists>i. leftmost i a

goal (1 subgoal):
 1. (\<And>i. leftmost i a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
leftmost i a

goal (1 subgoal):
 1. \<And>x D a u v. \<lbrakk>\<And>D a u v. \<lbrakk>x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w); Suc x = length D; Derivation a D (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
show "?case"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
proof (cases "derivation_ge D (Suc i)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
derivation_ge D (Suc i)

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = length ?D; Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
Suc n = length D
Derivation a D (u @ v)
is_word u
derivation_ge D (Suc i)
[PROOF STEP]
have leftmost: "leftmost i (u@v)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = length ?D; Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
Suc n = length D
Derivation a D (u @ v)
is_word u
derivation_ge D (Suc i)

goal (1 subgoal):
 1. leftmost i (u @ v)
[PROOF STEP]
by (rule_tac leftmost_unaffected_Derivation[OF True i], auto)
[PROOF STATE]
proof (state)
this:
leftmost i (u @ v)

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
have length_u: "length u \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length u \<le> i
[PROOF STEP]
using leftmost_append[OF leftmost Suc(4)]
[PROOF STATE]
proof (prove)
using this:
length u \<le> i

goal (1 subgoal):
 1. length u \<le> i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
length u \<le> i

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
have take_Suc: "take (Suc i) a = take (Suc i) (u@v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take (Suc i) a = take (Suc i) (u @ v)
[PROOF STEP]
using  Derivation_take[OF True Suc(3)]
[PROOF STATE]
proof (prove)
using this:
take (Suc i) a = take (Suc i) (u @ v)

goal (1 subgoal):
 1. take (Suc i) a = take (Suc i) (u @ v)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
take (Suc i) a = take (Suc i) (u @ v)

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
with length_u
[PROOF STATE]
proof (chain)
picking this:
length u \<le> i
take (Suc i) a = take (Suc i) (u @ v)
[PROOF STEP]
have is_prefix_u: "is_prefix u a"
[PROOF STATE]
proof (prove)
using this:
length u \<le> i
take (Suc i) a = take (Suc i) (u @ v)

goal (1 subgoal):
 1. is_prefix u a
[PROOF STEP]
by (metis append_assoc append_take_drop_id dual_order.strict_implies_order
              is_prefix_def le_imp_less_Suc take_all take_append)
[PROOF STATE]
proof (state)
this:
is_prefix u a

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
have a: "u @ drop (length u) a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u @ drop (length u) a = a
[PROOF STEP]
using is_prefix_unsplit[OF is_prefix_u]
[PROOF STATE]
proof (prove)
using this:
u @ drop (length u) a = a

goal (1 subgoal):
 1. u @ drop (length u) a = a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
u @ drop (length u) a = a

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
from take_Suc
[PROOF STATE]
proof (chain)
picking this:
take (Suc i) a = take (Suc i) (u @ v)
[PROOF STEP]
have length_take_Suc: "length (take (Suc i) a) = Suc i"
[PROOF STATE]
proof (prove)
using this:
take (Suc i) a = take (Suc i) (u @ v)

goal (1 subgoal):
 1. length (take (Suc i) a) = Suc i
[PROOF STEP]
by (metis Suc_leI i leftmost_def length_take min.absorb2)
[PROOF STATE]
proof (state)
this:
length (take (Suc i) a) = Suc i

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
have v: "v \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<noteq> []
[PROOF STEP]
proof(cases "v = []")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v = [] \<Longrightarrow> v \<noteq> []
 2. v \<noteq> [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
v \<noteq> []

goal (2 subgoals):
 1. v = [] \<Longrightarrow> v \<noteq> []
 2. v \<noteq> [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<noteq> []

goal (1 subgoal):
 1. v \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> []

goal (1 subgoal):
 1. v = [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v = [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
v = []

goal (1 subgoal):
 1. v = [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
with length_u
[PROOF STATE]
proof (chain)
picking this:
length u \<le> i
v = []
[PROOF STEP]
have right: "length(take (Suc i) (u@v)) = length u"
[PROOF STATE]
proof (prove)
using this:
length u \<le> i
v = []

goal (1 subgoal):
 1. length (take (Suc i) (u @ v)) = length u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (take (Suc i) (u @ v)) = length u

goal (1 subgoal):
 1. v = [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
note left = length_take_Suc
[PROOF STATE]
proof (state)
this:
length (take (Suc i) a) = Suc i

goal (1 subgoal):
 1. v = [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
from left right take_Suc
[PROOF STATE]
proof (chain)
picking this:
length (take (Suc i) a) = Suc i
length (take (Suc i) (u @ v)) = length u
take (Suc i) a = take (Suc i) (u @ v)
[PROOF STEP]
have "Suc i = length u"
[PROOF STATE]
proof (prove)
using this:
length (take (Suc i) a) = Suc i
length (take (Suc i) (u @ v)) = length u
take (Suc i) a = take (Suc i) (u @ v)

goal (1 subgoal):
 1. Suc i = length u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc i = length u

goal (1 subgoal):
 1. v = [] \<Longrightarrow> v \<noteq> []
[PROOF STEP]
with length_u
[PROOF STATE]
proof (chain)
picking this:
length u \<le> i
Suc i = length u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length u \<le> i
Suc i = length u

goal (1 subgoal):
 1. v \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> []

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v \<noteq> []

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> []
[PROOF STEP]
have "\<exists> X w. v = X#w"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> []

goal (1 subgoal):
 1. \<exists>X w. v = X # w
[PROOF STEP]
by (cases v, auto)
[PROOF STATE]
proof (state)
this:
\<exists>X w. v = X # w

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>X w. v = X # w
[PROOF STEP]
obtain X w where v: "v = X#w"
[PROOF STATE]
proof (prove)
using this:
\<exists>X w. v = X # w

goal (1 subgoal):
 1. (\<And>X w. v = X # w \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v = X # w

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
have is_first_X: "is_first X (drop (length u) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_first X (drop (length u) a)
[PROOF STEP]
apply (rule_tac is_first_drop_length[where v=v and w=w and k="Suc i"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. Suc i \<le> length a
 2. length u < Suc i
 3. v = X # w
 4. take (Suc i) a = take (Suc i) (u @ v)
[PROOF STEP]
apply (simp_all add: take_Suc v)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Suc i \<le> length a
 2. length u < Suc i
[PROOF STEP]
apply (metis Suc_leI i leftmost_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length u < Suc i
[PROOF STEP]
apply (insert length_u)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length u \<le> i \<Longrightarrow> length u < Suc i
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
is_first X (drop (length u) a)

goal (2 subgoals):
 1. derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
 2. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
apply (rule exI[where x="drop (length u) a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. leftderives a (u @ drop (length u) a) \<and> (v = [] \<longrightarrow> drop (length u) a = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X (drop (length u) a))
[PROOF STEP]
by (simp add: a v is_first_cons is_first_X)
[PROOF STATE]
proof (state)
this:
\<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> derivation_ge D (Suc i)

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
have Di: "derivation_ge D i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. derivation_ge D i
[PROOF STEP]
using leftmost_Derivation[OF i Suc(3), where j=i, simplified]
[PROOF STATE]
proof (prove)
using this:
derivation_ge D i

goal (1 subgoal):
 1. derivation_ge D i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
derivation_ge D i

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
from split_derivation_leftmost[OF Di False]
[PROOF STATE]
proof (chain)
picking this:
\<exists>E F r. D = E @ [(i, r)] @ F \<and> derivation_ge E (Suc i)
[PROOF STEP]
obtain E F r where D_split: "D = E @ [(i, r)] @ F"
        and E_Suc: "derivation_ge E (Suc i)"
[PROOF STATE]
proof (prove)
using this:
\<exists>E F r. D = E @ [(i, r)] @ F \<and> derivation_ge E (Suc i)

goal (1 subgoal):
 1. (\<And>E r F. \<lbrakk>D = E @ [(i, r)] @ F; derivation_ge E (Suc i)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
D = E @ [(i, r)] @ F
derivation_ge E (Suc i)

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
let ?D = "(derivation_shift E 1 (length (snd r)))@F"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
from D_split
[PROOF STATE]
proof (chain)
picking this:
D = E @ [(i, r)] @ F
[PROOF STEP]
have "Derivation a ((i,r) # ?D) (u @ v)"
[PROOF STATE]
proof (prove)
using this:
D = E @ [(i, r)] @ F

goal (1 subgoal):
 1. Derivation a ((i, r) # derivation_shift E 1 (length (snd r)) @ F) (u @ v)
[PROOF STEP]
using Derivation_swap_single_mid_to_front E_Suc Suc.prems(1) lessI
[PROOF STATE]
proof (prove)
using this:
D = E @ [(i, r)] @ F
\<lbrakk>?i < ?j; derivation_ge ?D ?j; Derivation ?a (?D @ [(?i, ?r)] @ ?E) ?b\<rbrakk> \<Longrightarrow> Derivation ?a ((?i, ?r) # derivation_shift ?D 1 (length (snd ?r)) @ ?E) ?b
derivation_ge E (Suc i)
Derivation a D (u @ v)
?n < Suc ?n

goal (1 subgoal):
 1. Derivation a ((i, r) # derivation_shift E 1 (length (snd r)) @ F) (u @ v)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Derivation a ((i, r) # derivation_shift E 1 (length (snd r)) @ F) (u @ v)

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Derivation a ((i, r) # derivation_shift E 1 (length (snd r)) @ F) (u @ v)
[PROOF STEP]
have "\<exists> y. Derives1 a i r y \<and> Derivation y ?D (u @ v)"
[PROOF STATE]
proof (prove)
using this:
Derivation a ((i, r) # derivation_shift E 1 (length (snd r)) @ F) (u @ v)

goal (1 subgoal):
 1. \<exists>y. Derives1 a i r y \<and> Derivation y (derivation_shift E 1 (length (snd r)) @ F) (u @ v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>y. Derives1 a i r y \<and> Derivation y (derivation_shift E 1 (length (snd r)) @ F) (u @ v)

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. Derives1 a i r y \<and> Derivation y (derivation_shift E 1 (length (snd r)) @ F) (u @ v)
[PROOF STEP]
obtain y where ay:"Derives1 a i r y"
        and yuv: "Derivation y ?D (u @ v)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. Derives1 a i r y \<and> Derivation y (derivation_shift E 1 (length (snd r)) @ F) (u @ v)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>Derives1 a i r y; Derivation y (derivation_shift E 1 (length (snd r)) @ F) (u @ v)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Derives1 a i r y
Derivation y (derivation_shift E 1 (length (snd r)) @ F) (u @ v)

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
have length_D': "length ?D = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (derivation_shift E 1 (length (snd r)) @ F) = n
[PROOF STEP]
using D_split Suc.hyps(2)
[PROOF STATE]
proof (prove)
using this:
D = E @ [(i, r)] @ F
Suc n = length D

goal (1 subgoal):
 1. length (derivation_shift E 1 (length (snd r)) @ F) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (derivation_shift E 1 (length (snd r)) @ F) = n

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
from Suc(1)[OF length_D'[symmetric] yuv Suc(4)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>w. leftderives y (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
obtain w where "leftderives y (u @ w)" and "(v = [] \<longrightarrow> w = [])"
        and "\<forall>X. is_first X v \<longrightarrow> is_first X w"
[PROOF STATE]
proof (prove)
using this:
\<exists>w. leftderives y (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>leftderives y (u @ w); v = [] \<longrightarrow> w = []; \<forall>X. is_first X v \<longrightarrow> is_first X w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
leftderives y (u @ w)
v = [] \<longrightarrow> w = []
\<forall>X. is_first X v \<longrightarrow> is_first X w

goal (1 subgoal):
 1. \<not> derivation_ge D (Suc i) \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
leftderives y (u @ w)
v = [] \<longrightarrow> w = []
\<forall>X. is_first X v \<longrightarrow> is_first X w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
leftderives y (u @ w)
v = [] \<longrightarrow> w = []
\<forall>X. is_first X v \<longrightarrow> is_first X w

goal (1 subgoal):
 1. \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
using ay i leftmost_Derives1_leftderives
[PROOF STATE]
proof (prove)
using this:
leftderives y (u @ w)
v = [] \<longrightarrow> w = []
\<forall>X. is_first X v \<longrightarrow> is_first X w
Derives1 a i r y
leftmost i a
\<lbrakk>leftmost ?i ?a; Derives1 ?a ?i ?r ?b; leftderives ?b ?c\<rbrakk> \<Longrightarrow> leftderives ?a ?c

goal (1 subgoal):
 1. \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans2: "(l::nat) =  a1 + a2 + a3  \<Longrightarrow>  a1 \<le> r \<Longrightarrow> l \<le> r + a2 + a3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l = a1 + a2 + a3; a1 \<le> r\<rbrakk> \<Longrightarrow> l \<le> r + a2 + a3
[PROOF STEP]
by simp


[STATEMENT]
lemma cball_eq_sing':
  fixes x :: "'a::{metric_space,perfect_space}"
  shows "cball x e = {y} \<longleftrightarrow> e = 0 \<and> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cball x e = {y}) = (e = 0 \<and> x = y)
[PROOF STEP]
using cball_eq_sing[of x e]
[PROOF STATE]
proof (prove)
using this:
(cball x e = {x}) = (e = 0)

goal (1 subgoal):
 1. (cball x e = {y}) = (e = 0 \<and> x = y)
[PROOF STEP]
apply (cases "x = y", force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(cball x e = {x}) = (e = 0); x \<noteq> y\<rbrakk> \<Longrightarrow> (cball x e = {y}) = (e = 0 \<and> x = y)
[PROOF STEP]
by (metis cball_empty centre_in_cball insert_not_empty not_le singletonD)


[STATEMENT]
lemma doubleRestriction:  "((P || X) || Y) = (P || (X \<inter> Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P || X) || Y = P || (X \<inter> Y)
[PROOF STEP]
unfolding restrict_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y \<times> Range (X \<times> Range P \<inter> P) \<inter> (X \<times> Range P \<inter> P) = (X \<inter> Y) \<times> Range P \<inter> P
[PROOF STEP]
by fast


[STATEMENT]
lemma parts_insert_subset: "insert X (parts H) \<subseteq> parts(insert X H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert X (parts H) \<subseteq> parts (insert X H)
[PROOF STEP]
by (blast intro: parts_mono [THEN [2] rev_subsetD])


[STATEMENT]
lemma partn_lst_eq_partn: "partn_lst {..<n} [m,m] 2 = partn {..<n} m 2 {..<2::nat}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partn_lst {..<n} [m, m] 2 = partn {..<n} m 2 {..<2}
[PROOF STEP]
apply (simp add: partn_lst_def partn_def numeral_2_eq_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>f\<in>[{..<n}]\<^bsup>Suc (Suc 0)\<^esup> \<rightarrow> {..<Suc (Suc 0)}. \<exists>i<Suc (Suc 0). \<exists>H\<in>[{..<n}]\<^bsup>([m, m] ! i)\<^esup>. f ` [H]\<^bsup>Suc (Suc 0)\<^esup> \<subseteq> {i}) = (\<forall>f\<in>[{..<n}]\<^bsup>Suc (Suc 0)\<^esup> \<rightarrow> {..<Suc (Suc 0)}. \<exists>H\<in>[{..<n}]\<^bsup>m\<^esup>. \<exists>\<xi>\<in>{..<Suc (Suc 0)}. f ` [H]\<^bsup>Suc (Suc 0)\<^esup> \<subseteq> {\<xi>})
[PROOF STEP]
by (metis less_2_cases numeral_2_eq_2 lessThan_iff nth_Cons_0 nth_Cons_Suc)


[STATEMENT]
lemma mod_exhaust_less_4: "m mod 4 = 0 \<or> m mod 4 = 1 \<or> m mod 4 = 2 \<or> m mod 4 = 3"
  for m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m mod 4 = 0 \<or> m mod 4 = 1 \<or> m mod 4 = 2 \<or> m mod 4 = 3
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_monom:
  "Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) =
      fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
have "Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) =
          fps_compose (Abs_fps (\<lambda>n. of_nat n ^ k)) (fps_const c * fps_X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = Abs_fps (\<lambda>n. of_nat n ^ k) oo fps_const c * fps_X
[PROOF STEP]
by (subst fps_compose_linear) (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = Abs_fps (\<lambda>n. of_nat n ^ k) oo fps_const c * fps_X

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = Abs_fps (\<lambda>n. of_nat n ^ k) oo fps_const c * fps_X

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
have "Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (fps_monom_poly 1 k) / (1 - fps_X) ^ (k+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (fps_monom_poly (1::'b) k) / (1 - fps_X) ^ (k + 1)
[PROOF STEP]
by (rule fps_monom_aux)
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (fps_monom_poly (1::?'b1) k) / (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k) = fps_of_poly (fps_monom_poly (1::?'b1) k) / (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
have "fps_compose \<dots> (fps_const c * fps_X) =
                 (fps_of_poly (fps_monom_poly 1 k) oo fps_const c * fps_X) /
                 ((1 - fps_X) ^ (k + 1) oo fps_const c * fps_X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (fps_monom_poly (1::'a) k) / (1 - fps_X) ^ (k + 1) oo fps_const c * fps_X = (fps_of_poly (fps_monom_poly (1::'a) k) oo fps_const c * fps_X) / ((1 - fps_X) ^ (k + 1) oo fps_const c * fps_X)
[PROOF STEP]
by (intro fps_compose_divide_distrib)
       (simp_all add: fps_compose_power [symmetric] fps_compose_sub_distrib del: power_Suc)
[PROOF STATE]
proof (state)
this:
fps_of_poly (fps_monom_poly (1::'a) k) / (1 - fps_X) ^ (k + 1) oo fps_const c * fps_X = (fps_of_poly (fps_monom_poly (1::'a) k) oo fps_const c * fps_X) / ((1 - fps_X) ^ (k + 1) oo fps_const c * fps_X)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_of_poly (fps_monom_poly (1::'a) k) / (1 - fps_X) ^ (k + 1) oo fps_const c * fps_X = (fps_of_poly (fps_monom_poly (1::'a) k) oo fps_const c * fps_X) / ((1 - fps_X) ^ (k + 1) oo fps_const c * fps_X)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
have "fps_of_poly (fps_monom_poly 1 k) oo (fps_const c * fps_X) =
                fps_of_poly (fps_monom_poly c k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (fps_monom_poly (1::'a) k) oo fps_const c * fps_X = fps_of_poly (fps_monom_poly c k)
[PROOF STEP]
by (simp add: fps_monom_poly_def fps_of_poly_pcompose fps_of_poly_simps
                  fps_of_poly_pCons mult_ac)
[PROOF STATE]
proof (state)
this:
fps_of_poly (fps_monom_poly (1::'a) k) oo fps_const c * fps_X = fps_of_poly (fps_monom_poly c k)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_of_poly (fps_monom_poly (1::'a) k) oo fps_const c * fps_X = fps_of_poly (fps_monom_poly c k)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
have "((1 - fps_X) ^ (k + 1) oo fps_const c * fps_X) = (1 - fps_const c * fps_X) ^ (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - fps_X) ^ (k + 1) oo fps_const c * fps_X = (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
by (simp add: fps_compose_power [symmetric] fps_compose_sub_distrib del: power_Suc)
[PROOF STATE]
proof (state)
this:
(1 - fps_X) ^ (k + 1) oo fps_const c * fps_X = (1 - fps_const c * fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. of_nat n ^ k * c ^ n) = fps_of_poly (fps_monom_poly c k) / (1 - fps_const c * fps_X) ^ (k + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_separate_3:
  assumes "y * x\<^sup>\<star> * y \<le> y"
    shows "(x \<squnion> y)\<^sup>\<star> = x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y)\<^sup>\<star> = x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star>
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (x \<squnion> y)\<^sup>\<star> \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star>
 2. x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>
[PROOF STEP]
have "x\<^sup>\<star> * y * (x\<^sup>\<star> * y)\<^sup>\<star> * x\<^sup>\<star> \<le> x\<^sup>\<star> * y * x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sup>\<star> * y)\<^sup>+ * x\<^sup>\<star> \<le> x\<^sup>\<star> * y * x\<^sup>\<star>
[PROOF STEP]
by (metis assms mult_left_isotone mult_right_isotone star_right_induct_mult mult_assoc)
[PROOF STATE]
proof (state)
this:
(x\<^sup>\<star> * y)\<^sup>+ * x\<^sup>\<star> \<le> x\<^sup>\<star> * y * x\<^sup>\<star>

goal (2 subgoals):
 1. (x \<squnion> y)\<^sup>\<star> \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star>
 2. x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>
[PROOF STEP]
thus "(x \<squnion> y)\<^sup>\<star> \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
(x\<^sup>\<star> * y)\<^sup>+ * x\<^sup>\<star> \<le> x\<^sup>\<star> * y * x\<^sup>\<star>

goal (1 subgoal):
 1. (x \<squnion> y)\<^sup>\<star> \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star>
[PROOF STEP]
by (metis order.antisym semiring.add_left_mono star.circ_sup_2 star.circ_sup_sub star.circ_unfold_sum star_decompose_3 star_slide mult_assoc)
[PROOF STATE]
proof (state)
this:
(x \<squnion> y)\<^sup>\<star> \<le> x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>
[PROOF STEP]
show "x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>
[PROOF STEP]
using mult_isotone star.circ_increasing star.circ_sub_dist star.circ_sup_9
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<le> ?y; ?x \<le> ?z\<rbrakk> \<Longrightarrow> ?w * ?x \<le> ?y * ?z
?x \<le> ?x\<^sup>\<star>
?x\<^sup>\<star> \<le> (?x \<squnion> ?y)\<^sup>\<star>
(?x \<squnion> ?y)\<^sup>\<star> = (?x\<^sup>\<star> * ?y)\<^sup>\<star> * ?x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<squnion> x\<^sup>\<star> * y * x\<^sup>\<star> \<le> (x \<squnion> y)\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ENF_offending_case1:
    "\<lbrakk> sinvar_all_edges_normal_form P;  \<not> sinvar G nP \<rbrakk> \<Longrightarrow>
    { {(e1,e2). (e1, e2) \<in> (edges G) \<and> \<not> P (nP e1) (nP e2)} } = set_offending_flows G nP"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP\<rbrakk> \<Longrightarrow> {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}} = set_offending_flows G nP
[PROOF STEP]
apply(rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP\<rbrakk> \<Longrightarrow> {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}} \<subseteq> set_offending_flows G nP
 2. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP\<rbrakk> \<Longrightarrow> set_offending_flows G nP \<subseteq> {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}}
[PROOF STEP]
apply(frule ENF_notevalmodel_imp_offending_not_empty, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP; set_offending_flows G nP \<noteq> {}\<rbrakk> \<Longrightarrow> {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}} \<subseteq> set_offending_flows G nP
 2. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP\<rbrakk> \<Longrightarrow> set_offending_flows G nP \<subseteq> {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}}
[PROOF STEP]
apply(rule ENF_offending_not_empty_imp_ENF_offending_subseteq_rhs, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP; set_offending_flows G nP \<noteq> {}\<rbrakk> \<Longrightarrow> set_offending_flows G nP \<noteq> {}
 2. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP\<rbrakk> \<Longrightarrow> set_offending_flows G nP \<subseteq> {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP\<rbrakk> \<Longrightarrow> set_offending_flows G nP \<subseteq> {{(e1, e2). (e1, e2) \<in> edges G \<and> \<not> P (nP e1) (nP e2)}}
[PROOF STEP]
apply(rule ENF_offending_subseteq_lhs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sinvar_all_edges_normal_form P; \<not> sinvar G nP\<rbrakk> \<Longrightarrow> sinvar_all_edges_normal_form P
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_normalize:
  "norm (normalize p) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (normalize p) = 1
[PROOF STEP]
unfolding normalize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (if p = 0 then axis 1 1 else (1 / norm p) *\<^sub>R p) = 1
[PROOF STEP]
by (auto simp add: norm_axis)


[STATEMENT]
lemma complex_cnj_divide [simp]: "cnj (x / y) = cnj x / cnj y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (x / y) = cnj x / cnj y
[PROOF STEP]
by (simp add: divide_complex_def)


[STATEMENT]
lemma sum_prod:
  fixes f::"nat \<Rightarrow> complex" and g::"nat \<Rightarrow> complex"
  shows "(\<Sum>i<a*b. f(i div b) * g(i mod b)) = (\<Sum>i<a. f(i)) * (\<Sum>j<b. g(j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b}
[PROOF STEP]
proof (induction a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>i<0 * b. f (i div b) * g (i mod b)) = sum f {..<0} * sum g {..<b}
 2. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>i<0 * b. f (i div b) * g (i mod b)) = sum f {..<0} * sum g {..<b}
 2. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<0 * b. f (i div b) * g (i mod b)) = sum f {..<0} * sum g {..<b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<0 * b. f (i div b) * g (i mod b)) = sum f {..<0} * sum g {..<b}

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
case (Suc a)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b}

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
have "(\<Sum>i<(a+1)*b. f (i div b) * g (i mod b)) = (\<Sum>i<a*b. f (i div b) * g (i mod b)) +
(\<Sum>i\<in>{a*b..<(a+1)*b}. f (i div b) * g (i mod b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<(a + 1) * b. f (i div b) * g (i mod b)) = (\<Sum>i<a * b. f (i div b) * g (i mod b)) + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b))
[PROOF STEP]
apply (auto simp: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<b + a * b. f (i div b) * g (i mod b)) = (\<Sum>i<a * b. f (i div b) * g (i mod b)) + (\<Sum>i = a * b..<b + a * b. f (i div b) * g (i mod b))
[PROOF STEP]
by (smt add.commute mult_Suc sum.lessThan_Suc sum.nat_group)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<(a + 1) * b. f (i div b) * g (i mod b)) = (\<Sum>i<a * b. f (i div b) * g (i mod b)) + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<(a + 1) * b. f (i div b) * g (i mod b)) = (\<Sum>i<a * b. f (i div b) * g (i mod b)) + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
have "\<dots> = (\<Sum>i<a. f(i)) * (\<Sum>j<b. g(j)) + (\<Sum>i\<in>{a*b..<(a+1)*b}. f (i div b) * g (i mod b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<a * b. f (i div b) * g (i mod b)) + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b))
[PROOF STEP]
by (simp add: Suc.IH)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<a * b. f (i div b) * g (i mod b)) + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<a * b. f (i div b) * g (i mod b)) + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
have "\<dots> = (\<Sum>i<a. f(i)) * (\<Sum>j<b. g(j)) + (\<Sum>i\<in>{a*b..<(a+1)*b}. f (a) * g(i-a*b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f a * g (i - a * b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f a * g (i - a * b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f a * g (i - a * b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
have "\<dots> = (\<Sum>i<a. f(i)) * (\<Sum>j<b. g(j)) + f(a) * (\<Sum>i\<in>{a*b..<(a+1)*b}. g(i-a*b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f a * g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b))
[PROOF STEP]
by(simp add: sum_distrib_left)
[PROOF STATE]
proof (state)
this:
sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f a * g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {..<a} * sum g {..<b} + (\<Sum>i = a * b..<(a + 1) * b. f a * g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b))

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
have "\<dots> = (\<Sum>i<a. f(i)) * (\<Sum>j<b. g(j)) + f(a) * (\<Sum>i\<in>{..<b}. g(i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * sum g {..<b}
[PROOF STEP]
using sum_of_index_diff[of "g" "(a*b)" "b"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = a * b..<a * b + b. g (i - a * b)) = sum g {..<b}

goal (1 subgoal):
 1. sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * sum g {..<b}
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * sum g {..<b}

goal (1 subgoal):
 1. \<And>a. (\<Sum>i<a * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} \<Longrightarrow> (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b))
sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * sum g {..<b}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<(a + 1) * b. f (i div b) * g (i mod b)) = sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b))
sum f {..<a} * sum g {..<b} + f a * (\<Sum>i = a * b..<(a + 1) * b. g (i - a * b)) = sum f {..<a} * sum g {..<b} + f a * sum g {..<b}

goal (1 subgoal):
 1. (\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}
[PROOF STEP]
by (simp add: semiring_normalization_rules(1))
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc a * b. f (i div b) * g (i mod b)) = sum f {..<Suc a} * sum g {..<b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma \<nu>\<^sub>b_fin_eq: "\<nu>\<^sub>b_fin (mk_stationary d) n = (\<Sum>i < n. ((l *\<^sub>R \<P>\<^sub>1 d)^^ i)) (r_dec\<^sub>b d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu>\<^sub>b_fin (mk_stationary d) n = blinfun_apply (sum ((^^) (l *\<^sub>R \<P>\<^sub>1 d)) {..<n}) (r_dec\<^sub>b d)
[PROOF STEP]
by (induction n) (auto simp add: plus_blinfun.rep_eq)


[STATEMENT]
lemma downset_set_upset_set_dual: "(`) \<partial> \<circ> \<Down> = \<Up> \<circ> (`) \<partial>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) \<partial> \<circ> \<Down> = \<Up> \<circ> (`) \<partial>
[PROOF STEP]
unfolding downset_set_def upset_set_def fun_eq_iff comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<partial> ` {y. Bex x ((\<le>) y)} = {y. \<exists>x\<in>\<partial> ` x. x \<le> y}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa xb xc. \<lbrakk>xc \<in> x; xb \<le> xc\<rbrakk> \<Longrightarrow> \<exists>x\<in>\<partial> ` x. x \<le> \<partial> xb
 2. \<And>x xa xb xc. \<lbrakk>\<partial> xc \<le> xa; xc \<in> x\<rbrakk> \<Longrightarrow> xa \<in> \<partial> ` {y. Bex x ((\<le>) y)}
[PROOF STEP]
apply (meson image_eqI ord_dual)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa xb xc. \<lbrakk>\<partial> xc \<le> xa; xc \<in> x\<rbrakk> \<Longrightarrow> xa \<in> \<partial> ` {y. Bex x ((\<le>) y)}
[PROOF STEP]
by (clarsimp, metis (mono_tags, lifting) dual_iff image_iff mem_Collect_eq ord_dual)


[STATEMENT]
lemma l2_5_1_2: "[P \<longrightarrow> (\<Squnion> S)] \<longleftrightarrow> (\<forall> X \<in> S. [P \<longrightarrow> X])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>A. (P \<longrightarrow> (\<lambda>A. A \<in> \<Inter> {{p. P p} |P. P \<in> S})) A) = (\<forall>X\<in>S. \<forall>A. (P \<longrightarrow> X) A)
[PROOF STEP]
by blast


[STATEMENT]
lemma projecting_Always:
     "projecting (%G. reachable (extend h F\<squnion>G)) h F
                 (Always (extend_set h A)) (Always A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projecting (\<lambda>G. reachable (extend h F \<squnion> G)) h F (Always (extend_set h A)) (Always A)
[PROOF STEP]
apply (unfold projecting_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>G. extend h F \<squnion> G \<in> Always (extend_set h A) \<longrightarrow> F \<squnion> project h (reachable (extend h F \<squnion> G)) G \<in> Always A
[PROOF STEP]
apply (blast intro: project_Always_I)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eventually_sgn_ge_1D:
  assumes "eventually (\<lambda>x::real. sgn (f x) \<ge> l x) at_top"
          "(l expands_to (const_expansion 1 :: 'a :: multiseries)) bs"
  shows   "((\<lambda>x. sgn (f x)) expands_to (const_expansion 1 :: 'a)) bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sgn (f x)) expands_to const_expansion 1) bs
[PROOF STEP]
proof (rule expands_to_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (?f expands_to const_expansion 1) bs
 2. \<forall>\<^sub>F x in at_top. ?f x = sgn (f x)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
(l expands_to const_expansion 1) bs
[PROOF STEP]
have "eventually (\<lambda>x. l x = 1) at_top"
[PROOF STATE]
proof (prove)
using this:
(l expands_to const_expansion 1) bs

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. l x = 1
[PROOF STEP]
by (simp add: expands_to.simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. l x = 1

goal (2 subgoals):
 1. (?f expands_to const_expansion 1) bs
 2. \<forall>\<^sub>F x in at_top. ?f x = sgn (f x)
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. l x \<le> sgn (f x)
\<forall>\<^sub>F x in at_top. l x = 1
[PROOF STEP]
show "eventually (\<lambda>x. 1 = sgn (f x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. l x \<le> sgn (f x)
\<forall>\<^sub>F x in at_top. l x = 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 = sgn (f x)
[PROOF STEP]
by eventually_elim (auto simp: sgn_if split: if_splits)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 = sgn (f x)

goal (1 subgoal):
 1. ((\<lambda>x. 1) expands_to const_expansion 1) bs
[PROOF STEP]
qed (insert assms, auto simp: expands_to.simps)


[STATEMENT]
lemma cfs_X_plus:
  assumes "a \<in> carrier R"
  shows "X_plus a n = (if n = 0 then a else (if n = 1 then \<one> else \<zero>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X_poly_plus R a n = (if n = 0 then a else if n = 1 then \<one> else \<zero>)
[PROOF STEP]
using assms cfs_add monom_closed UP_ring_axioms cfs_monom
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
\<lbrakk>?p \<in> carrier P; ?q \<in> carrier P\<rbrakk> \<Longrightarrow> (?p \<oplus>\<^bsub>P\<^esub> ?q) ?n = ?p ?n \<oplus> ?q ?n
?a \<in> carrier R \<Longrightarrow> monom P ?a ?n \<in> carrier P
UP_ring R
?a \<in> carrier R \<Longrightarrow> monom P ?a ?m ?n = (if ?m = ?n then ?a else \<zero>)

goal (1 subgoal):
 1. X_poly_plus R a n = (if n = 0 then a else if n = 1 then \<one> else \<zero>)
[PROOF STEP]
unfolding X_poly_plus_def to_polynomial_def X_poly_def P_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
\<lbrakk>?p \<in> carrier (UP R); ?q \<in> carrier (UP R)\<rbrakk> \<Longrightarrow> (?p \<oplus>\<^bsub>UP R\<^esub> ?q) ?n = ?p ?n \<oplus> ?q ?n
?a \<in> carrier R \<Longrightarrow> monom (UP R) ?a ?n \<in> carrier (UP R)
UP_ring R
?a \<in> carrier R \<Longrightarrow> monom (UP R) ?a ?m ?n = (if ?m = ?n then ?a else \<zero>)

goal (1 subgoal):
 1. (monom (UP R) \<one> 1 \<oplus>\<^bsub>UP R\<^esub> monom (UP R) a 0) n = (if n = 0 then a else if n = 1 then \<one> else \<zero>)
[PROOF STEP]
by auto