[STATEMENT]
lemma (in domain) char_ring_is_subfield:
  assumes "char R > 0"
  shows "subfield (char_subring R) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subfield (char_subring R) R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subfield (char_subring R) R
[PROOF STEP]
interpret d:domain "R \<lparr> carrier := char_subring R \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain (R\<lparr>carrier := char_subring R\<rparr>)
[PROOF STEP]
using char_ring_is_subdomain subdomain_is_domain
[PROOF STATE]
proof (prove)
using this:
subdomain (char_subring R) R
subdomain ?H R \<Longrightarrow> domain (R\<lparr>carrier := ?H\<rparr>)

goal (1 subgoal):
 1. domain (R\<lparr>carrier := char_subring R\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subfield (char_subring R) R
[PROOF STEP]
have "finite (char_subring R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (char_subring R)
[PROOF STEP]
using char_def assms
[PROOF STATE]
proof (prove)
using this:
char ?R = card (char_subring ?R)
0 < char R

goal (1 subgoal):
 1. finite (char_subring R)
[PROOF STEP]
by (metis card_ge_0_finite)
[PROOF STATE]
proof (state)
this:
finite (char_subring R)

goal (1 subgoal):
 1. subfield (char_subring R) R
[PROOF STEP]
hence "Units (R \<lparr> carrier := char_subring R \<rparr>)
    = char_subring R - {\<zero>}"
[PROOF STATE]
proof (prove)
using this:
finite (char_subring R)

goal (1 subgoal):
 1. Units (R\<lparr>carrier := char_subring R\<rparr>) = char_subring R - {\<zero>}
[PROOF STEP]
using d.finite_domain_units
[PROOF STATE]
proof (prove)
using this:
finite (char_subring R)
finite (carrier (R\<lparr>carrier := char_subring R\<rparr>)) \<Longrightarrow> Units (R\<lparr>carrier := char_subring R\<rparr>) = carrier (R\<lparr>carrier := char_subring R\<rparr>) - {\<zero>\<^bsub>R\<lparr>carrier := char_subring R\<rparr>\<^esub>}

goal (1 subgoal):
 1. Units (R\<lparr>carrier := char_subring R\<rparr>) = char_subring R - {\<zero>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Units (R\<lparr>carrier := char_subring R\<rparr>) = char_subring R - {\<zero>}

goal (1 subgoal):
 1. subfield (char_subring R) R
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Units (R\<lparr>carrier := char_subring R\<rparr>) = char_subring R - {\<zero>}

goal (1 subgoal):
 1. subfield (char_subring R) R
[PROOF STEP]
using subfieldI[OF char_ring_is_subcring]
[PROOF STATE]
proof (prove)
using this:
Units (R\<lparr>carrier := char_subring R\<rparr>) = char_subring R - {\<zero>}
Units (R\<lparr>carrier := char_subring R\<rparr>) = char_subring R - {\<zero>} \<Longrightarrow> subfield (char_subring R) R

goal (1 subgoal):
 1. subfield (char_subring R) R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subfield (char_subring R) R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decseq_convergent:
  fixes X :: "nat \<Rightarrow> real"
  assumes "decseq X"
    and "\<forall>i. B \<le> X i"
  obtains L where "X \<longlonglongrightarrow> L" "\<forall>i. L \<le> X i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>L. \<lbrakk>X \<longlonglongrightarrow> L; \<forall>i. L \<le> X i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof atomize_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>L. X \<longlonglongrightarrow> L \<and> (\<forall>i. L \<le> X i)
[PROOF STEP]
from decseq_bounded[OF assms] \<open>decseq X\<close> Bseq_monoseq_convergent[of X]
[PROOF STATE]
proof (chain)
picking this:
Bseq X
decseq X
\<lbrakk>Bseq X; monoseq X\<rbrakk> \<Longrightarrow> convergent X
[PROOF STEP]
obtain L where "X \<longlonglongrightarrow> L"
[PROOF STATE]
proof (prove)
using this:
Bseq X
decseq X
\<lbrakk>Bseq X; monoseq X\<rbrakk> \<Longrightarrow> convergent X

goal (1 subgoal):
 1. (\<And>L. X \<longlonglongrightarrow> L \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: convergent_def monoseq_def decseq_def)
[PROOF STATE]
proof (state)
this:
X \<longlonglongrightarrow> L

goal (1 subgoal):
 1. \<exists>L. X \<longlonglongrightarrow> L \<and> (\<forall>i. L \<le> X i)
[PROOF STEP]
with \<open>decseq X\<close>
[PROOF STATE]
proof (chain)
picking this:
decseq X
X \<longlonglongrightarrow> L
[PROOF STEP]
show "\<exists>L. X \<longlonglongrightarrow> L \<and> (\<forall>i. L \<le> X i)"
[PROOF STATE]
proof (prove)
using this:
decseq X
X \<longlonglongrightarrow> L

goal (1 subgoal):
 1. \<exists>L. X \<longlonglongrightarrow> L \<and> (\<forall>i. L \<le> X i)
[PROOF STEP]
by (auto intro!: exI[of _ L] decseq_ge)
[PROOF STATE]
proof (state)
this:
\<exists>L. X \<longlonglongrightarrow> L \<and> (\<forall>i. L \<le> X i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cnj_powr:
  assumes "Im a = 0 \<Longrightarrow> Re a \<ge> 0"
  shows   "cnj (a powr b) = cnj a powr cnj b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (a powr b) = cnj a powr cnj b
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> cnj (a powr b) = cnj a powr cnj b
 2. a \<noteq> 0 \<Longrightarrow> cnj (a powr b) = cnj a powr cnj b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> cnj (a powr b) = cnj a powr cnj b
 2. a \<noteq> 0 \<Longrightarrow> cnj (a powr b) = cnj a powr cnj b
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
Im a = 0 \<Longrightarrow> 0 \<le> Re a
a \<noteq> 0
[PROOF STEP]
have "a \<notin> \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
using this:
Im a = 0 \<Longrightarrow> 0 \<le> Re a
a \<noteq> 0

goal (1 subgoal):
 1. a \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (auto simp: complex_eq_iff complex_nonpos_Reals_iff)
[PROOF STATE]
proof (state)
this:
a \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> cnj (a powr b) = cnj a powr cnj b
 2. a \<noteq> 0 \<Longrightarrow> cnj (a powr b) = cnj a powr cnj b
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
a \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
a \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. cnj (a powr b) = cnj a powr cnj b
[PROOF STEP]
by (simp add: powr_def exp_cnj cnj_Ln)
[PROOF STATE]
proof (state)
this:
cnj (a powr b) = cnj a powr cnj b

goal (1 subgoal):
 1. a = 0 \<Longrightarrow> cnj (a powr b) = cnj a powr cnj b
[PROOF STEP]
qed simp


[STATEMENT]
lemma L_conc: "L(concS M1 M2) = (L M1) @@ (L M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
have "L(concS M1 M2) = (\<Union>x\<in>{Times a b |a b. a \<in> M1 \<and> b \<in> M2}. lang x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L (concS M1 M2) = \<Union> (lang ` {Times a b |a b. a \<in> M1 \<and> b \<in> M2})
[PROOF STEP]
unfolding concS_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L {Times a b |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> (lang ` {Times a b |a b. a \<in> M1 \<and> b \<in> M2})
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
L (concS M1 M2) = \<Union> (lang ` {Times a b |a b. a \<in> M1 \<and> b \<in> M2})

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
L (concS M1 M2) = \<Union> (lang ` {Times a b |a b. a \<in> M1 \<and> b \<in> M2})

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
have "\<dots> = (\<Union>{lang (Times a b) |a b. a \<in> M1 \<and> b \<in> M2} )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (lang ` {Times a b |a b. a \<in> M1 \<and> b \<in> M2}) = \<Union> {lang (Times a b) |a b. a \<in> M1 \<and> b \<in> M2}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> (lang ` {Times a b |a b. a \<in> M1 \<and> b \<in> M2}) = \<Union> {lang (Times a b) |a b. a \<in> M1 \<and> b \<in> M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (lang ` {Times a b |a b. a \<in> M1 \<and> b \<in> M2}) = \<Union> {lang (Times a b) |a b. a \<in> M1 \<and> b \<in> M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
have "\<dots> = (\<Union>{lang a @@ lang b |a b. a \<in> M1 \<and> b \<in> M2} )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {lang (Times a b) |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> {lang a @@ lang b |a b. a \<in> M1 \<and> b \<in> M2}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> {lang (Times a b) |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> {lang a @@ lang b |a b. a \<in> M1 \<and> b \<in> M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> {lang (Times a b) |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> {lang a @@ lang b |a b. a \<in> M1 \<and> b \<in> M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
have "\<dots> = (\<Union>{{xs@ys | xs ys. xs \<in> lang a & ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2} )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {lang a @@ lang b |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2}
[PROOF STEP]
unfolding conc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> {lang a @@ lang b |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> {lang a @@ lang b |a b. a \<in> M1 \<and> b \<in> M2} = \<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
have "\<dots> = {xs@ys | xs ys. xs\<in> (\<Union>r\<in>M1. lang r) \<and> ys \<in> (\<Union>r\<in>M2. lang r) }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2} = {xs @ ys |xs ys. xs \<in> \<Union> (lang ` M1) \<and> ys \<in> \<Union> (lang ` M2)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2} = {xs @ ys |xs ys. xs \<in> \<Union> (lang ` M1) \<and> ys \<in> \<Union> (lang ` M2)}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> {{xs @ ys |xs ys. xs \<in> lang a \<and> ys \<in> lang b} |a b. a \<in> M1 \<and> b \<in> M2} = {xs @ ys |xs ys. xs \<in> \<Union> (lang ` M1) \<and> ys \<in> \<Union> (lang ` M2)}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
have "\<dots> = {xs@ys | xs ys. xs\<in> L(M1) \<and> ys \<in> L(M2) }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs @ ys |xs ys. xs \<in> \<Union> (lang ` M1) \<and> ys \<in> \<Union> (lang ` M2)} = {xs @ ys |xs ys. xs \<in> L M1 \<and> ys \<in> L M2}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{xs @ ys |xs ys. xs \<in> \<Union> (lang ` M1) \<and> ys \<in> \<Union> (lang ` M2)} = {xs @ ys |xs ys. xs \<in> L M1 \<and> ys \<in> L M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{xs @ ys |xs ys. xs \<in> \<Union> (lang ` M1) \<and> ys \<in> \<Union> (lang ` M2)} = {xs @ ys |xs ys. xs \<in> L M1 \<and> ys \<in> L M2}

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
have "\<dots> = (L M1) @@ (L M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs @ ys |xs ys. xs \<in> L M1 \<and> ys \<in> L M2} = L M1 @@ L M2
[PROOF STEP]
unfolding conc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs @ ys |xs ys. xs \<in> L M1 \<and> ys \<in> L M2} = {xs @ ys |xs ys. xs \<in> L M1 \<and> ys \<in> L M2}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{xs @ ys |xs ys. xs \<in> L M1 \<and> ys \<in> L M2} = L M1 @@ L M2

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
L (concS M1 M2) = L M1 @@ L M2

goal (1 subgoal):
 1. L (concS M1 M2) = L M1 @@ L M2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
L (concS M1 M2) = L M1 @@ L M2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma injective_sup:
  assumes "injective t"
      and "e * t\<^sup>T \<le> 1"
      and "injective e"
    shows "injective (t \<squnion> e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective (t \<squnion> e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. injective (t \<squnion> e)
[PROOF STEP]
have "(t \<squnion> e) * (t \<squnion> e)\<^sup>T = t * t\<^sup>T \<squnion> t * e\<^sup>T \<squnion> e * t\<^sup>T \<squnion> e * e\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<squnion> e) * (t \<squnion> e)\<^sup>T = t * t\<^sup>T \<squnion> t * e\<^sup>T \<squnion> e * t\<^sup>T \<squnion> e * e\<^sup>T
[PROOF STEP]
by (simp add: comp_left_dist_sup conv_dist_sup semiring.distrib_right sup.assoc)
[PROOF STATE]
proof (state)
this:
(t \<squnion> e) * (t \<squnion> e)\<^sup>T = t * t\<^sup>T \<squnion> t * e\<^sup>T \<squnion> e * t\<^sup>T \<squnion> e * e\<^sup>T

goal (1 subgoal):
 1. injective (t \<squnion> e)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(t \<squnion> e) * (t \<squnion> e)\<^sup>T = t * t\<^sup>T \<squnion> t * e\<^sup>T \<squnion> e * t\<^sup>T \<squnion> e * e\<^sup>T

goal (1 subgoal):
 1. injective (t \<squnion> e)
[PROOF STEP]
using assms coreflexive_symmetric conv_dist_comp
[PROOF STATE]
proof (prove)
using this:
(t \<squnion> e) * (t \<squnion> e)\<^sup>T = t * t\<^sup>T \<squnion> t * e\<^sup>T \<squnion> e * t\<^sup>T \<squnion> e * e\<^sup>T
injective t
coreflexive (e * t\<^sup>T)
injective e
coreflexive ?x \<Longrightarrow> symmetric ?x
(?x * ?y)\<^sup>T = ?y\<^sup>T * ?x\<^sup>T

goal (1 subgoal):
 1. injective (t \<squnion> e)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
injective (t \<squnion> e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_derivative_mtx_vec_multl[derivative_intros]:
  assumes "\<And> i j. D (\<lambda>t. (A t) $$ i $ j) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R (A' t) $$ i $ j) (at t within T)"
  shows "D (\<lambda>t. A t *\<^sub>V x) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R (A' t) *\<^sub>V x) at t within T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D (\<lambda>t. A t *\<^sub>V x) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R A' t *\<^sub>V x) at t within T
[PROOF STEP]
unfolding sq_mtx_vec_mult_sum_cols
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D (\<lambda>t. \<Sum>i\<in>UNIV. x $ i *\<^sub>R \<c>\<o>\<l> i (A t)) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R (\<Sum>i\<in>UNIV. x $ i *\<^sub>R \<c>\<o>\<l> i (A' t))) at t within T
[PROOF STEP]
apply(rule_tac f'1="\<lambda>i \<tau>. \<tau> *\<^sub>R  (x $ i *\<^sub>R \<c>\<o>\<l> i (A' t))" in derivative_eq_intros(10))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> D (\<lambda>xa. x $ i *\<^sub>R \<c>\<o>\<l> i (A xa)) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R x $ i *\<^sub>R \<c>\<o>\<l> i (A' t)) at t within T
 2. (\<lambda>xa. \<Sum>i\<in>UNIV. xa *\<^sub>R x $ i *\<^sub>R \<c>\<o>\<l> i (A' t)) = (\<lambda>\<tau>. \<tau> *\<^sub>R (\<Sum>i\<in>UNIV. x $ i *\<^sub>R \<c>\<o>\<l> i (A' t)))
[PROOF STEP]
apply(simp_all add: scaleR_right.sum)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. D (\<lambda>xa. x $ i *\<^sub>R \<c>\<o>\<l> i (A xa)) \<mapsto> (\<lambda>\<tau>. (\<tau> * x $ i) *\<^sub>R \<c>\<o>\<l> i (A' t)) at t within T
[PROOF STEP]
apply(rule_tac g'1="\<lambda>\<tau>. \<tau> *\<^sub>R \<c>\<o>\<l> i (A' t)" in derivative_eq_intros(4), simp_all add: mult.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. D (\<lambda>x. \<c>\<o>\<l> i (A x)) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R \<c>\<o>\<l> i (A' t)) at t within T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
D (\<lambda>t. A t $$ ?i $ ?j) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R A' t $$ ?i $ ?j) at t within T

goal (1 subgoal):
 1. \<And>i. D (\<lambda>x. \<c>\<o>\<l> i (A x)) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R \<c>\<o>\<l> i (A' t)) at t within T
[PROOF STEP]
unfolding sq_mtx_col_def column_def
[PROOF STATE]
proof (prove)
using this:
D (\<lambda>t. A t $$ ?i $ ?j) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R A' t $$ ?i $ ?j) at t within T

goal (1 subgoal):
 1. \<And>i. D (\<lambda>x. map_fun id (map_fun to_vec id) (\<lambda>j A. \<chi>i. A $ i $ j) i (A x)) \<mapsto> (\<lambda>\<tau>. \<tau> *\<^sub>R map_fun id (map_fun to_vec id) (\<lambda>j A. \<chi>i. A $ i $ j) i (A' t)) at t within T
[PROOF STEP]
by (transfer, simp add: has_derivative_component)


[STATEMENT]
lemma gfp_exp_bound:
  "(\<And>P. unitary P \<Longrightarrow> unitary (t P)) \<Longrightarrow> bounded_by 1 (gfp_exp t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. unitary P \<Longrightarrow> unitary (t P)) \<Longrightarrow> bounded_by 1 (gfp_exp t)
[PROOF STEP]
unfolding gfp_exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. unitary P \<Longrightarrow> unitary (t P)) \<Longrightarrow> bounded_by 1 (Sup_exp {P. unitary P \<and> P \<tturnstile> t P})
[PROOF STEP]
by(rule bounded_byI2[OF Sup_exp_least], auto)


[STATEMENT]
lemma Red_I_subs_Red_I_diff_Red_F: "Red_I N \<subseteq> Red_I (N - Red_F N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Red_I N \<subseteq> Red_I (N - Red_F N)
[PROOF STEP]
unfolding Red_F_conv Red_I_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_std_red.Red_I N \<subseteq> fin_std_red.Red_I (N - fin_std_red.Red_F N)
[PROOF STEP]
by (rule fin_std_red.Red_I_subs_Red_I_diff_Red_F)


[STATEMENT]
lemma rel_generat_reflI:
  "\<lbrakk> \<And>y. y \<in> generat_pures x \<Longrightarrow> A y y;
     \<And>out. out \<in> generat_outs x \<Longrightarrow> B out out;
     \<And>cont. cont \<in> generat_conts x \<Longrightarrow> C cont cont \<rbrakk>
  \<Longrightarrow> rel_generat A B C x x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>y. y \<in> generat_pures x \<Longrightarrow> A y y; \<And>out. out \<in> generat_outs x \<Longrightarrow> B out out; \<And>cont. cont \<in> generat_conts x \<Longrightarrow> C cont cont\<rbrakk> \<Longrightarrow> rel_generat A B C x x
[PROOF STEP]
by(cases x) auto


[STATEMENT]
lemma min_wpl_simps[simp]:
  "i > j \<Longrightarrow> min_wpl i j = 0"
  "i \<le> j \<Longrightarrow> min_wpl i j =
     Min ((\<lambda>k. min_wpl i (k-1) + min_wpl (k+1) j + w i j) ` {i..j})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (j < i \<Longrightarrow> local.min_wpl i j = 0) &&& (i \<le> j \<Longrightarrow> local.min_wpl i j = (MIN k\<in>{i..j}. local.min_wpl i (k - 1) + local.min_wpl (k + 1) j + w i j))
[PROOF STEP]
by(auto simp add: min_wpl.simps[of i j] Min_add_commute)


[STATEMENT]
lemma mset_eq_length_filter:
  assumes "mset xs = mset ys"
  shows "length (filter (\<lambda>x. z = x) xs) = length (filter (\<lambda>y. z = y) ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) z) xs) = length (filter ((=) z) ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys

goal (1 subgoal):
 1. length (filter ((=) z) xs) = length (filter ((=) z) ys)
[PROOF STEP]
by (metis count_mset)


[STATEMENT]
lemma real_of_ereal_minus:
  fixes a b :: ereal
  shows "real_of_ereal (a - b) = (if \<bar>a\<bar> = \<infinity> \<or> \<bar>b\<bar> = \<infinity> then 0 else real_of_ereal a - real_of_ereal b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal (a - b) = (if \<bar>a\<bar> = \<infinity> \<or> \<bar>b\<bar> = \<infinity> then 0 else real_of_ereal a - real_of_ereal b)
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) auto


[STATEMENT]
lemma inversion_is_antihomography [simp]:
  shows "is_antihomography inversion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_antihomography inversion
[PROOF STEP]
using moebius_reciprocal
[PROOF STATE]
proof (prove)
using this:
moebius_pt moebius_reciprocal = reciprocal

goal (1 subgoal):
 1. is_antihomography inversion
[PROOF STEP]
unfolding inversion_sym is_antihomography_def is_moebius_def
[PROOF STATE]
proof (prove)
using this:
moebius_pt moebius_reciprocal = reciprocal

goal (1 subgoal):
 1. \<exists>f'. (\<exists>M. f' = moebius_pt M) \<and> reciprocal \<circ> conjugate = f' \<circ> conjugate
[PROOF STEP]
by metis


[STATEMENT]
lemma range_subset_mem_starsetNat: "range f \<subseteq> A \<Longrightarrow> starfun f whn \<in> *s* A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f \<subseteq> A \<Longrightarrow> (*f* f) whn \<in> *s* A
[PROOF STEP]
by (metis STAR_subset_closed UNIV_I image_eqI starset_UNIV starset_image)


[STATEMENT]
lemma between_equality_2:
  assumes "Bet A B C" and
    "Bet A C B"
  shows "B = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = C
[PROOF STEP]
using assms(1) assms(2) between_equality between_symmetry
[PROOF STATE]
proof (prove)
using this:
Bet A B C
Bet A C B
\<lbrakk>Bet ?A ?B ?C; Bet ?B ?A ?C\<rbrakk> \<Longrightarrow> ?A = ?B
Bet ?A ?B ?C \<Longrightarrow> Bet ?C ?B ?A

goal (1 subgoal):
 1. B = C
[PROOF STEP]
by blast


[STATEMENT]
lemma cart_flip_aux: "{f (snd p) (fst p) |p. p \<in> (B \<times> A)} = {f (fst p) (snd p) |p. p \<in> (A \<times> B)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f (snd p) (fst p) |p. p \<in> B \<times> A} = {f (fst p) (snd p) |p. p \<in> A \<times> B}
[PROOF STEP]
by auto


[STATEMENT]
lemma  bernoulli_stream_component_probability:
  assumes "N = bernoulli_stream p" and "0 \<le> p" and "p \<le> 1"
  shows "\<forall> n. emeasure N {w\<in> space N. (snth w n)} = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "prob_space N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space N
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream p
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. prob_space N
[PROOF STEP]
by (simp add: bernoulli_stream_def prob_space.prob_space_stream_space prob_space_measure_pmf)
[PROOF STATE]
proof (state)
this:
prob_space N

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
fix n::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
let ?S = "{w\<in> space N. (snth w n)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have s: "?S \<in> sets N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w \<in> space N. w !! n} \<in> sets N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {w \<in> space N. w !! n} \<in> sets N
[PROOF STEP]
have "(\<lambda>w. snth w n) \<in> measurable N (measure_pmf (bernoulli_pmf p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. w !! n) \<in> N \<rightarrow>\<^sub>M measure_pmf (bernoulli_pmf p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream p
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. (\<lambda>w. w !! n) \<in> N \<rightarrow>\<^sub>M measure_pmf (bernoulli_pmf p)
[PROOF STEP]
by (simp add: bernoulli_stream_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. w !! n) \<in> N \<rightarrow>\<^sub>M measure_pmf (bernoulli_pmf p)

goal (1 subgoal):
 1. {w \<in> space N. w !! n} \<in> sets N
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>w. w !! n) \<in> N \<rightarrow>\<^sub>M measure_pmf (bernoulli_pmf p)

goal (1 subgoal):
 1. {w \<in> space N. w !! n} \<in> sets N
[PROOF STEP]
have "{True} \<in> sets (measure_pmf (bernoulli_pmf p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {True} \<in> measure_pmf.events (bernoulli_pmf p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{True} \<in> measure_pmf.events (bernoulli_pmf p)

goal (1 subgoal):
 1. {w \<in> space N. w !! n} \<in> sets N
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>w. w !! n) \<in> N \<rightarrow>\<^sub>M measure_pmf (bernoulli_pmf p)
{True} \<in> measure_pmf.events (bernoulli_pmf p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. w !! n) \<in> N \<rightarrow>\<^sub>M measure_pmf (bernoulli_pmf p)
{True} \<in> measure_pmf.events (bernoulli_pmf p)

goal (1 subgoal):
 1. {w \<in> space N. w !! n} \<in> sets N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{w \<in> space N. w !! n} \<in> sets N

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{w \<in> space N. w !! n} \<in> sets N

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
let ?PM = "(\<lambda>i::nat. (measure_pmf (bernoulli_pmf p)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have isps: "product_prob_space ?PM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_prob_space (\<lambda>i. measure_pmf (bernoulli_pmf p))
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
product_prob_space (\<lambda>i. measure_pmf (bernoulli_pmf p))

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
let ?Z = "{X::nat\<Rightarrow>bool. X n = True}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
let ?wPM = "Pi\<^sub>M UNIV ?PM"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "space ?wPM = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = UNIV
[PROOF STEP]
using space_PiM
[PROOF STATE]
proof (prove)
using this:
space (Pi\<^sub>M ?I ?M) = (\<Pi>\<^sub>E i\<in>?I. space (?M i))

goal (1 subgoal):
 1. space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = UNIV
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = UNIV

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
hence "(to_stream -` ?S \<inter> (space ?wPM)) = to_stream -` ?S"
[PROOF STATE]
proof (prove)
using this:
space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = UNIV

goal (1 subgoal):
 1. to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = to_stream -` {w \<in> space N. w !! n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = to_stream -` {w \<in> space N. w !! n}

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = to_stream -` {w \<in> space N. w !! n}

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "... = ?Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_stream -` {w \<in> space N. w !! n} = {X. X n = True}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream p
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. to_stream -` {w \<in> space N. w !! n} = {X. X n = True}
[PROOF STEP]
by (simp add:bernoulli_stream_space to_stream_def)
[PROOF STATE]
proof (state)
this:
to_stream -` {w \<in> space N. w !! n} = {X. X n = True}

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
to_stream -` {w \<in> space N. w !! n} = {X. X n = True}

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "... = prod_emb UNIV ?PM {n} (Pi\<^sub>E {n} (\<lambda>x::nat. {True}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {X. X n = True} = prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
fix X
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
assume "X \<in> prod_emb UNIV ?PM {n} (Pi\<^sub>E {n} (\<lambda>x::nat. {True}))"
[PROOF STATE]
proof (state)
this:
X \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
hence "restrict X {n} \<in> (Pi\<^sub>E {n} (\<lambda>x::nat. {True}))"
[PROOF STATE]
proof (prove)
using this:
X \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}
[PROOF STEP]
using prod_emb_iff[of X]
[PROOF STATE]
proof (prove)
using this:
X \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
(X \<in> prod_emb ?I ?M ?K ?X) = (X \<in> extensional ?I \<and> restrict X ?K \<in> ?X \<and> (\<forall>i\<in>?I. X i \<in> space (?M i)))

goal (1 subgoal):
 1. restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}

goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
hence "X n = True"
[PROOF STATE]
proof (prove)
using this:
restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}

goal (1 subgoal):
 1. X n = True
[PROOF STEP]
unfolding PiE_iff
[PROOF STATE]
proof (prove)
using this:
(\<forall>i\<in>{n}. restrict X {n} i \<in> {True}) \<and> restrict X {n} \<in> extensional {n}

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

goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
hence "X \<in> ?Z"
[PROOF STATE]
proof (prove)
using this:
X n = True

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

goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?X2 \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<Longrightarrow> ?X2 \<in> {X. X n = True}

goal (2 subgoals):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
 2. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
thus "prod_emb UNIV ?PM {n} (Pi\<^sub>E {n} (\<lambda>x::nat. {True})) \<subseteq> ?Z"
[PROOF STATE]
proof (prove)
using this:
?X2 \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<Longrightarrow> ?X2 \<in> {X. X n = True}

goal (1 subgoal):
 1. prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}) \<subseteq> {X. X n = True}

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
fix X
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
assume "X \<in> ?Z"
[PROOF STATE]
proof (state)
this:
X \<in> {X. X n = True}

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
hence "X n = True"
[PROOF STATE]
proof (prove)
using this:
X \<in> {X. X n = True}

goal (1 subgoal):
 1. X n = True
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X n = True

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
hence "restrict X {n} \<in> (Pi\<^sub>E {n} (\<lambda>x::nat. {True}))"
[PROOF STATE]
proof (prove)
using this:
X n = True

goal (1 subgoal):
 1. restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}
[PROOF STEP]
unfolding PiE_iff
[PROOF STATE]
proof (prove)
using this:
X n = True

goal (1 subgoal):
 1. (\<forall>i\<in>{n}. restrict X {n} i \<in> {True}) \<and> restrict X {n} \<in> extensional {n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
have "X \<in> extensional UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> extensional UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X \<in> extensional UNIV

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
X \<in> extensional UNIV

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
have "\<forall>i \<in> UNIV. X i \<in> space (?PM i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>UNIV. X i \<in> space (measure_pmf (bernoulli_pmf p))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>UNIV. X i \<in> space (measure_pmf (bernoulli_pmf p))

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}
X \<in> extensional UNIV
\<forall>i\<in>UNIV. X i \<in> space (measure_pmf (bernoulli_pmf p))
[PROOF STEP]
have "X \<in> prod_emb UNIV ?PM {n} (Pi\<^sub>E {n} (\<lambda>x::nat. {True}))"
[PROOF STATE]
proof (prove)
using this:
restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}
X \<in> extensional UNIV
\<forall>i\<in>UNIV. X i \<in> space (measure_pmf (bernoulli_pmf p))

goal (1 subgoal):
 1. X \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
using prod_emb_iff[of X]
[PROOF STATE]
proof (prove)
using this:
restrict X {n} \<in> {n} \<rightarrow>\<^sub>E {True}
X \<in> extensional UNIV
\<forall>i\<in>UNIV. X i \<in> space (measure_pmf (bernoulli_pmf p))
(X \<in> prod_emb ?I ?M ?K ?X) = (X \<in> extensional ?I \<and> restrict X ?K \<in> ?X \<and> (\<forall>i\<in>?I. X i \<in> space (?M i)))

goal (1 subgoal):
 1. X \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?X2 \<in> {X. X n = True} \<Longrightarrow> ?X2 \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
thus "?Z \<subseteq> prod_emb UNIV ?PM {n} (Pi\<^sub>E {n} (\<lambda>x::nat. {True}))"
[PROOF STATE]
proof (prove)
using this:
?X2 \<in> {X. X n = True} \<Longrightarrow> ?X2 \<in> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. {X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{X. X n = True} \<subseteq> prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{X. X n = True} = prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
have inteq: "(to_stream -` ?S \<inter> (space ?wPM)) = prod_emb UNIV ?PM {n} (Pi\<^sub>E {n} (\<lambda>x::nat. {True}))"
[PROOF STATE]
proof (prove)
using this:
to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "emeasure N ?S = emeasure ?wPM (to_stream -` ?S \<inter> (space ?wPM))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure N {w \<in> space N. w !! n} = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))
[PROOF STEP]
using assms emeasure_distr[of "to_stream" ?wPM "(vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!)
           (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))" ?S] measurable_to_stream[of "(measure_pmf (bernoulli_pmf p))"] s
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream p
0 \<le> p
p \<le> 1
\<lbrakk>to_stream \<in> Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) \<rightarrow>\<^sub>M vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))); {w \<in> space N. w !! n} \<in> sets (vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))\<rbrakk> \<Longrightarrow> emeasure (distr (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) to_stream) {w \<in> space N. w !! n} = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))
to_stream \<in> Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) \<rightarrow>\<^sub>M stream_space (measure_pmf (bernoulli_pmf p))
{w \<in> space N. w !! n} \<in> sets N

goal (1 subgoal):
 1. emeasure N {w \<in> space N. w !! n} = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))
[PROOF STEP]
unfolding bernoulli_stream_def stream_space_def
[PROOF STATE]
proof (prove)
using this:
N = distr (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) to_stream
0 \<le> p
p \<le> 1
\<lbrakk>to_stream \<in> Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) \<rightarrow>\<^sub>M vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))); {w \<in> space N. w !! n} \<in> sets (vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))\<rbrakk> \<Longrightarrow> emeasure (distr (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) to_stream) {w \<in> space N. w !! n} = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))
to_stream \<in> Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) \<rightarrow>\<^sub>M distr (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (vimage_algebra (streams (space (measure_pmf (bernoulli_pmf p)))) (!!) (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) to_stream
{w \<in> space N. w !! n} \<in> sets N

goal (1 subgoal):
 1. emeasure N {w \<in> space N. w !! n} = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
emeasure N {w \<in> space N. w !! n} = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure N {w \<in> space N. w !! n} = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))))

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "... = emeasure ?wPM (prod_emb UNIV ?PM {n} (Pi\<^sub>E {n} (\<lambda>x::nat. {True})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}))
[PROOF STEP]
using inteq
[PROOF STATE]
proof (prove)
using this:
to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) = prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}))

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (to_stream -` {w \<in> space N. w !! n} \<inter> space (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)))) = emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True}))

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "... =
    (\<Prod>i\<in>{n}. emeasure (?PM i) ((\<lambda>x::nat. {True}) i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})) = (\<Prod>i\<in>{n}. emeasure (measure_pmf (bernoulli_pmf p)) {True})
[PROOF STEP]
using isps
[PROOF STATE]
proof (prove)
using this:
product_prob_space (\<lambda>i. measure_pmf (bernoulli_pmf p))

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})) = (\<Prod>i\<in>{n}. emeasure (measure_pmf (bernoulli_pmf p)) {True})
[PROOF STEP]
by (auto simp add: product_prob_space.emeasure_PiM_emb simp del: ext_funcset_to_sing_iff)
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})) = (\<Prod>i\<in>{n}. emeasure (measure_pmf (bernoulli_pmf p)) {True})

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (prod_emb UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p)) {n} ({n} \<rightarrow>\<^sub>E {True})) = (\<Prod>i\<in>{n}. emeasure (measure_pmf (bernoulli_pmf p)) {True})

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "... = emeasure (?PM n) {True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>{n}. emeasure (measure_pmf (bernoulli_pmf p)) {True}) = emeasure (measure_pmf (bernoulli_pmf p)) {True}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>{n}. emeasure (measure_pmf (bernoulli_pmf p)) {True}) = emeasure (measure_pmf (bernoulli_pmf p)) {True}

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>{n}. emeasure (measure_pmf (bernoulli_pmf p)) {True}) = emeasure (measure_pmf (bernoulli_pmf p)) {True}

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
have "... = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf (bernoulli_pmf p)) {True} = ennreal p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream p
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. emeasure (measure_pmf (bernoulli_pmf p)) {True} = ennreal p
[PROOF STEP]
by (simp add: emeasure_pmf_single)
[PROOF STATE]
proof (state)
this:
emeasure (measure_pmf (bernoulli_pmf p)) {True} = ennreal p

goal (1 subgoal):
 1. \<And>n. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
show "emeasure N ?S = p"
[PROOF STATE]
proof (prove)
using this:
emeasure N {w \<in> space N. w !! n} = ennreal p

goal (1 subgoal):
 1. emeasure N {w \<in> space N. w !! n} = ennreal p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure N {w \<in> space N. w !! n} = ennreal p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_open_segment:
  fixes a :: "'a::euclidean_space"
  shows "open_segment a b \<subseteq> open_segment c d \<longleftrightarrow>
         a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
proof (cases "a = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<Longrightarrow> (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
 2. a \<noteq> b \<Longrightarrow> (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. a = b \<Longrightarrow> (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
 2. a \<noteq> b \<Longrightarrow> (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
 2. a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d \<Longrightarrow> open_segment a b \<subseteq> open_segment c d
[PROOF STEP]
assume rhs: ?rhs
[PROOF STATE]
proof (state)
this:
a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d

goal (2 subgoals):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
 2. a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d \<Longrightarrow> open_segment a b \<subseteq> open_segment c d
[PROOF STEP]
with \<open>a \<noteq> b\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
have "c \<noteq> d"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d

goal (1 subgoal):
 1. c \<noteq> d
[PROOF STEP]
using closed_segment_idem singleton_iff
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
closed_segment ?a ?a = {?a}
(?b \<in> {?a}) = (?b = ?a)

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

goal (2 subgoals):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
 2. a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d \<Longrightarrow> open_segment a b \<subseteq> open_segment c d
[PROOF STEP]
have "\<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) =
               (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1"
        if neq: "(1 - ua) *\<^sub>R c + ua *\<^sub>R d \<noteq> (1 - ub) *\<^sub>R c + ub *\<^sub>R d" "c \<noteq> d"
           and "a = (1 - ua) *\<^sub>R c + ua *\<^sub>R d" "b = (1 - ub) *\<^sub>R c + ub *\<^sub>R d"
           and u: "0 < u" "u < 1" and uab: "0 \<le> ua" "ua \<le> 1" "0 \<le> ub" "ub \<le> 1"
        for u ua ub
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
have "ua \<noteq> ub"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ua \<noteq> ub
[PROOF STEP]
using neq
[PROOF STATE]
proof (prove)
using this:
(1 - ua) *\<^sub>R c + ua *\<^sub>R d \<noteq> (1 - ub) *\<^sub>R c + ub *\<^sub>R d
c \<noteq> d

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

goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ua \<noteq> ub

goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
have "(u - 1) * ua \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u - 1) * ua \<le> 0
[PROOF STEP]
using u uab
[PROOF STATE]
proof (prove)
using this:
0 < u
u < 1
0 \<le> ua
ua \<le> 1
0 \<le> ub
ub \<le> 1

goal (1 subgoal):
 1. (u - 1) * ua \<le> 0
[PROOF STEP]
by (simp add: mult_nonpos_nonneg)
[PROOF STATE]
proof (state)
this:
(u - 1) * ua \<le> 0

goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ua \<noteq> ub
(u - 1) * ua \<le> 0
[PROOF STEP]
have lt: "(u - 1) * ua < u * ub"
[PROOF STATE]
proof (prove)
using this:
ua \<noteq> ub
(u - 1) * ua \<le> 0

goal (1 subgoal):
 1. (u - 1) * ua < u * ub
[PROOF STEP]
using u uab
[PROOF STATE]
proof (prove)
using this:
ua \<noteq> ub
(u - 1) * ua \<le> 0
0 < u
u < 1
0 \<le> ua
ua \<le> 1
0 \<le> ub
ub \<le> 1

goal (1 subgoal):
 1. (u - 1) * ua < u * ub
[PROOF STEP]
by (metis antisym_conv diff_ge_0_iff_ge le_less_trans mult_eq_0_iff mult_le_0_iff not_less)
[PROOF STATE]
proof (state)
this:
(u - 1) * ua < u * ub

goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
have "p * ua + q * ub < p+q" if p: "0 < p" and  q: "0 < q" for p q
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * ua + q * ub < p + q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p * ua + q * ub < p + q
[PROOF STEP]
have "\<not> p \<le> 0" "\<not> q \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> p \<le> 0 &&& \<not> q \<le> 0
[PROOF STEP]
using p q not_less
[PROOF STATE]
proof (prove)
using this:
0 < p
0 < q
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. \<not> p \<le> 0 &&& \<not> q \<le> 0
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
\<not> p \<le> 0
\<not> q \<le> 0

goal (1 subgoal):
 1. p * ua + q * ub < p + q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> p \<le> 0
\<not> q \<le> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> p \<le> 0
\<not> q \<le> 0

goal (1 subgoal):
 1. p * ua + q * ub < p + q
[PROOF STEP]
by (metis \<open>ua \<noteq> ub\<close> add_less_cancel_left add_less_cancel_right add_mono_thms_linordered_field(5)
                    less_eq_real_def mult_cancel_left1 mult_less_cancel_left2 uab(2) uab(4))
[PROOF STATE]
proof (state)
this:
p * ua + q * ub < p + q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?p; 0 < ?q\<rbrakk> \<Longrightarrow> ?p * ua + ?q * ub < ?p + ?q

goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < ?p; 0 < ?q\<rbrakk> \<Longrightarrow> ?p * ua + ?q * ub < ?p + ?q
[PROOF STEP]
have "(1 - u) * ua + u * ub < 1"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?p; 0 < ?q\<rbrakk> \<Longrightarrow> ?p * ua + ?q * ub < ?p + ?q

goal (1 subgoal):
 1. (1 - u) * ua + u * ub < 1
[PROOF STEP]
using u \<open>ua \<noteq> ub\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?p; 0 < ?q\<rbrakk> \<Longrightarrow> ?p * ua + ?q * ub < ?p + ?q
0 < u
u < 1
ua \<noteq> ub

goal (1 subgoal):
 1. (1 - u) * ua + u * ub < 1
[PROOF STEP]
by (metis diff_add_cancel diff_gt_0_iff_gt)
[PROOF STATE]
proof (state)
this:
(1 - u) * ua + u * ub < 1

goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
with lt
[PROOF STATE]
proof (chain)
picking this:
(u - 1) * ua < u * ub
(1 - u) * ua + u * ub < 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(u - 1) * ua < u * ub
(1 - u) * ua + u * ub < 1

goal (1 subgoal):
 1. \<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
by (rule_tac x="ua + u*(ub-ua)" in exI) (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>(1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d \<noteq> (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; c \<noteq> d; a = (1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d; b = (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; 0 < ?u; ?u < 1; 0 \<le> ?ua; ?ua \<le> 1; 0 \<le> ?ub; ?ub \<le> 1\<rbrakk> \<Longrightarrow> \<exists>uc. (1 - ?u) *\<^sub>R ((1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d) + ?u *\<^sub>R ((1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1

goal (2 subgoals):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
 2. a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d \<Longrightarrow> open_segment a b \<subseteq> open_segment c d
[PROOF STEP]
with rhs \<open>a \<noteq> b\<close> \<open>c \<noteq> d\<close>
[PROOF STATE]
proof (chain)
picking this:
a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
a \<noteq> b
c \<noteq> d
\<lbrakk>(1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d \<noteq> (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; c \<noteq> d; a = (1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d; b = (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; 0 < ?u; ?u < 1; 0 \<le> ?ua; ?ua \<le> 1; 0 \<le> ?ub; ?ub \<le> 1\<rbrakk> \<Longrightarrow> \<exists>uc. (1 - ?u) *\<^sub>R ((1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d) + ?u *\<^sub>R ((1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
a \<noteq> b
c \<noteq> d
\<lbrakk>(1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d \<noteq> (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; c \<noteq> d; a = (1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d; b = (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; 0 < ?u; ?u < 1; 0 \<le> ?ua; ?ua \<le> 1; 0 \<le> ?ub; ?ub \<le> 1\<rbrakk> \<Longrightarrow> \<exists>uc. (1 - ?u) *\<^sub>R ((1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d) + ?u *\<^sub>R ((1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1

goal (1 subgoal):
 1. open_segment a b \<subseteq> open_segment c d
[PROOF STEP]
unfolding open_segment_image_interval closed_segment_def
[PROOF STATE]
proof (prove)
using this:
a = b \<or> a \<in> {(1 - u) *\<^sub>R c + u *\<^sub>R d |u. 0 \<le> u \<and> u \<le> 1} \<and> b \<in> {(1 - u) *\<^sub>R c + u *\<^sub>R d |u. 0 \<le> u \<and> u \<le> 1}
a \<noteq> b
c \<noteq> d
\<lbrakk>(1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d \<noteq> (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; c \<noteq> d; a = (1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d; b = (1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d; 0 < ?u; ?u < 1; 0 \<le> ?ua; ?ua \<le> 1; 0 \<le> ?ub; ?ub \<le> 1\<rbrakk> \<Longrightarrow> \<exists>uc. (1 - ?u) *\<^sub>R ((1 - ?ua) *\<^sub>R c + ?ua *\<^sub>R d) + ?u *\<^sub>R ((1 - ?ub) *\<^sub>R c + ?ub *\<^sub>R d) = (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1

goal (1 subgoal):
 1. (if a = b then {} else (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) \<subseteq> (if c = d then {} else (\<lambda>u. (1 - u) *\<^sub>R c + u *\<^sub>R d) ` {0<..<1})
[PROOF STEP]
by (fastforce simp add:)
[PROOF STATE]
proof (state)
this:
open_segment a b \<subseteq> open_segment c d

goal (1 subgoal):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
assume lhs: ?lhs
[PROOF STATE]
proof (state)
this:
open_segment a b \<subseteq> open_segment c d

goal (1 subgoal):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
with \<open>a \<noteq> b\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
open_segment a b \<subseteq> open_segment c d
[PROOF STEP]
have "c \<noteq> d"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
open_segment a b \<subseteq> open_segment c d

goal (1 subgoal):
 1. c \<noteq> d
[PROOF STEP]
by (meson finite_open_segment rev_finite_subset)
[PROOF STATE]
proof (state)
this:
c \<noteq> d

goal (1 subgoal):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
have "closure (open_segment a b) \<subseteq> closure (open_segment c d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (open_segment a b) \<subseteq> closure (open_segment c d)
[PROOF STEP]
using lhs closure_mono
[PROOF STATE]
proof (prove)
using this:
open_segment a b \<subseteq> open_segment c d
?S \<subseteq> ?T \<Longrightarrow> closure ?S \<subseteq> closure ?T

goal (1 subgoal):
 1. closure (open_segment a b) \<subseteq> closure (open_segment c d)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closure (open_segment a b) \<subseteq> closure (open_segment c d)

goal (1 subgoal):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closure (open_segment a b) \<subseteq> closure (open_segment c d)
[PROOF STEP]
have "closed_segment a b \<subseteq> closed_segment c d"
[PROOF STATE]
proof (prove)
using this:
closure (open_segment a b) \<subseteq> closure (open_segment c d)

goal (1 subgoal):
 1. closed_segment a b \<subseteq> closed_segment c d
[PROOF STEP]
by (simp add: \<open>a \<noteq> b\<close> \<open>c \<noteq> d\<close>)
[PROOF STATE]
proof (state)
this:
closed_segment a b \<subseteq> closed_segment c d

goal (1 subgoal):
 1. open_segment a b \<subseteq> open_segment c d \<Longrightarrow> a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed_segment a b \<subseteq> closed_segment c d
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
closed_segment a b \<subseteq> closed_segment c d

goal (1 subgoal):
 1. a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d
[PROOF STEP]
by (force simp: \<open>a \<noteq> b\<close>)
[PROOF STATE]
proof (state)
this:
a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(open_segment a b \<subseteq> open_segment c d) = (a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ccSup_inf:
  "countable B \<Longrightarrow> inf (Sup B) a = (SUP b\<in>B. inf b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable B \<Longrightarrow> inf (Sup B) a = (SUP b\<in>B. inf b a)
[PROOF STEP]
by (simp add: inf_ccSup inf_commute)


[STATEMENT]
lemma real_imag_0:
  assumes "is_real a" "is_imag a"
  shows "a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real a
is_imag a

goal (1 subgoal):
 1. a = 0
[PROOF STEP]
by (simp add: complex.expand)


[STATEMENT]
lemma EVEN_ODD_supp:
  shows "supp EVEN = (UNIV::atom set)"
  and   "supp ODD  = (UNIV::atom set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp EVEN = UNIV &&& supp ODD = UNIV
[PROOF STEP]
using supp_infinite_coinfinite UNIV_subtract EVEN_ODD_infinite
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>infinite ?S; infinite (UNIV - ?S)\<rbrakk> \<Longrightarrow> supp ?S = UNIV
UNIV - EVEN = ODD
UNIV - ODD = EVEN
infinite EVEN
infinite ODD

goal (1 subgoal):
 1. supp EVEN = UNIV &&& supp ODD = UNIV
[PROOF STEP]
by simp_all


[STATEMENT]
lemma cond_distr:
  assumes "test p" and "test q" and "test r"
  shows "(p \<cdot> q + !p \<cdot> r) \<cdot> (p \<cdot> x + !p \<cdot> y) = p \<cdot> q \<cdot> x + !p \<cdot> r \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<cdot> q + !p \<cdot> r) \<cdot> (p \<cdot> x + !p \<cdot> y) = p \<cdot> q \<cdot> x + !p \<cdot> r \<cdot> y
[PROOF STEP]
using  assms(1) assms(2) assms(3) local.test_mult_comm_var assms(1) assms(2) assms(3) cond_distr_var local.test_mult_comm_var
[PROOF STATE]
proof (prove)
using this:
test p
test q
test r
\<lbrakk>test ?p; test ?q\<rbrakk> \<Longrightarrow> ?p \<cdot> ?q = ?q \<cdot> ?p
test p
test q
test r
\<lbrakk>test ?p; test ?q; test ?r\<rbrakk> \<Longrightarrow> (?q \<cdot> ?p + ?r \<cdot> !?p) \<cdot> (?p \<cdot> ?x + !?p \<cdot> ?y) = ?q \<cdot> ?p \<cdot> ?x + ?r \<cdot> !?p \<cdot> ?y
\<lbrakk>test ?p; test ?q\<rbrakk> \<Longrightarrow> ?p \<cdot> ?q = ?q \<cdot> ?p

goal (1 subgoal):
 1. (p \<cdot> q + !p \<cdot> r) \<cdot> (p \<cdot> x + !p \<cdot> y) = p \<cdot> q \<cdot> x + !p \<cdot> r \<cdot> y
[PROOF STEP]
by auto


[STATEMENT]
lemma (in finite_comm_group) restrict_char_hom:
  assumes "subgroup H G"
  shows "group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
let ?CG = "Characters G"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
let ?H = "G\<lparr>carrier := H\<rparr>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
let ?CH = "Characters ?H"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
interpret H: subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
interpret H: finite_comm_group ?H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
by (simp add: assms subgroup_imp_finite_comm_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
interpret CG: finite_comm_group ?CG
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
using finite_comm_group_Characters
[PROOF STATE]
proof (prove)
using this:
finite_comm_group (Characters G)

goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
interpret CH: finite_comm_group ?CH
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
using H.finite_comm_group_Characters
[PROOF STATE]
proof (prove)
using this:
finite_comm_group (Characters (G\<lparr>carrier := H\<rparr>))

goal (1 subgoal):
 1. finite_comm_group (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)
[PROOF STEP]
proof(unfold_locales, intro homI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier (Characters G) \<Longrightarrow> restrict_char H x \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))
 2. \<And>x y. \<lbrakk>x \<in> carrier (Characters G); y \<in> carrier (Characters G)\<rbrakk> \<Longrightarrow> restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y
[PROOF STEP]
show "restrict_char H x \<in> carrier ?CH" if x: "x \<in> carrier ?CG" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict_char H x \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H x \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
interpret xc: character G x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. character G x
[PROOF STEP]
unfolding Characters_def characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier \<lparr>carrier = Collect (character G), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>

goal (1 subgoal):
 1. character G x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H x \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
have "character ?H (restrict_char H x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character (G\<lparr>carrier := H\<rparr>) (restrict_char H x)
[PROOF STEP]
by (unfold restrict_char_def, unfold_locales, auto)
[PROOF STATE]
proof (state)
this:
character (G\<lparr>carrier := H\<rparr>) (restrict_char H x)

goal (1 subgoal):
 1. restrict_char H x \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
character (G\<lparr>carrier := H\<rparr>) (restrict_char H x)

goal (1 subgoal):
 1. restrict_char H x \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
unfolding Characters_def characters_def
[PROOF STATE]
proof (prove)
using this:
character (G\<lparr>carrier := H\<rparr>) (restrict_char H x)

goal (1 subgoal):
 1. restrict_char H x \<in> carrier \<lparr>carrier = Collect (character (G\<lparr>carrier := H\<rparr>)), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char (G\<lparr>carrier := H\<rparr>)\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
restrict_char H x \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 \<in> carrier (Characters G) \<Longrightarrow> restrict_char H ?x2 \<in> carrier (Characters (G\<lparr>carrier := H\<rparr>))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (Characters G); y \<in> carrier (Characters G)\<rbrakk> \<Longrightarrow> restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y
[PROOF STEP]
show "restrict_char H (x \<otimes>\<^bsub>?CG\<^esub> y) = restrict_char H x \<otimes>\<^bsub>?CH\<^esub> restrict_char H y"
      if x: "x \<in> carrier ?CG" and y: "y \<in> carrier ?CG" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y
[PROOF STEP]
interpret xc: character G x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. character G x
[PROOF STEP]
unfolding Characters_def characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier \<lparr>carrier = Collect (character G), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>

goal (1 subgoal):
 1. character G x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y
[PROOF STEP]
interpret yc: character G y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G y
[PROOF STEP]
using y
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier (Characters G)

goal (1 subgoal):
 1. character G y
[PROOF STEP]
unfolding Characters_def characters_def
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier \<lparr>carrier = Collect (character G), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>

goal (1 subgoal):
 1. character G y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y
[PROOF STEP]
unfolding Characters_def restrict_char_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>e. if e \<in> H then (x \<otimes>\<^bsub>\<lparr>carrier = characters G, monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>\<^esub> y) e else 0) = (\<lambda>e. if e \<in> H then x e else 0) \<otimes>\<^bsub>\<lparr>carrier = characters (G\<lparr>carrier := H\<rparr>), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char (G\<lparr>carrier := H\<rparr>)\<rparr>\<^esub> (\<lambda>e. if e \<in> H then y e else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
restrict_char H (x \<otimes>\<^bsub>Characters G\<^esub> y) = restrict_char H x \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x2 \<in> carrier (Characters G); ?y2 \<in> carrier (Characters G)\<rbrakk> \<Longrightarrow> restrict_char H (?x2 \<otimes>\<^bsub>Characters G\<^esub> ?y2) = restrict_char H ?x2 \<otimes>\<^bsub>Characters (G\<lparr>carrier := H\<rparr>)\<^esub> restrict_char H ?y2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
group_hom (Characters G) (Characters (G\<lparr>carrier := H\<rparr>)) (restrict_char H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) inv_solve_right':
  "\<lbrakk>a \<in> carrier G; b \<in> carrier G; c \<in> carrier G\<rbrakk> \<Longrightarrow> b \<otimes> inv c = a \<longleftrightarrow> b = a \<otimes> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; b \<in> carrier G; c \<in> carrier G\<rbrakk> \<Longrightarrow> (b \<otimes> inv c = a) = (b = a \<otimes> c)
[PROOF STEP]
by (auto simp: m_assoc)


[STATEMENT]
lemma r01_r01_to_r01'in01:
  "\<And>n. r01_r01_to_r01' rs n \<in> {0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. r01_r01_to_r01' rs n \<in> {0, 1}
[PROOF STEP]
using real01_binary_expansion'_0or1
[PROOF STATE]
proof (prove)
using this:
r01_binary_expansion' ?r ?n \<in> {0, 1}

goal (1 subgoal):
 1. \<And>n. r01_r01_to_r01' rs n \<in> {0, 1}
[PROOF STEP]
by (simp add: r01_r01_to_r01'_def)


[STATEMENT]
lemma powhr_hlog_cancel [simp]: "\<And>a x. 0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> a powhr (hlog a x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x. \<lbrakk>0 < a; a \<noteq> 1; 0 < x\<rbrakk> \<Longrightarrow> a powhr hlog a x = x
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma (in comm_monoid_add) sum_list_addf:
  "(\<Sum>x\<leftarrow>xs. f x + g x) = sum_list (map f xs) + sum_list (map g xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>xs. f x + g x) = sum_list (map f xs) + sum_list (map g xs)
[PROOF STEP]
by (induct xs) (simp_all add: algebra_simps)


[STATEMENT]
lemma summable_mono_reindex:
  assumes subseq: "strict_mono g"
    and zero: "\<And>n. n \<notin> range g \<Longrightarrow> f n = 0"
  shows "summable (\<lambda>n. f (g n)) \<longleftrightarrow> summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f (g n)) = summable f
[PROOF STEP]
using sums_mono_reindex[of g f, OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>n. n \<notin> range g \<Longrightarrow> n \<notin> range g) \<Longrightarrow> (\<lambda>n. f (g n)) sums ?c = f sums ?c

goal (1 subgoal):
 1. summable (\<lambda>n. f (g n)) = summable f
[PROOF STEP]
by (simp add: summable_def)


[STATEMENT]
theorem product_associativity:
  "(\<exists>w. P w x \<and> P w y \<and> P w z) \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. P w x \<and> P w y \<and> P w z \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>w. P w x \<and> P w y \<and> P w z \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z
[PROOF STEP]
assume ante:"(\<exists>w. P w x \<and> P w y \<and> P w z)"
[PROOF STATE]
proof (state)
this:
\<exists>w. P w x \<and> P w y \<and> P w z

goal (1 subgoal):
 1. \<exists>w. P w x \<and> P w y \<and> P w z \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z
[PROOF STEP]
hence "(\<forall>w. P w (x \<otimes> (y \<otimes> z)) \<longleftrightarrow> P w x \<and> (P w y \<and> P w z))"
[PROOF STATE]
proof (prove)
using this:
\<exists>w. P w x \<and> P w y \<and> P w z

goal (1 subgoal):
 1. \<forall>w. P w (x \<otimes> (y \<otimes> z)) = (P w x \<and> P w y \<and> P w z)
[PROOF STEP]
by (rule right_associated_product)
[PROOF STATE]
proof (state)
this:
\<forall>w. P w (x \<otimes> (y \<otimes> z)) = (P w x \<and> P w y \<and> P w z)

goal (1 subgoal):
 1. \<exists>w. P w x \<and> P w y \<and> P w z \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>w. P w (x \<otimes> (y \<otimes> z)) = (P w x \<and> P w y \<and> P w z)

goal (1 subgoal):
 1. \<exists>w. P w x \<and> P w y \<and> P w z \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z
[PROOF STEP]
from ante
[PROOF STATE]
proof (chain)
picking this:
\<exists>w. P w x \<and> P w y \<and> P w z
[PROOF STEP]
have
    "(\<forall>w. P w ((x \<otimes> y) \<otimes> z) \<longleftrightarrow> (P w x \<and> P w y) \<and> P w z)"
[PROOF STATE]
proof (prove)
using this:
\<exists>w. P w x \<and> P w y \<and> P w z

goal (1 subgoal):
 1. \<forall>w. P w ((x \<otimes> y) \<otimes> z) = ((P w x \<and> P w y) \<and> P w z)
[PROOF STEP]
by (rule left_associated_product)
[PROOF STATE]
proof (state)
this:
\<forall>w. P w ((x \<otimes> y) \<otimes> z) = ((P w x \<and> P w y) \<and> P w z)

goal (1 subgoal):
 1. \<exists>w. P w x \<and> P w y \<and> P w z \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>w. P w (x \<otimes> (y \<otimes> z)) = (P w x \<and> P w y \<and> P w z)
\<forall>w. P w ((x \<otimes> y) \<otimes> z) = ((P w x \<and> P w y) \<and> P w z)
[PROOF STEP]
have "\<forall>w. P w (x \<otimes> (y \<otimes> z)) \<longleftrightarrow> P w ((x \<otimes> y) \<otimes> z)"
[PROOF STATE]
proof (prove)
using this:
\<forall>w. P w (x \<otimes> (y \<otimes> z)) = (P w x \<and> P w y \<and> P w z)
\<forall>w. P w ((x \<otimes> y) \<otimes> z) = ((P w x \<and> P w y) \<and> P w z)

goal (1 subgoal):
 1. \<forall>w. P w (x \<otimes> (y \<otimes> z)) = P w ((x \<otimes> y) \<otimes> z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>w. P w (x \<otimes> (y \<otimes> z)) = P w ((x \<otimes> y) \<otimes> z)

goal (1 subgoal):
 1. \<exists>w. P w x \<and> P w y \<and> P w z \<Longrightarrow> x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z
[PROOF STEP]
with part_extensionality
[PROOF STATE]
proof (chain)
picking this:
(?x = ?y) = (\<forall>z. P z ?x = P z ?y)
\<forall>w. P w (x \<otimes> (y \<otimes> z)) = P w ((x \<otimes> y) \<otimes> z)
[PROOF STEP]
show "x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z"
[PROOF STATE]
proof (prove)
using this:
(?x = ?y) = (\<forall>z. P z ?x = P z ?y)
\<forall>w. P w (x \<otimes> (y \<otimes> z)) = P w ((x \<otimes> y) \<otimes> z)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_pow_mod: "i < \<^bold>|r\<^sup>@k\<^bold>| \<Longrightarrow> (r\<^sup>@k)!i = r!(i mod \<^bold>|r\<^bold>|)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
proof(induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < \<^bold>|r \<^sup>@ 0\<^bold>| \<Longrightarrow> (r \<^sup>@ 0) ! i = r ! (i mod \<^bold>|r\<^bold>|)
 2. \<And>k. \<lbrakk>i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|); i < \<^bold>|r \<^sup>@ Suc k\<^bold>|\<rbrakk> \<Longrightarrow> (r \<^sup>@ Suc k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
have aux:  "\<^bold>|r\<^sup>@(Suc l)\<^bold>| = \<^bold>|r\<^sup>@l\<^bold>| + \<^bold>|r\<^bold>|" for l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>|r \<^sup>@ Suc l\<^bold>| = \<^bold>|r \<^sup>@ l\<^bold>| + \<^bold>|r\<^bold>|
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<^bold>|r \<^sup>@ Suc ?l\<^bold>| = \<^bold>|r \<^sup>@ ?l\<^bold>| + \<^bold>|r\<^bold>|

goal (2 subgoals):
 1. i < \<^bold>|r \<^sup>@ 0\<^bold>| \<Longrightarrow> (r \<^sup>@ 0) ! i = r ! (i mod \<^bold>|r\<^bold>|)
 2. \<And>k. \<lbrakk>i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|); i < \<^bold>|r \<^sup>@ Suc k\<^bold>|\<rbrakk> \<Longrightarrow> (r \<^sup>@ Suc k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
have aux1: "\<^bold>|(r\<^sup>@l)\<^bold>| \<le> i \<Longrightarrow> i < \<^bold>|r\<^sup>@l\<^bold>| + \<^bold>|r\<^bold>| \<Longrightarrow>  i mod \<^bold>|r\<^bold>| = i -  \<^bold>|r\<^sup>@l\<^bold>|" for l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<^bold>|r \<^sup>@ l\<^bold>| \<le> i; i < \<^bold>|r \<^sup>@ l\<^bold>| + \<^bold>|r\<^bold>|\<rbrakk> \<Longrightarrow> i mod \<^bold>|r\<^bold>| = i - \<^bold>|r \<^sup>@ l\<^bold>|
[PROOF STEP]
unfolding pow_len[of r l]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l * \<^bold>|r\<^bold>| \<le> i; i < l * \<^bold>|r\<^bold>| + \<^bold>|r\<^bold>|\<rbrakk> \<Longrightarrow> i mod \<^bold>|r\<^bold>| = i - l * \<^bold>|r\<^bold>|
[PROOF STEP]
using less_diff_conv2[of "l * \<^bold>|r\<^bold>|" i "\<^bold>|r\<^bold>|", unfolded add.commute[of "\<^bold>|r\<^bold>|"  "l * \<^bold>|r\<^bold>|"]]
      get_mod[of "i - l * \<^bold>|r\<^bold>|" "\<^bold>|r\<^bold>|" l] le_add_diff_inverse[of "l*\<^bold>|r\<^bold>|" i]
[PROOF STATE]
proof (prove)
using this:
l * \<^bold>|r\<^bold>| \<le> i \<Longrightarrow> (i - l * \<^bold>|r\<^bold>| < \<^bold>|r\<^bold>|) = (i < l * \<^bold>|r\<^bold>| + \<^bold>|r\<^bold>|)
i - l * \<^bold>|r\<^bold>| < \<^bold>|r\<^bold>| \<Longrightarrow> i - l * \<^bold>|r\<^bold>| = (l * \<^bold>|r\<^bold>| + (i - l * \<^bold>|r\<^bold>|)) mod \<^bold>|r\<^bold>|
l * \<^bold>|r\<^bold>| \<le> i \<Longrightarrow> l * \<^bold>|r\<^bold>| + (i - l * \<^bold>|r\<^bold>|) = i

goal (1 subgoal):
 1. \<lbrakk>l * \<^bold>|r\<^bold>| \<le> i; i < l * \<^bold>|r\<^bold>| + \<^bold>|r\<^bold>|\<rbrakk> \<Longrightarrow> i mod \<^bold>|r\<^bold>| = i - l * \<^bold>|r\<^bold>|
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<^bold>|r \<^sup>@ ?l\<^bold>| \<le> i; i < \<^bold>|r \<^sup>@ ?l\<^bold>| + \<^bold>|r\<^bold>|\<rbrakk> \<Longrightarrow> i mod \<^bold>|r\<^bold>| = i - \<^bold>|r \<^sup>@ ?l\<^bold>|

goal (2 subgoals):
 1. i < \<^bold>|r \<^sup>@ 0\<^bold>| \<Longrightarrow> (r \<^sup>@ 0) ! i = r ! (i mod \<^bold>|r\<^bold>|)
 2. \<And>k. \<lbrakk>i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|); i < \<^bold>|r \<^sup>@ Suc k\<^bold>|\<rbrakk> \<Longrightarrow> (r \<^sup>@ Suc k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
i < \<^bold>|r \<^sup>@ Suc k\<^bold>|

goal (2 subgoals):
 1. i < \<^bold>|r \<^sup>@ 0\<^bold>| \<Longrightarrow> (r \<^sup>@ 0) ! i = r ! (i mod \<^bold>|r\<^bold>|)
 2. \<And>k. \<lbrakk>i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|); i < \<^bold>|r \<^sup>@ Suc k\<^bold>|\<rbrakk> \<Longrightarrow> (r \<^sup>@ Suc k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r \<^sup>@ Suc k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
unfolding aux sym[OF pow_Suc2[symmetric]] nth_append le_mod_geq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < \<^bold>|r \<^sup>@ k\<^bold>| then (r \<^sup>@ k) ! i else r ! (i - \<^bold>|r \<^sup>@ k\<^bold>|)) = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
using aux1[ OF _ Suc.prems[unfolded aux]]
      Suc.IH pow_Suc2[symmetric] Suc.prems[unfolded aux] leI[of i "\<^bold>|r \<^sup>@ k\<^bold>|"]
[PROOF STATE]
proof (prove)
using this:
\<^bold>|r \<^sup>@ k\<^bold>| \<le> i \<Longrightarrow> i mod \<^bold>|r\<^bold>| = i - \<^bold>|r \<^sup>@ k\<^bold>|
i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> (r \<^sup>@ k) ! i = r ! (i mod \<^bold>|r\<^bold>|)
?a \<^sup>@ ?n \<cdot> ?a = ?a \<^sup>@ Suc ?n
i < \<^bold>|r \<^sup>@ k\<^bold>| + \<^bold>|r\<^bold>|
\<not> i < \<^bold>|r \<^sup>@ k\<^bold>| \<Longrightarrow> \<^bold>|r \<^sup>@ k\<^bold>| \<le> i

goal (1 subgoal):
 1. (if i < \<^bold>|r \<^sup>@ k\<^bold>| then (r \<^sup>@ k) ! i else r ! (i - \<^bold>|r \<^sup>@ k\<^bold>|)) = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(r \<^sup>@ Suc k) ! i = r ! (i mod \<^bold>|r\<^bold>|)

goal (1 subgoal):
 1. i < \<^bold>|r \<^sup>@ 0\<^bold>| \<Longrightarrow> (r \<^sup>@ 0) ! i = r ! (i mod \<^bold>|r\<^bold>|)
[PROOF STEP]
qed auto


[STATEMENT]
lemma power_pos:
  assumes a0: "0 < a" shows "0 < a ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < a ^ n
[PROOF STEP]
by (induct n, insert mult_strict_mono[OF a0] a0, auto)