[STATEMENT]
lemma invariantStateSpace_thm_5:
  fixes ss vs domain
  assumes "(stateSpace ss domain)"
  shows "(stateSpace (ss_proj ss vs) (domain \<inter> vs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stateSpace (ss_proj ss vs) (domain \<inter> vs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stateSpace ss domain

goal (1 subgoal):
 1. stateSpace (ss_proj ss vs) (domain \<inter> vs)
[PROOF STEP]
unfolding stateSpace_def ss_proj_def
[PROOF STATE]
proof (prove)
using this:
\<forall>s. s \<in> ss \<longrightarrow> fmdom' s = domain

goal (1 subgoal):
 1. \<forall>s. s \<in> fmrestrict_set vs ` ss \<longrightarrow> fmdom' s = domain \<inter> vs
[PROOF STEP]
by (metis (no_types, lifting) fmdom'_fmrestrict_set imageE inf_commute)


[STATEMENT]
lemma ignores_old_vars_conj:
  assumes Rdef: "(\<And>x. R x = (P x \<and> Q x))"
  assumes iP: "ignores_old_vars P"
  assumes iQ: "ignores_old_vars Q"
  shows "ignores_old_vars R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ignores_old_vars R
[PROOF STEP]
unfolding ignores_old_vars_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>mdss mdss'. length mdss = length mdss' \<and> length mdss' = length cms \<longrightarrow> map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss = map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss' \<longrightarrow> R mdss = R mdss'
[PROOF STEP]
apply(simp add: Rdef)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>mdss mdss'. length mdss = length mdss' \<and> length mdss' = length cms \<longrightarrow> map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss = map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss' \<longrightarrow> (P mdss \<and> Q mdss) = (P mdss' \<and> Q mdss')
[PROOF STEP]
apply(intro impI allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>mdss mdss'. \<lbrakk>length mdss = length mdss' \<and> length mdss' = length cms; map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss = map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss'\<rbrakk> \<Longrightarrow> (P mdss \<and> Q mdss) = (P mdss' \<and> Q mdss')
[PROOF STEP]
apply(rule conj_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>mdss mdss'. \<lbrakk>length mdss = length mdss' \<and> length mdss' = length cms; map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss = map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss'\<rbrakk> \<Longrightarrow> P mdss = P mdss'
 2. \<And>mdss mdss'. \<lbrakk>length mdss = length mdss' \<and> length mdss' = length cms; map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss = map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss'; P mdss'\<rbrakk> \<Longrightarrow> Q mdss = Q mdss'
[PROOF STEP]
apply(erule (1) iP[unfolded ignores_old_vars_def, rule_format])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>mdss mdss'. \<lbrakk>length mdss = length mdss' \<and> length mdss' = length cms; map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss = map (\<lambda>x m. x m \<inter> - range var\<^sub>C_of) mdss'; P mdss'\<rbrakk> \<Longrightarrow> Q mdss = Q mdss'
[PROOF STEP]
apply(erule (1) iQ[unfolded ignores_old_vars_def, rule_format])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sign_times:
  fixes x::"'a::linordered_ring_strict"
  shows "sign (x*y) = sign x * sign y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign (x * y) = sign x * sign y
[PROOF STEP]
unfolding Sturm_Tarski.sign_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if (0::'a) < x * y then 1 else if x * y = (0::'a) then 0 else - 1) = (if (0::'a) < x then 1 else if x = (0::'a) then 0 else - 1) * (if (0::'a) < y then 1 else if y = (0::'a) then 0 else - 1)
[PROOF STEP]
by (auto simp add:zero_less_mult_iff)


[STATEMENT]
lemma ereal_le_minus_iff:
  fixes x y z :: ereal
  shows "x \<le> z - y \<longleftrightarrow> (y = \<infinity> \<longrightarrow> z \<noteq> \<infinity> \<longrightarrow> x = -\<infinity>) \<and> (\<bar>y\<bar> \<noteq> \<infinity> \<longrightarrow> x + y \<le> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> z - y) = ((y = \<infinity> \<longrightarrow> z \<noteq> \<infinity> \<longrightarrow> x = - \<infinity>) \<and> (\<bar>y\<bar> \<noteq> \<infinity> \<longrightarrow> x + y \<le> z))
[PROOF STEP]
by (cases rule: ereal3_cases[of x y z]) auto


[STATEMENT]
lemma fmran'_fmfilter_eq: "fmran' (fmfilter p fm) = {y | y. \<exists>x \<in> fmdom' fm. p x \<and> fmlookup fm x = Some y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmran' (fmfilter p fm) = {y |y. \<exists>x\<in>fmdom' fm. p x \<and> fmlookup fm x = Some y}
[PROOF STEP]
by (force simp: fmlookup_ran'_iff fmdom'I split: if_splits)


[STATEMENT]
lemma equiv_starrel: "equiv UNIV starrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv UNIV starrel
[PROOF STEP]
proof (rule equivI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. refl starrel
 2. sym starrel
 3. trans starrel
[PROOF STEP]
show "refl starrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl starrel
[PROOF STEP]
by (simp add: refl_on_def)
[PROOF STATE]
proof (state)
this:
refl starrel

goal (2 subgoals):
 1. sym starrel
 2. trans starrel
[PROOF STEP]
show "sym starrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym starrel
[PROOF STEP]
by (simp add: sym_def eq_commute)
[PROOF STATE]
proof (state)
this:
sym starrel

goal (1 subgoal):
 1. trans starrel
[PROOF STEP]
show "trans starrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans starrel
[PROOF STEP]
by (intro transI) (auto elim: eventually_elim2)
[PROOF STATE]
proof (state)
this:
trans starrel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma evimage_singleton_eq: "a \<in> f \<inverse>\<^bsub>n\<^esub> {b} \<longleftrightarrow> a \<in> carrier (R\<^bsup>n\<^esup>) \<and>  f a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> f \<inverse>\<^bsub>n\<^esub> {b}) = (a \<in> carrier (R\<^bsup>n\<^esup>) \<and> f a = b)
[PROOF STEP]
unfolding evimage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> f -` {b} \<inter> carrier (R\<^bsup>n\<^esup>)) = (a \<in> carrier (R\<^bsup>n\<^esup>) \<and> f a = b)
[PROOF STEP]
by blast


[STATEMENT]
lemma Limsup_add_ereal_left:
  "F \<noteq> bot \<Longrightarrow> abs c \<noteq> \<infinity> \<Longrightarrow> Limsup F (\<lambda>n. (c :: ereal) + g n) = c + Limsup F g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<noteq> bot; \<bar>c\<bar> \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> Limsup F (\<lambda>n. c + g n) = c + Limsup F g
[PROOF STEP]
by (subst (1 2) add.commute) (rule Limsup_add_ereal_right)


[STATEMENT]
lemma divides_mult_imp_divides [simp]: "a divides\<^bsub>(mult_of R)\<^esub> b \<Longrightarrow> a divides\<^bsub>R\<^esub> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a divides\<^bsub>Ring_Divisibility.mult_of R\<^esub> b \<Longrightarrow> a divides\<^bsub>R\<^esub> b
[PROOF STEP]
unfolding factor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c\<in>carrier (Ring_Divisibility.mult_of R). b = a \<otimes>\<^bsub>Ring_Divisibility.mult_of R\<^esub> c \<Longrightarrow> \<exists>c\<in>carrier R. b = a \<otimes>\<^bsub>R\<^esub> c
[PROOF STEP]
by auto


[STATEMENT]
lemma disjoint_notin1: "\<lbrakk> A \<inter> B = {}; x \<in> B \<rbrakk> \<Longrightarrow> x \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<inter> B = {}; x \<in> B\<rbrakk> \<Longrightarrow> x \<notin> A
[PROOF STEP]
by auto


[STATEMENT]
lemma CartProd: "Elem x (CartProd A B) = (\<exists>a b. Elem a A \<and> Elem b B \<and> x = (Opair a b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Elem x (CartProd A B) = (\<exists>a b. Elem a A \<and> Elem b B \<and> x = Opair a b)
[PROOF STEP]
apply (auto simp add: CartProd_def Sum Repl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>Elem a A; Elem b B; x = Opair a b\<rbrakk> \<Longrightarrow> \<exists>y. Elem (Opair a b) y \<and> (\<exists>a. Elem a A \<and> y = Repl B (Opair a))
[PROOF STEP]
apply (rule_tac x="Repl B (Opair a)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>Elem a A; Elem b B; x = Opair a b\<rbrakk> \<Longrightarrow> Elem (Opair a b) (Repl B (Opair a)) \<and> (\<exists>aa. Elem aa A \<and> Repl B (Opair a) = Repl B (Opair aa))
[PROOF STEP]
apply (auto simp add: Repl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in infinite_coin_toss_space) bernoulli_nat_filtration:
  assumes "N = bernoulli_stream q"
and "0 < q"
and "q < 1"
and "0 < p"
and "p < 1"
shows "infinite_cts_filtration q N nat_filtration"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite_cts_filtration q N nat_filtration
[PROOF STEP]
proof (unfold_locales)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. 0 \<le> q
 2. q \<le> 1
 3. N = bernoulli_stream q
 4. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
have "0 < q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream q
0 < q
q < 1
0 < p
p < 1

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

goal (4 subgoals):
 1. 0 \<le> q
 2. q \<le> 1
 3. N = bernoulli_stream q
 4. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
thus "0 \<le> q"
[PROOF STATE]
proof (prove)
using this:
0 < q

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

goal (3 subgoals):
 1. q \<le> 1
 2. N = bernoulli_stream q
 3. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
have "q < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q < 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream q
0 < q
q < 1
0 < p
p < 1

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

goal (3 subgoals):
 1. q \<le> 1
 2. N = bernoulli_stream q
 3. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
thus "q \<le> 1"
[PROOF STATE]
proof (prove)
using this:
q < 1

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

goal (2 subgoals):
 1. N = bernoulli_stream q
 2. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
show "N = bernoulli_stream q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N = bernoulli_stream q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream q
0 < q
q < 1
0 < p
p < 1

goal (1 subgoal):
 1. N = bernoulli_stream q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
N = bernoulli_stream q

goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
show "nat_filtration = infinite_coin_toss_space.nat_filtration N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
have "filt_equiv nat_filtration M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filt_equiv nat_filtration M N
[PROOF STEP]
using \<open>q < 1\<close> \<open>0 < q\<close>
[PROOF STATE]
proof (prove)
using this:
q < 1
0 < q

goal (1 subgoal):
 1. filt_equiv nat_filtration M N
[PROOF STEP]
by (simp add: assms bernoulli_stream_equiv)
[PROOF STATE]
proof (state)
this:
filt_equiv nat_filtration M N

goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
hence "sets M = sets N"
[PROOF STATE]
proof (prove)
using this:
filt_equiv nat_filtration M N

goal (1 subgoal):
 1. events = sets N
[PROOF STEP]
unfolding filt_equiv_def
[PROOF STATE]
proof (prove)
using this:
events = sets N \<and> Filtration.filtration M nat_filtration \<and> (\<forall>t A. A \<in> sets (nat_filtration t) \<longrightarrow> (emeasure M A = 0) = (emeasure N A = 0))

goal (1 subgoal):
 1. events = sets N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
events = sets N

goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
hence "space M = space N"
[PROOF STATE]
proof (prove)
using this:
events = sets N

goal (1 subgoal):
 1. space M = space N
[PROOF STEP]
using sets_eq_imp_space_eq
[PROOF STATE]
proof (prove)
using this:
events = sets N
sets ?M = sets ?M' \<Longrightarrow> space ?M = space ?M'

goal (1 subgoal):
 1. space M = space N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
space M = space N

goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
have "\<forall>m. nat_filtration m = infinite_coin_toss_space.nat_filtration N m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. nat_filtration m = infinite_coin_toss_space.nat_filtration N m
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. nat_filtration m = infinite_coin_toss_space.nat_filtration N m
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. nat_filtration m = infinite_coin_toss_space.nat_filtration N m
[PROOF STEP]
have "infinite_coin_toss_space.nat_filtration N m = fct_gen_subalgebra N N (pseudo_proj_True m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite_coin_toss_space.nat_filtration N m = fct_gen_subalgebra N N (pseudo_proj_True m)
[PROOF STEP]
using \<open>0 \<le> q\<close> \<open>N = bernoulli_stream q\<close> \<open>q \<le> 1\<close> infinite_coin_toss_space.intro
        infinite_coin_toss_space.nat_filtration_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> q
N = bernoulli_stream q
q \<le> 1
\<lbrakk>0 \<le> ?p; ?p \<le> 1; ?M = bernoulli_stream ?p\<rbrakk> \<Longrightarrow> infinite_coin_toss_space ?p ?M
infinite_coin_toss_space ?p ?M \<Longrightarrow> infinite_coin_toss_space.nat_filtration ?M ?n = fct_gen_subalgebra ?M ?M (pseudo_proj_True ?n)

goal (1 subgoal):
 1. infinite_coin_toss_space.nat_filtration N m = fct_gen_subalgebra N N (pseudo_proj_True m)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
infinite_coin_toss_space.nat_filtration N m = fct_gen_subalgebra N N (pseudo_proj_True m)

goal (1 subgoal):
 1. \<And>m. nat_filtration m = infinite_coin_toss_space.nat_filtration N m
[PROOF STEP]
thus "nat_filtration m = infinite_coin_toss_space.nat_filtration N m"
[PROOF STATE]
proof (prove)
using this:
infinite_coin_toss_space.nat_filtration N m = fct_gen_subalgebra N N (pseudo_proj_True m)

goal (1 subgoal):
 1. nat_filtration m = infinite_coin_toss_space.nat_filtration N m
[PROOF STEP]
unfolding nat_filtration_def
[PROOF STATE]
proof (prove)
using this:
infinite_coin_toss_space.nat_filtration N m = fct_gen_subalgebra N N (pseudo_proj_True m)

goal (1 subgoal):
 1. fct_gen_subalgebra M M (pseudo_proj_True m) = infinite_coin_toss_space.nat_filtration N m
[PROOF STEP]
using fct_gen_subalgebra_cong[of M N M N "pseudo_proj_True m"] \<open>sets M = sets N\<close> \<open>space M = space N\<close>
[PROOF STATE]
proof (prove)
using this:
infinite_coin_toss_space.nat_filtration N m = fct_gen_subalgebra N N (pseudo_proj_True m)
\<lbrakk>space M = space N; events = sets N\<rbrakk> \<Longrightarrow> fct_gen_subalgebra M M (pseudo_proj_True m) = fct_gen_subalgebra N N (pseudo_proj_True m)
events = sets N
space M = space N

goal (1 subgoal):
 1. fct_gen_subalgebra M M (pseudo_proj_True m) = infinite_coin_toss_space.nat_filtration N m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_filtration m = infinite_coin_toss_space.nat_filtration N m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>m. nat_filtration m = infinite_coin_toss_space.nat_filtration N m

goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>m. nat_filtration m = infinite_coin_toss_space.nat_filtration N m

goal (1 subgoal):
 1. nat_filtration = infinite_coin_toss_space.nat_filtration N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_filtration = infinite_coin_toss_space.nat_filtration N

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nat_filtration = infinite_coin_toss_space.nat_filtration N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exposed_point_of_Int_supporting_hyperplane_le:
   "\<lbrakk>S \<inter> {x. a \<bullet> x = b} = {c}; \<And>x. x \<in> S \<Longrightarrow> a \<bullet> x \<le> b\<rbrakk> \<Longrightarrow> {c} exposed_face_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<inter> {x. a \<bullet> x = b} = {c}; \<And>x. x \<in> S \<Longrightarrow> a \<bullet> x \<le> b\<rbrakk> \<Longrightarrow> {c} exposed_face_of S
[PROOF STEP]
unfolding exposed_face_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<inter> {x. a \<bullet> x = b} = {c}; \<And>x. x \<in> S \<Longrightarrow> a \<bullet> x \<le> b\<rbrakk> \<Longrightarrow> {c} face_of S \<and> (\<exists>a b. S \<subseteq> {x. a \<bullet> x \<le> b} \<and> {c} = S \<inter> {x. a \<bullet> x = b})
[PROOF STEP]
by (force simp: face_of_singleton extreme_point_of_Int_supporting_hyperplane_le)


[STATEMENT]
lemma Compl_set_less_eq_Compl: "- A \<sqsubseteq> - B \<longleftrightarrow> B \<sqsubseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- A \<sqsubseteq> - B) = (B \<sqsubseteq> A)
[PROOF STEP]
by(auto simp add: set_less_eq_def2 not_in_complement_partition_False not_in_complement_partition set_less_eq_aux''_finite Compl_set_less_eq_aux_Compl)


[STATEMENT]
lemma NSLIMSEQ_inverse_zero: "\<forall>y::real. \<exists>N. \<forall>n \<ge> N. y < f n \<Longrightarrow> (\<lambda>n. inverse (f n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. \<exists>N. \<forall>n\<ge>N. y < f n \<Longrightarrow> (\<lambda>n. inverse (f n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S 0
[PROOF STEP]
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_zero)


[STATEMENT]
lemma iSince_disj_conv1: "
  \<lbrakk> finite I; I \<noteq> {} \<rbrakk> \<Longrightarrow>
  (P t'. t' \<S> t I. Q t) = (Q (Max I) \<or> (P t'. t' \<S> t I. Q t \<and> t < Max I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (P t'. t' \<S> t I. Q t) = (Q (Max I) \<or> (P t'. t' \<S> t I. Q t \<and> t < Max I))
[PROOF STEP]
apply (case_tac "Q (Max I)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; I \<noteq> {}; Q (Max I)\<rbrakk> \<Longrightarrow> (P t'. t' \<S> t I. Q t) = (Q (Max I) \<or> (P t'. t' \<S> t I. Q t \<and> t < Max I))
 2. \<lbrakk>finite I; I \<noteq> {}; \<not> Q (Max I)\<rbrakk> \<Longrightarrow> (P t'. t' \<S> t I. Q t) = (Q (Max I) \<or> (P t'. t' \<S> t I. Q t \<and> t < Max I))
[PROOF STEP]
apply (simp add: Max_imp_iSince)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}; \<not> Q (Max I)\<rbrakk> \<Longrightarrow> (P t'. t' \<S> t I. Q t) = (Q (Max I) \<or> (P t'. t' \<S> t I. Q t \<and> t < Max I))
[PROOF STEP]
apply (unfold iSince_def, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem IF1set_natural: "IF1set o (IF1map f) = image f o IF1set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IF1set \<circ> IF1map f = (`) f \<circ> IF1set
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (IF1set \<circ> IF1map f) x = ((`) f \<circ> IF1set) x
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. (IF1set \<circ> IF1map f) x = ?s2 x
 2. \<And>x. ?s2 x = ((`) f \<circ> IF1set) x
[PROOF STEP]
apply (rule o_apply)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. IF1set (IF1map f x) = ((`) f \<circ> IF1set) x
[PROOF STEP]
apply (rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ((`) f \<circ> IF1set) x = IF1set (IF1map f x)
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. ((`) f \<circ> IF1set) x = ?s8 x
 2. \<And>x. ?s8 x = IF1set (IF1map f x)
[PROOF STEP]
apply (rule o_apply)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f ` IF1set x = IF1set (IF1map f x)
[PROOF STEP]
apply (rule conjunct1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f ` IF1set x = IF1set (IF1map f x) \<and> ?Q12 x
[PROOF STEP]
apply (rule IFset_natural)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mem_limsup_iff: "x \<in> limsup A \<longleftrightarrow> (\<exists>\<^sub>F n in sequentially. x \<in> A n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> limsup A) = (\<exists>\<^sub>F n in sequentially. x \<in> A n)
[PROOF STEP]
by (simp add: Limsup_def) (metis (mono_tags) eventually_mono not_frequently)


[STATEMENT]
lemma has_bochner_integral_cong_AE:
  "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (AE x in M. f x = g x) \<Longrightarrow>
    has_bochner_integral M f x \<longleftrightarrow> has_bochner_integral M g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M; AE x in M. f x = g x\<rbrakk> \<Longrightarrow> has_bochner_integral M f x = has_bochner_integral M g x
[PROOF STEP]
unfolding has_bochner_integral.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M; AE x in M. f x = g x\<rbrakk> \<Longrightarrow> (\<exists>s. f \<in> borel_measurable M \<and> (\<forall>x. simple_bochner_integrable M (s x)) \<and> (\<lambda>i. \<integral>\<^sup>+ x. ennreal (norm (f x - s i x)) \<partial>M) \<longlonglongrightarrow> 0 \<and> (\<lambda>i. simple_bochner_integral M (s i)) \<longlonglongrightarrow> x) = (\<exists>s. g \<in> borel_measurable M \<and> (\<forall>x. simple_bochner_integrable M (s x)) \<and> (\<lambda>i. \<integral>\<^sup>+ x. ennreal (norm (g x - s i x)) \<partial>M) \<longlonglongrightarrow> 0 \<and> (\<lambda>i. simple_bochner_integral M (s i)) \<longlonglongrightarrow> x)
[PROOF STEP]
by (intro arg_cong[where f=Ex] ext conj_cong rev_conj_cong refl arg_cong[where f="\<lambda>x. x \<longlonglongrightarrow> 0"]
            nn_integral_cong_AE)
     auto


[STATEMENT]
lemma product_in_sets_PiFI:
  assumes "J \<in> I" "\<And>i. i\<in>J \<Longrightarrow> S i \<in> sets (M i)"
  shows "(Pi' J S) \<in> sets (PiF I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi' J S \<in> sets (Pi\<^sub>F I M)
[PROOF STEP]
unfolding sets_PiF
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi' J S \<in> sigma_sets (\<Union>J\<in>I. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
J \<in> I
?i \<in> J \<Longrightarrow> S ?i \<in> sets (M ?i)

goal (1 subgoal):
 1. Pi' J S \<in> sigma_sets (\<Union>J\<in>I. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}
[PROOF STEP]
by blast


[STATEMENT]
lemma (in normal) fact_group_trivial_iff:
  assumes "finite (carrier G)"
  shows "(carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}) = (H = carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}) = (H = carrier G)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>} \<Longrightarrow> H = carrier G
 2. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
assume "carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}"
[PROOF STATE]
proof (state)
this:
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}

goal (2 subgoals):
 1. carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>} \<Longrightarrow> H = carrier G
 2. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}

goal (2 subgoals):
 1. carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>} \<Longrightarrow> H = carrier G
 2. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
with assms lagrange
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
subgroup ?H G \<Longrightarrow> card (rcosets ?H) * card ?H = order G
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
have "order (G Mod H) * card H = order G"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
subgroup ?H G \<Longrightarrow> card (rcosets ?H) * card ?H = order G
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}

goal (1 subgoal):
 1. order (G Mod H) * card H = order G
[PROOF STEP]
unfolding FactGroup_def order_def
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
subgroup ?H G \<Longrightarrow> card (rcosets ?H) * card ?H = card (carrier G)
carrier \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr> = {\<one>\<^bsub>\<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>\<^esub>}

goal (1 subgoal):
 1. card (carrier \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>) * card H = card (carrier G)
[PROOF STEP]
using is_subgroup
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
subgroup ?H G \<Longrightarrow> card (rcosets ?H) * card ?H = card (carrier G)
carrier \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr> = {\<one>\<^bsub>\<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>\<^esub>}
subgroup H G

goal (1 subgoal):
 1. card (carrier \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>) * card H = card (carrier G)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
order (G Mod H) * card H = order G

goal (2 subgoals):
 1. carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>} \<Longrightarrow> H = carrier G
 2. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
order (G Mod H) * card H = order G
[PROOF STEP]
have "card H = order G"
[PROOF STATE]
proof (prove)
using this:
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
order (G Mod H) * card H = order G

goal (1 subgoal):
 1. card H = order G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
card (carrier (G Mod H)) * card H = card (carrier G)

goal (1 subgoal):
 1. card H = card (carrier G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card H = order G

goal (2 subgoals):
 1. carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>} \<Longrightarrow> H = carrier G
 2. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
thus "H = carrier G"
[PROOF STATE]
proof (prove)
using this:
card H = order G

goal (1 subgoal):
 1. H = carrier G
[PROOF STEP]
using subgroup.subset is_subgroup assms card_subset_eq
[PROOF STATE]
proof (prove)
using this:
card H = order G
subgroup ?H ?G \<Longrightarrow> ?H \<subseteq> carrier ?G
subgroup H G
finite (carrier G)
\<lbrakk>finite ?B; ?A \<subseteq> ?B; card ?A = card ?B\<rbrakk> \<Longrightarrow> ?A = ?B

goal (1 subgoal):
 1. H = carrier G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
card H = card (carrier G)
subgroup ?H ?G \<Longrightarrow> ?H \<subseteq> carrier ?G
subgroup H G
finite (carrier G)
\<lbrakk>finite ?B; ?A \<subseteq> ?B; card ?A = card ?B\<rbrakk> \<Longrightarrow> ?A = ?B

goal (1 subgoal):
 1. H = carrier G
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
H = carrier G

goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
[PROOF STEP]
have ordergt0:"order G > 0"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)

goal (1 subgoal):
 1. 0 < order G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)

goal (1 subgoal):
 1. 0 < card (carrier G)
[PROOF STEP]
by (metis subgroup.finite_imp_card_positive subgroup_self)
[PROOF STATE]
proof (state)
this:
0 < order G

goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
assume "H = carrier G"
[PROOF STATE]
proof (state)
this:
H = carrier G

goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
hence "card H = order G"
[PROOF STATE]
proof (prove)
using this:
H = carrier G

goal (1 subgoal):
 1. card H = order G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
H = carrier G

goal (1 subgoal):
 1. card H = card (carrier G)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card H = order G

goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
with assms is_subgroup lagrange
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
subgroup H G
subgroup ?H G \<Longrightarrow> card (rcosets ?H) * card ?H = order G
card H = order G
[PROOF STEP]
have "card (rcosets H) * order G = order G"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
subgroup H G
subgroup ?H G \<Longrightarrow> card (rcosets ?H) * card ?H = order G
card H = order G

goal (1 subgoal):
 1. card (rcosets H) * order G = order G
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card (rcosets H) * order G = order G

goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
with ordergt0
[PROOF STATE]
proof (chain)
picking this:
0 < order G
card (rcosets H) * order G = order G
[PROOF STEP]
have "card (rcosets H) = 1"
[PROOF STATE]
proof (prove)
using this:
0 < order G
card (rcosets H) * order G = order G

goal (1 subgoal):
 1. card (rcosets H) = 1
[PROOF STEP]
by (metis mult_eq_self_implies_10 mult.commute neq0_conv)
[PROOF STATE]
proof (state)
this:
card (rcosets H) = 1

goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
hence "order (G Mod H) = 1"
[PROOF STATE]
proof (prove)
using this:
card (rcosets H) = 1

goal (1 subgoal):
 1. order (G Mod H) = 1
[PROOF STEP]
unfolding order_def FactGroup_def
[PROOF STATE]
proof (prove)
using this:
card (rcosets H) = 1

goal (1 subgoal):
 1. card (carrier \<lparr>carrier = rcosets H, monoid.mult = (<#>), one = H\<rparr>) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
order (G Mod H) = 1

goal (1 subgoal):
 1. H = carrier G \<Longrightarrow> carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
thus "carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}"
[PROOF STATE]
proof (prove)
using this:
order (G Mod H) = 1

goal (1 subgoal):
 1. carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
using factorgroup_is_group
[PROOF STATE]
proof (prove)
using this:
order (G Mod H) = 1
Group.group (G Mod H)

goal (1 subgoal):
 1. carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}
[PROOF STEP]
by (metis group.order_one_triv_iff)
[PROOF STATE]
proof (state)
this:
carrier (G Mod H) = {\<one>\<^bsub>G Mod H\<^esub>}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unat_power_lower [simp]:
  "unat ((2::'a::len word) ^ n) = 2 ^ n" if "n < LENGTH('a::len)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (2 ^ n) = 2 ^ n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
n < LENGTH('a)

goal (1 subgoal):
 1. unat (2 ^ n) = 2 ^ n
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma per_diag_diag_mat:
  assumes "A \<in> carrier_mat n n"
  and "i < n"
  and "f i < n"
shows "diag_mat (per_diag A f)!i = diag_mat A ! (f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat (per_diag A f) ! i = diag_mat A ! f i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
i < n
f i < n

goal (1 subgoal):
 1. diag_mat (per_diag A f) ! i = diag_mat A ! f i
[PROOF STEP]
unfolding diag_mat_def per_diag_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
i < n
f i < n

goal (1 subgoal):
 1. map (\<lambda>i. Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, j). A $$ (f i, f j)) $$ (i, i)) [0..<dim_row (Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, j). A $$ (f i, f j)))] ! i = map (\<lambda>i. A $$ (i, i)) [0..<dim_row A] ! f i
[PROOF STEP]
by auto


[STATEMENT]
lemma lrev_lrev_ident [simp]:
  assumes fin: "xs \<in> UNIV\<^sup>\<star>"
  shows "lrev (lrev xs) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lrev (lrev xs) = xs
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
xs \<in> UNIV\<^sup>\<star>

goal (1 subgoal):
 1. lrev (lrev xs) = xs
[PROOF STEP]
proof (induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>l. l = LNil \<Longrightarrow> lrev (lrev l) = l
 2. \<And>a l. \<lbrakk>l \<in> UNIV\<^sup>\<star>; lrev (lrev l) = l; a \<in> UNIV\<rbrakk> \<Longrightarrow> lrev (lrev (a ## l)) = a ## l
[PROOF STEP]
case (LCons_fin a l)
[PROOF STATE]
proof (state)
this:
l \<in> UNIV\<^sup>\<star>
lrev (lrev l) = l
a \<in> UNIV

goal (2 subgoals):
 1. \<And>l. l = LNil \<Longrightarrow> lrev (lrev l) = l
 2. \<And>a l. \<lbrakk>l \<in> UNIV\<^sup>\<star>; lrev (lrev l) = l; a \<in> UNIV\<rbrakk> \<Longrightarrow> lrev (lrev (a ## l)) = a ## l
[PROOF STEP]
have "a ## LNil \<in> UNIV\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ## LNil \<in> UNIV\<^sup>\<star>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a ## LNil \<in> UNIV\<^sup>\<star>

goal (2 subgoals):
 1. \<And>l. l = LNil \<Longrightarrow> lrev (lrev l) = l
 2. \<And>a l. \<lbrakk>l \<in> UNIV\<^sup>\<star>; lrev (lrev l) = l; a \<in> UNIV\<rbrakk> \<Longrightarrow> lrev (lrev (a ## l)) = a ## l
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
a ## LNil \<in> UNIV\<^sup>\<star>

goal (1 subgoal):
 1. lrev (lrev (a ## l)) = a ## l
[PROOF STEP]
using LCons_fin
[PROOF STATE]
proof (prove)
using this:
a ## LNil \<in> UNIV\<^sup>\<star>
l \<in> UNIV\<^sup>\<star>
lrev (lrev l) = l
a \<in> UNIV

goal (1 subgoal):
 1. lrev (lrev (a ## l)) = a ## l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lrev (lrev (a ## l)) = a ## l

goal (1 subgoal):
 1. \<And>l. l = LNil \<Longrightarrow> lrev (lrev l) = l
[PROOF STEP]
qed simp


[STATEMENT]
lemma cCauchy_iff2: "Cauchy X \<longleftrightarrow> (\<forall>j. (\<exists>M. \<forall>m \<ge> M. \<forall>n \<ge> M. cmod (X m - X n) < inverse (real (Suc j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy X = (\<forall>j. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. cmod (X m - X n) < inverse (real (Suc j)))
[PROOF STEP]
by (simp only: metric_Cauchy_iff2 dist_complex_def)


[STATEMENT]
lemma abelian_groupE:
  fixes R (structure)
  assumes "abelian_group R"
  shows "\<And>x y. \<lbrakk> x \<in> carrier R; y \<in> carrier R \<rbrakk> \<Longrightarrow> x \<oplus> y \<in> carrier R"
    and "\<zero> \<in> carrier R"
    and "\<And>x y z. \<lbrakk> x \<in> carrier R; y \<in> carrier R; z \<in> carrier R \<rbrakk> \<Longrightarrow> (x \<oplus> y) \<oplus> z = x \<oplus> (y \<oplus> z)"
    and "\<And>x y. \<lbrakk> x \<in> carrier R; y \<in> carrier R \<rbrakk> \<Longrightarrow> x \<oplus> y = y \<oplus> x"
    and "\<And>x. x \<in> carrier R \<Longrightarrow> \<zero> \<oplus> x = x"
    and "\<And>x. x \<in> carrier R \<Longrightarrow> \<exists>y \<in> carrier R. y \<oplus> x = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> x \<oplus> y \<in> carrier R) &&& \<zero> \<in> carrier R &&& (\<And>x y z. \<lbrakk>x \<in> carrier R; y \<in> carrier R; z \<in> carrier R\<rbrakk> \<Longrightarrow> x \<oplus> y \<oplus> z = x \<oplus> (y \<oplus> z))) &&& (\<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> x \<oplus> y = y \<oplus> x) &&& (\<And>x. x \<in> carrier R \<Longrightarrow> \<zero> \<oplus> x = x) &&& (\<And>x. x \<in> carrier R \<Longrightarrow> \<exists>y\<in>carrier R. y \<oplus> x = \<zero>)
[PROOF STEP]
using abelian_group.a_comm_group assms comm_groupE
[PROOF STATE]
proof (prove)
using this:
abelian_group ?G \<Longrightarrow> comm_group (add_monoid ?G)
abelian_group R
\<lbrakk>comm_group ?G; ?x \<in> carrier ?G; ?y \<in> carrier ?G\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>?G\<^esub> ?y \<in> carrier ?G
comm_group ?G \<Longrightarrow> \<one>\<^bsub>?G\<^esub> \<in> carrier ?G
\<lbrakk>comm_group ?G; ?x \<in> carrier ?G; ?y \<in> carrier ?G; ?z \<in> carrier ?G\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>?G\<^esub> ?y \<otimes>\<^bsub>?G\<^esub> ?z = ?x \<otimes>\<^bsub>?G\<^esub> (?y \<otimes>\<^bsub>?G\<^esub> ?z)
\<lbrakk>comm_group ?G; ?x \<in> carrier ?G; ?y \<in> carrier ?G\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>?G\<^esub> ?y = ?y \<otimes>\<^bsub>?G\<^esub> ?x
\<lbrakk>comm_group ?G; ?x \<in> carrier ?G\<rbrakk> \<Longrightarrow> \<one>\<^bsub>?G\<^esub> \<otimes>\<^bsub>?G\<^esub> ?x = ?x
\<lbrakk>comm_group ?G; ?x \<in> carrier ?G\<rbrakk> \<Longrightarrow> \<exists>y\<in>carrier ?G. y \<otimes>\<^bsub>?G\<^esub> ?x = \<one>\<^bsub>?G\<^esub>

goal (1 subgoal):
 1. ((\<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> x \<oplus> y \<in> carrier R) &&& \<zero> \<in> carrier R &&& (\<And>x y z. \<lbrakk>x \<in> carrier R; y \<in> carrier R; z \<in> carrier R\<rbrakk> \<Longrightarrow> x \<oplus> y \<oplus> z = x \<oplus> (y \<oplus> z))) &&& (\<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> x \<oplus> y = y \<oplus> x) &&& (\<And>x. x \<in> carrier R \<Longrightarrow> \<zero> \<oplus> x = x) &&& (\<And>x. x \<in> carrier R \<Longrightarrow> \<exists>y\<in>carrier R. y \<oplus> x = \<zero>)
[PROOF STEP]
by fastforce+


[STATEMENT]
theorem kruskal_spanning:
  "VARS e f h
  [ symmetric g ]
  f := bot;
  h := g;
  WHILE h \<noteq> bot
    INV { kruskal_spanning_invariant f g h }
    VAR { card { x . regular x \<and> x \<le> --h } }
     DO e := choose_arc h;
        IF e \<le> -forest_components f THEN
          f := (f \<sqinter> -(top * e * f\<^sup>T\<^sup>\<star>)) \<squnion> (f \<sqinter> top * e * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> e
        ELSE
          SKIP
        FI;
        h := h \<sqinter> -e \<sqinter> -e\<^sup>T
     OD
  [ spanning_forest f g ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [symmetric g]
f := bot; h := g; WHILE h \<noteq> bot INV {kruskal_spanning_invariant f g h}  VAR {card {x. regular x \<and> x \<le> - - h}}
DO e := choose_arc h; IF e \<le> - forest_components f THEN f := f \<sqinter> - (top * e * f\<^sup>T\<^sup>\<star>) \<squnion> (f \<sqinter> top * e * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> e  ELSE SKIP FI; h := h \<sqinter> - e \<sqinter> - e\<^sup>T OD
[spanning_forest f g]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. symmetric g \<Longrightarrow> kruskal_spanning_invariant bot g g
 2. \<And>f h. kruskal_spanning_invariant f g h \<and> h \<noteq> bot \<Longrightarrow> (choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant (f \<sqinter> - (top * choose_arc h * f\<^sup>T\<^sup>\<star>) \<squnion> (f \<sqinter> top * choose_arc h * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> choose_arc h) g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}) \<and> (\<not> choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant f g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h})
 3. \<And>f. kruskal_spanning_invariant f g bot \<Longrightarrow> spanning_forest f g
[PROOF STEP]
using kruskal_vc_1
[PROOF STATE]
proof (prove)
using this:
symmetric ?g \<Longrightarrow> kruskal_spanning_invariant bot ?g ?g

goal (3 subgoals):
 1. symmetric g \<Longrightarrow> kruskal_spanning_invariant bot g g
 2. \<And>f h. kruskal_spanning_invariant f g h \<and> h \<noteq> bot \<Longrightarrow> (choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant (f \<sqinter> - (top * choose_arc h * f\<^sup>T\<^sup>\<star>) \<squnion> (f \<sqinter> top * choose_arc h * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> choose_arc h) g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}) \<and> (\<not> choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant f g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h})
 3. \<And>f. kruskal_spanning_invariant f g bot \<Longrightarrow> spanning_forest f g
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f h. kruskal_spanning_invariant f g h \<and> h \<noteq> bot \<Longrightarrow> (choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant (f \<sqinter> - (top * choose_arc h * f\<^sup>T\<^sup>\<star>) \<squnion> (f \<sqinter> top * choose_arc h * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> choose_arc h) g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}) \<and> (\<not> choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant f g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h})
 2. \<And>f. kruskal_spanning_invariant f g bot \<Longrightarrow> spanning_forest f g
[PROOF STEP]
using kruskal_vc_2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>kruskal_spanning_invariant ?f ?g ?h; ?h \<noteq> bot\<rbrakk> \<Longrightarrow> (choose_arc ?h \<le> - forest_components ?f \<longrightarrow> kruskal_spanning_invariant (?f \<sqinter> - (top * choose_arc ?h * ?f\<^sup>T\<^sup>\<star>) \<squnion> (?f \<sqinter> top * choose_arc ?h * ?f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> choose_arc ?h) ?g (?h \<sqinter> - choose_arc ?h \<sqinter> - choose_arc ?h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - ?h \<and> x \<le> - choose_arc ?h \<and> x \<le> - choose_arc ?h\<^sup>T} < card {x. regular x \<and> x \<le> - - ?h}) \<and> (\<not> choose_arc ?h \<le> - forest_components ?f \<longrightarrow> kruskal_spanning_invariant ?f ?g (?h \<sqinter> - choose_arc ?h \<sqinter> - choose_arc ?h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - ?h \<and> x \<le> - choose_arc ?h \<and> x \<le> - choose_arc ?h\<^sup>T} < card {x. regular x \<and> x \<le> - - ?h})

goal (2 subgoals):
 1. \<And>f h. kruskal_spanning_invariant f g h \<and> h \<noteq> bot \<Longrightarrow> (choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant (f \<sqinter> - (top * choose_arc h * f\<^sup>T\<^sup>\<star>) \<squnion> (f \<sqinter> top * choose_arc h * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> choose_arc h) g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}) \<and> (\<not> choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant f g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h})
 2. \<And>f. kruskal_spanning_invariant f g bot \<Longrightarrow> spanning_forest f g
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f h. \<lbrakk>kruskal_spanning_invariant f g h \<and> h \<noteq> bot; \<And>f g h. \<lbrakk>kruskal_spanning_invariant f g h; h \<noteq> bot\<rbrakk> \<Longrightarrow> (choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant (f \<sqinter> - (top * choose_arc h * f\<^sup>T\<^sup>\<star>) \<squnion> (f \<sqinter> top * choose_arc h * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> choose_arc h) g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}) \<and> (\<not> choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant f g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h})\<rbrakk> \<Longrightarrow> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}
 2. \<And>f. kruskal_spanning_invariant f g bot \<Longrightarrow> spanning_forest f g
[PROOF STEP]
using kruskal_spanning_invariant_def
[PROOF STATE]
proof (prove)
using this:
kruskal_spanning_invariant ?f ?g ?h \<equiv> symmetric ?g \<and> ?h = ?h\<^sup>T \<and> ?g \<sqinter> - - ?h = ?h \<and> spanning_forest ?f (- ?h \<sqinter> ?g)

goal (2 subgoals):
 1. \<And>f h. \<lbrakk>kruskal_spanning_invariant f g h \<and> h \<noteq> bot; \<And>f g h. \<lbrakk>kruskal_spanning_invariant f g h; h \<noteq> bot\<rbrakk> \<Longrightarrow> (choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant (f \<sqinter> - (top * choose_arc h * f\<^sup>T\<^sup>\<star>) \<squnion> (f \<sqinter> top * choose_arc h * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> choose_arc h) g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}) \<and> (\<not> choose_arc h \<le> - forest_components f \<longrightarrow> kruskal_spanning_invariant f g (h \<sqinter> - choose_arc h \<sqinter> - choose_arc h\<^sup>T) \<and> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h})\<rbrakk> \<Longrightarrow> card {x. regular x \<and> x \<le> - - h \<and> x \<le> - choose_arc h \<and> x \<le> - choose_arc h\<^sup>T} < card {x. regular x \<and> x \<le> - - h}
 2. \<And>f. kruskal_spanning_invariant f g bot \<Longrightarrow> spanning_forest f g
[PROOF STEP]
by auto


[STATEMENT]
lemma "3.2 \<le> (x::real) \<and> x \<le> 3.9 \<Longrightarrow> real_of_int (ceiling x) \<in> {4 .. 4}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 32 / 10 \<le> x \<and> x \<le> 39 / 10 \<Longrightarrow> real_of_int \<lceil>x\<rceil> \<in> {4..4}
[PROOF STEP]
by (approximation 10)


[STATEMENT]
lemma l2_when_left_child:
  assumes "l < l'"
  and i'_bot: "i' > (i - 1) * 2^(l' - l)"
  and i'_top: "i' < i * 2^(l' - l)"
  shows "l2_\<phi> (l', i') (l, i) = (1 + real_of_int i' / 2^(l' - l) - real_of_int i) / 2^(l' + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l2_\<phi> (l', i') (l, i) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
proof (subst l2_\<phi>I_DERIV)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?l' = "(2 :: real)^(l' + 1)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?in' = "real_of_int i' - 1"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?ip' = "real_of_int i' + 1"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?l = "(2 :: real)^(l + 1)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?i = "real_of_int i - 1"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?\<phi>' = "\<phi> (l',i')"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?\<phi> = "\<phi> (l, i)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let "?\<phi>2 x" = "?\<phi>' x * ?\<phi> x"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
define \<Phi>_n where "\<Phi>_n x = x^3 / 3 * ?l' * ?l + x * ?i * ?in' - x^2 / 2 * (?in' * ?l + ?i * ?l')" for x
[PROOF STATE]
proof (state)
this:
\<Phi>_n ?x = ?x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + ?x * (real_of_int i - 1) * (real_of_int i' - 1) - ?x\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
define \<Phi>_p where "\<Phi>_p x = x^2 / 2 * (?ip' * ?l + ?i * ?l') - x^3 / 3 * ?l' * ?l - x * ?i * ?ip'" for x
[PROOF STATE]
proof (state)
this:
\<Phi>_p ?x = ?x\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - ?x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - ?x * (real_of_int i - 1) * (real_of_int i' + 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
have level_diff: "2^(l' - l) = 2^l' / (2^l :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (l' - l) = 2 ^ l' / 2 ^ l
[PROOF STEP]
using power_diff[of "2::real" l l'] \<open>l < l'\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 \<noteq> 0; l \<le> l'\<rbrakk> \<Longrightarrow> 2 ^ (l' - l) = 2 ^ l' / 2 ^ l
l < l'

goal (1 subgoal):
 1. 2 ^ (l' - l) = 2 ^ l' / 2 ^ l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
assume x: "x \<in> {?in' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
have "?i * 2^(l' - l) \<le> ?in'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int i - 1) * 2 ^ (l' - l) \<le> real_of_int i' - 1
[PROOF STEP]
using i'_bot int_less_real_le
[PROOF STATE]
proof (prove)
using this:
(i - 1) * 2 ^ (l' - l) < i'
(?n < ?m) = (real_of_int ?n + 1 \<le> real_of_int ?m)

goal (1 subgoal):
 1. (real_of_int i - 1) * 2 ^ (l' - l) \<le> real_of_int i' - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(real_of_int i - 1) * 2 ^ (l' - l) \<le> real_of_int i' - 1

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence "?i / ?l \<le> ?in' / ?l'"
[PROOF STATE]
proof (prove)
using this:
(real_of_int i - 1) * 2 ^ (l' - l) \<le> real_of_int i' - 1

goal (1 subgoal):
 1. (real_of_int i - 1) / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)
[PROOF STEP]
using level_diff
[PROOF STATE]
proof (prove)
using this:
(real_of_int i - 1) * 2 ^ (l' - l) \<le> real_of_int i' - 1
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (1 subgoal):
 1. (real_of_int i - 1) / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence "?i / ?l \<le> x"
[PROOF STATE]
proof (prove)
using this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)

goal (1 subgoal):
 1. (real_of_int i - 1) / 2 ^ (l + 1) \<le> x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. (real_of_int i - 1) / 2 ^ (l + 1) \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> x

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> x

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
have "?ip' \<le> real_of_int i * 2^(l' - l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int i' + 1 \<le> real_of_int i * 2 ^ (l' - l)
[PROOF STEP]
using i'_top int_less_real_le
[PROOF STATE]
proof (prove)
using this:
i' < i * 2 ^ (l' - l)
(?n < ?m) = (real_of_int ?n + 1 \<le> real_of_int ?m)

goal (1 subgoal):
 1. real_of_int i' + 1 \<le> real_of_int i * 2 ^ (l' - l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int i' + 1 \<le> real_of_int i * 2 ^ (l' - l)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence ip'_le_i: "?ip' / ?l' \<le> real_of_int i / ?l"
[PROOF STATE]
proof (prove)
using this:
real_of_int i' + 1 \<le> real_of_int i * 2 ^ (l' - l)

goal (1 subgoal):
 1. (real_of_int i' + 1) / 2 ^ (l' + 1) \<le> real_of_int i / 2 ^ (l + 1)
[PROOF STEP]
using level_diff
[PROOF STATE]
proof (prove)
using this:
real_of_int i' + 1 \<le> real_of_int i * 2 ^ (l' - l)
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (1 subgoal):
 1. (real_of_int i' + 1) / 2 ^ (l' + 1) \<le> real_of_int i / 2 ^ (l + 1)
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(real_of_int i' + 1) / 2 ^ (l' + 1) \<le> real_of_int i / 2 ^ (l + 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence "x \<le> real_of_int i / ?l"
[PROOF STATE]
proof (prove)
using this:
(real_of_int i' + 1) / 2 ^ (l' + 1) \<le> real_of_int i / 2 ^ (l + 1)

goal (1 subgoal):
 1. x \<le> real_of_int i / 2 ^ (l + 1)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
(real_of_int i' + 1) / 2 ^ (l' + 1) \<le> real_of_int i / 2 ^ (l + 1)
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. x \<le> real_of_int i / 2 ^ (l + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<le> real_of_int i / 2 ^ (l + 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> x
x \<le> real_of_int i / 2 ^ (l + 1)
[PROOF STEP]
have "?\<phi> x = ?l * x  - ?i"
[PROOF STATE]
proof (prove)
using this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> x
x \<le> real_of_int i / 2 ^ (l + 1)

goal (1 subgoal):
 1. \<phi> (l, i) x = 2 ^ (l + 1) * x - (real_of_int i - 1)
[PROOF STEP]
using \<phi>_left_support'
[PROOF STATE]
proof (prove)
using this:
(real_of_int i - 1) / 2 ^ (l + 1) \<le> x
x \<le> real_of_int i / 2 ^ (l + 1)
?x \<in> {real_of_int (?i - 1) / 2 ^ (?l + 1)..real_of_int ?i / 2 ^ (?l + 1)} \<Longrightarrow> \<phi> (?l, ?i) ?x = 1 + ?x * 2 ^ (?l + 1) - real_of_int ?i

goal (1 subgoal):
 1. \<phi> (l, i) x = 2 ^ (l + 1) * x - (real_of_int i - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi> (l, i) x = 2 ^ (l + 1) * x - (real_of_int i - 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> \<phi> (l, i) ?x2 = 2 ^ (l + 1) * ?x2 - (real_of_int i - 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
note \<phi>_eq = this
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> \<phi> (l, i) ?x2 = 2 ^ (l + 1) * ?x2 - (real_of_int i - 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> \<phi> (l, i) ?x2 = 2 ^ (l + 1) * ?x2 - (real_of_int i - 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
assume x: "x \<in> {?in' / ?l' .. real_of_int i' / ?l'}"
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence \<phi>'_eq: "?\<phi>' x = ?l' * x  - ?in'"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. \<phi> (l', i') x = 2 ^ (l' + 1) * x - (real_of_int i' - 1)
[PROOF STEP]
using \<phi>_left_support'
[PROOF STATE]
proof (prove)
using this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}
?x \<in> {real_of_int (?i - 1) / 2 ^ (?l + 1)..real_of_int ?i / 2 ^ (?l + 1)} \<Longrightarrow> \<phi> (?l, ?i) ?x = 1 + ?x * 2 ^ (?l + 1) - real_of_int ?i

goal (1 subgoal):
 1. \<phi> (l', i') x = 2 ^ (l' + 1) * x - (real_of_int i' - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi> (l', i') x = 2 ^ (l' + 1) * x - (real_of_int i' - 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}
[PROOF STEP]
have x': "x \<in> {?in' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
show "DERIV \<Phi>_n x :> ?\<phi>2 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
[PROOF STEP]
unfolding \<phi>_eq[OF x'] \<phi>'_eq \<Phi>_n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + x * (real_of_int i - 1) * (real_of_int i' - 1) - x\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) has_real_derivative (2 ^ (l' + 1) * x - (real_of_int i' - 1)) * (2 ^ (l + 1) * x - (real_of_int i - 1))) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (\<Phi>_n has_real_derivative \<phi> (l', i') ?x2 * \<phi> (l, i) ?x2) (at ?x2)

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (\<Phi>_n has_real_derivative \<phi> (l', i') ?x2 * \<phi> (l, i) ?x2) (at ?x2)

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
assume x: "x \<in> {real_of_int i' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (state)
this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence \<phi>'_eq: "?\<phi>' x = ?ip' - ?l' * x"
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. \<phi> (l', i') x = real_of_int i' + 1 - 2 ^ (l' + 1) * x
[PROOF STEP]
using \<phi>_right_support'
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
?x \<in> {real_of_int ?i / 2 ^ (?l + 1)..real_of_int (?i + 1) / 2 ^ (?l + 1)} \<Longrightarrow> \<phi> (?l, ?i) ?x = 1 - ?x * 2 ^ (?l + 1) + real_of_int ?i

goal (1 subgoal):
 1. \<phi> (l', i') x = real_of_int i' + 1 - 2 ^ (l' + 1) * x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi> (l', i') x = real_of_int i' + 1 - 2 ^ (l' + 1) * x

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
[PROOF STEP]
have x': "x \<in> {?in' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
show "DERIV \<Phi>_p x :> ?\<phi>2 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
[PROOF STEP]
unfolding \<phi>_eq[OF x'] \<phi>'_eq \<Phi>_p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - x * (real_of_int i - 1) * (real_of_int i' + 1)) has_real_derivative (real_of_int i' + 1 - 2 ^ (l' + 1) * x) * (2 ^ (l + 1) * x - (real_of_int i - 1))) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)

goal (1 subgoal):
 1. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (((real_of_int i' + 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - ((real_of_int i' + 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' + 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' + 1) - ((real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (\<Phi>_p has_real_derivative \<phi> (l', i') ?x2 * \<phi> (l, i) ?x2) (at ?x2)

goal (1 subgoal):
 1. (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' - 1) - ((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1))) + (((real_of_int i' + 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - ((real_of_int i' + 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' + 1) / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' + 1) - ((real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i - 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i - 1) * (real_of_int i' + 1))) = (1 + real_of_int i' / 2 ^ (l' - l) - real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
qed (simp_all add: field_simps power_eq_if[of _ 2] power_eq_if[of _ 3] power_diff[of "2::real", OF _ \<open>l < l'\<close>[THEN less_imp_le]] )


[STATEMENT]
lemma fps_X_power_mult_nth:
  "(fps_X^k * f) $ n = (if n < k then 0 else f $ (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_X ^ k * f) $ n = (if n < k then 0::'a else f $ (n - k))
[PROOF STEP]
by  (cases "n<k")
      (simp_all add: fps_mult_nth_conv_upto_subdegree_left fps_X_power_subdegree sum.atLeast_Suc_atMost)


[STATEMENT]
lemma Or\<^sub>n_And\<^sub>n_image_prop_semantics:
  assumes "finite \" and "\<And>\<Phi>. \<Phi> \<in> \ \<Longrightarrow> finite \<Phi>"
  shows "\ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) \<longleftrightarrow> (\<exists>\<Phi> \<in> \. \<forall>\<phi> \<in> \<Phi>. \ \<Turnstile>\<^sub>P \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \<forall>\<phi>\<in>\<Phi>. \ \<Turnstile>\<^sub>P \<phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \<forall>\<phi>\<in>\<Phi>. \ \<Turnstile>\<^sub>P \<phi>)
[PROOF STEP]
have "\ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) \<longleftrightarrow> (\<exists>\<Phi> \<in> \. \ \<Turnstile>\<^sub>P And\<^sub>n \<Phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \ \<Turnstile>\<^sub>P And\<^sub>n \<Phi>)
[PROOF STEP]
using Or\<^sub>n_prop_semantics assms
[PROOF STATE]
proof (prove)
using this:
finite ?\<Phi> \<Longrightarrow> ?\ \<Turnstile>\<^sub>P Or\<^sub>n ?\<Phi> = (\<exists>\<phi>\<in>?\<Phi>. ?\ \<Turnstile>\<^sub>P \<phi>)
finite \
?\<Phi> \<in> \ \<Longrightarrow> finite ?\<Phi>

goal (1 subgoal):
 1. \ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \ \<Turnstile>\<^sub>P And\<^sub>n \<Phi>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \ \<Turnstile>\<^sub>P And\<^sub>n \<Phi>)

goal (1 subgoal):
 1. \ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \<forall>\<phi>\<in>\<Phi>. \ \<Turnstile>\<^sub>P \<phi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \ \<Turnstile>\<^sub>P And\<^sub>n \<Phi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \ \<Turnstile>\<^sub>P And\<^sub>n \<Phi>)

goal (1 subgoal):
 1. \ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \<forall>\<phi>\<in>\<Phi>. \ \<Turnstile>\<^sub>P \<phi>)
[PROOF STEP]
using And\<^sub>n_prop_semantics assms
[PROOF STATE]
proof (prove)
using this:
\ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \ \<Turnstile>\<^sub>P And\<^sub>n \<Phi>)
finite ?\<Phi> \<Longrightarrow> ?\ \<Turnstile>\<^sub>P And\<^sub>n ?\<Phi> = (\<forall>\<phi>\<in>?\<Phi>. ?\ \<Turnstile>\<^sub>P \<phi>)
finite \
?\<Phi> \<in> \ \<Longrightarrow> finite ?\<Phi>

goal (1 subgoal):
 1. \ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \<forall>\<phi>\<in>\<Phi>. \ \<Turnstile>\<^sub>P \<phi>)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\ \<Turnstile>\<^sub>P Or\<^sub>n (And\<^sub>n ` \) = (\<exists>\<Phi>\<in>\. \<forall>\<phi>\<in>\<Phi>. \ \<Turnstile>\<^sub>P \<phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subgraph_union_iff:
  assumes "wf_digraph H1" "wf_digraph H2" "compatible H1 H2"
  shows "subgraph (union H1 H2) G \<longleftrightarrow> subgraph H1 G \<and> subgraph H2 G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraph (Digraph_Component.union H1 H2) G = (subgraph H1 G \<and> subgraph H2 G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wf_digraph H1
wf_digraph H2
compatible H1 H2

goal (1 subgoal):
 1. subgraph (Digraph_Component.union H1 H2) G = (subgraph H1 G \<and> subgraph H2 G)
[PROOF STEP]
by (fastforce simp: compatible_def intro!: subgraphI wellformed_union)


[STATEMENT]
lemma frontier_not_empty:
  fixes S :: "'a :: real_normed_vector set"
  shows "\<lbrakk>S \<noteq> {}; S \<noteq> UNIV\<rbrakk> \<Longrightarrow> frontier S \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; S \<noteq> UNIV\<rbrakk> \<Longrightarrow> frontier S \<noteq> {}
[PROOF STEP]
using connected_Int_frontier [of UNIV S]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>connected UNIV; UNIV \<inter> S \<noteq> {}; UNIV - S \<noteq> {}\<rbrakk> \<Longrightarrow> UNIV \<inter> frontier S \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; S \<noteq> UNIV\<rbrakk> \<Longrightarrow> frontier S \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
theorem Goedel_II: "\<not> {} \<turnstile> Fls \<Longrightarrow> \<not> {} \<turnstile> neg (PfP \<guillemotleft>Fls\<guillemotright>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> {} \<turnstile> Fls \<Longrightarrow> \<not> {} \<turnstile> neg (PfP \<guillemotleft>Fls\<guillemotright>)
[PROOF STEP]
by (rule g2.goedel_second[unfolded consistent_def PP_def PfP_subst subst.simps simp_thms if_True])


[STATEMENT]
theorem wls_substAbs_preserves_freshAbs:
assumes "wlsAbs (us,s) A" and "wls (asSort ys) Y"
and "freshAbs zs z A" and "fresh zs z Y"
shows "freshAbs zs z (A $[Y / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshAbs zs z (A $[Y / y]_ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wls (asSort ys) Y
freshAbs zs z A
fresh zs z Y

goal (1 subgoal):
 1. freshAbs zs z (A $[Y / y]_ys)
[PROOF STEP]
by(simp add: substAbs_preserves_freshAbs)


[STATEMENT]
lemma F_card_eq_E: "card F = card E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card F = card E
[PROOF STEP]
using finite_E
[PROOF STATE]
proof (prove)
using this:
finite E

goal (1 subgoal):
 1. card F = card E
[PROOF STEP]
by (simp add: F_def inj_on_pminusx_E card_image)


[STATEMENT]
lemma B_card_eq_A: "card B = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B = card A
[PROOF STEP]
using finite_A
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. card B = card A
[PROOF STEP]
by (simp add: finite_A B_def inj_on_xa_A card_image)


[STATEMENT]
lemma continuous_map_sum [continuous_intros]:
  fixes f :: "'a\<Rightarrow>'b\<Rightarrow>'c::real_normed_vector"
  shows "\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> continuous_map X euclidean (\<lambda>x. f x i)\<rbrakk>
         \<Longrightarrow> continuous_map X euclidean (\<lambda>x. sum (f x) I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> continuous_map X euclidean (\<lambda>x. f x i)\<rbrakk> \<Longrightarrow> continuous_map X euclidean (\<lambda>x. sum (f x) I)
[PROOF STEP]
by (simp add: continuous_map_atin tendsto_sum)


[STATEMENT]
lemma prod_join:
    fixes x y :: "'a::Finite_Join_cpo \<times> 'b::Finite_Join_cpo"
    shows "x \<squnion> y = (fst x \<squnion> fst y, snd x \<squnion> snd y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y = (fst x \<squnion> fst y, snd x \<squnion> snd y)
[PROOF STEP]
apply (rule is_joinI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x \<sqsubseteq> (fst x \<squnion> fst y, snd x \<squnion> snd y)
 2. y \<sqsubseteq> (fst x \<squnion> fst y, snd x \<squnion> snd y)
 3. \<And>a. \<lbrakk>x \<sqsubseteq> a; y \<sqsubseteq> a\<rbrakk> \<Longrightarrow> (fst x \<squnion> fst y, snd x \<squnion> snd y) \<sqsubseteq> a
[PROOF STEP]
apply (cases x, auto)[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. y \<sqsubseteq> (fst x \<squnion> fst y, snd x \<squnion> snd y)
 2. \<And>a. \<lbrakk>x \<sqsubseteq> a; y \<sqsubseteq> a\<rbrakk> \<Longrightarrow> (fst x \<squnion> fst y, snd x \<squnion> snd y) \<sqsubseteq> a
[PROOF STEP]
apply (cases y, auto)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>x \<sqsubseteq> a; y \<sqsubseteq> a\<rbrakk> \<Longrightarrow> (fst x \<squnion> fst y, snd x \<squnion> snd y) \<sqsubseteq> a
[PROOF STEP]
apply (cases x, cases y, case_tac a, auto)[1]
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma flat_snth: "\<forall>xs \<in> sset s. xs \<noteq> [] \<Longrightarrow> flat s !! n = (if n < length (shd s) then
  shd s ! n else flat (stl s) !! (n - length (shd s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs\<in>sset s. xs \<noteq> [] \<Longrightarrow> flat s !! n = (if n < length (shd s) then shd s ! n else flat (stl s) !! (n - length (shd s)))
[PROOF STEP]
by (metis flat_unfold not_less shd_sset shift_snth_ge shift_snth_less)