[STATEMENT]
lemma mat_distl: "f \<otimes> (g \<oplus> h) = (f \<otimes> g) \<oplus> (f \<otimes> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
have "(f \<otimes> (g \<oplus> h)) i j  = \<Sum>{f i k \<cdot> (g k j + h k j) |k. k \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<otimes> g \<oplus> h) i j = \<Sum> {f i k \<cdot> (g k j + h k j) |k. k \<in> UNIV}
[PROOF STEP]
by (simp only: mat_mult_def mat_add_def)
[PROOF STATE]
proof (state)
this:
(f \<otimes> g \<oplus> h) i j = \<Sum> {f i k \<cdot> (g k j + h k j) |k. k \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<otimes> g \<oplus> h) i j = \<Sum> {f i k \<cdot> (g k j + h k j) |k. k \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
have "... = \<Sum>{f i k \<cdot> g k j + f i k \<cdot> h k j |k. k \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {f i k \<cdot> (g k j + h k j) |k. k \<in> UNIV} = \<Sum> {f i k \<cdot> g k j + f i k \<cdot> h k j |k. k \<in> UNIV}
[PROOF STEP]
by (simp only: distrib_left)
[PROOF STATE]
proof (state)
this:
\<Sum> {f i k \<cdot> (g k j + h k j) |k. k \<in> UNIV} = \<Sum> {f i k \<cdot> g k j + f i k \<cdot> h k j |k. k \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum> {f i k \<cdot> (g k j + h k j) |k. k \<in> UNIV} = \<Sum> {f i k \<cdot> g k j + f i k \<cdot> h k j |k. k \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
have "... = \<Sum>{f i k \<cdot> g k j |k. k \<in> UNIV} + \<Sum>{f i k \<cdot> h k j |k. k \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {f i k \<cdot> g k j + f i k \<cdot> h k j |k. k \<in> UNIV} = \<Sum> {f i k \<cdot> g k j |k. k \<in> UNIV} + \<Sum> {f i k \<cdot> h k j |k. k \<in> UNIV}
[PROOF STEP]
by (simp only: fset_to_im sum_fun_sum finite_UNIV)
[PROOF STATE]
proof (state)
this:
\<Sum> {f i k \<cdot> g k j + f i k \<cdot> h k j |k. k \<in> UNIV} = \<Sum> {f i k \<cdot> g k j |k. k \<in> UNIV} + \<Sum> {f i k \<cdot> h k j |k. k \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<otimes> g \<oplus> h) i j = \<Sum> {f i k \<cdot> g k j |k. k \<in> UNIV} + \<Sum> {f i k \<cdot> h k j |k. k \<in> UNIV}
[PROOF STEP]
have "(f \<otimes> (g \<oplus> h)) i j  = ((f \<otimes> g) \<oplus> (f \<otimes> h)) i j"
[PROOF STATE]
proof (prove)
using this:
(f \<otimes> g \<oplus> h) i j = \<Sum> {f i k \<cdot> g k j |k. k \<in> UNIV} + \<Sum> {f i k \<cdot> h k j |k. k \<in> UNIV}

goal (1 subgoal):
 1. (f \<otimes> g \<oplus> h) i j = ((f \<otimes> g) \<oplus> (f \<otimes> h)) i j
[PROOF STEP]
by (simp only: mat_mult_def mat_add_def)
[PROOF STATE]
proof (state)
this:
(f \<otimes> g \<oplus> h) i j = ((f \<otimes> g) \<oplus> (f \<otimes> h)) i j

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(f \<otimes> g \<oplus> h) ?i2 ?j2 = ((f \<otimes> g) \<oplus> (f \<otimes> h)) ?i2 ?j2

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<otimes> g \<oplus> h) ?i2 ?j2 = ((f \<otimes> g) \<oplus> (f \<otimes> h)) ?i2 ?j2

goal (1 subgoal):
 1. f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<otimes> g \<oplus> h = (f \<otimes> g) \<oplus> (f \<otimes> h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_poly_inverse[simp]: "coeff p 0 \<noteq> 0 \<Longrightarrow> degree (poly_inverse p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p 0 \<noteq> 0 \<Longrightarrow> degree (poly_inverse p) = degree p
[PROOF STEP]
unfolding poly_inverse_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p 0 \<noteq> 0 \<Longrightarrow> degree (abs_int_poly (reflect_poly p)) = degree p
[PROOF STEP]
by auto


[STATEMENT]
lemma SA_funs_to_SA_decomp_finite:
  assumes "finite Fs"
  assumes "Fs \<subseteq> carrier (SA n)"
  assumes "is_semialgebraic n S"
  shows "finite (SA_funs_to_SA_decomp n Fs S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (SA_funs_to_SA_decomp n Fs S)
[PROOF STEP]
unfolding SA_funs_to_SA_decomp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (atoms_of ((\<inter>) S ` (SA_zero_set n ` Fs \<union> SA_nonzero_set n ` Fs)))
[PROOF STEP]
apply(rule finite_set_imp_finite_atoms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<inter>) S ` (SA_zero_set n ` Fs \<union> SA_nonzero_set n ` Fs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite Fs
Fs \<subseteq> carrier (SA n)
is_semialgebraic n S

goal (1 subgoal):
 1. finite ((\<inter>) S ` (SA_zero_set n ` Fs \<union> SA_nonzero_set n ` Fs))
[PROOF STEP]
by blast


[STATEMENT]
lemma (in residues) totient_eq:
  "totient (nat m) = card (Units R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (nat m) = card (Units R)
[PROOF STEP]
proof  -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. totient (nat m) = card (Units R)
[PROOF STEP]
have *: "inj_on nat (Units R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on nat (Units R)
[PROOF STEP]
by (rule inj_onI) (auto simp add: res_units_eq)
[PROOF STATE]
proof (state)
this:
inj_on nat (Units R)

goal (1 subgoal):
 1. totient (nat m) = card (Units R)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on nat (Units R)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on nat (Units R)

goal (1 subgoal):
 1. totient (nat m) = card (Units R)
[PROOF STEP]
by (simp add: totient_def totatives_eq card_image)
[PROOF STATE]
proof (state)
this:
totient (nat m) = card (Units R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma INFM_minus[simp]: "(\<exists>\<^sub>\<infinity> i. P (i - n :: nat)) \<longleftrightarrow> (\<exists>\<^sub>\<infinity> i. P i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<exists>\<^sub>\<infinity>i. P (i - 0)) = (\<exists>\<^sub>\<infinity>i. P i)
 2. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<exists>\<^sub>\<infinity>i. P (i - 0)) = (\<exists>\<^sub>\<infinity>i. P i)
 2. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (i - 0)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (i - 0)) = (\<exists>\<^sub>\<infinity>i. P i)

goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i)

goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
have "(\<exists>\<^sub>\<infinity> i. P (i - Suc n)) \<longleftrightarrow> (\<exists>\<^sub>\<infinity> i. P (Suc i - Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P (Suc i - Suc n))
[PROOF STEP]
using INFM_Suc
[PROOF STATE]
proof (prove)
using this:
(\<exists>\<^sub>\<infinity>i. ?P (Suc i)) = (\<exists>\<^sub>\<infinity>i. ?P i)

goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P (Suc i - Suc n))
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P (Suc i - Suc n))

goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P (Suc i - Suc n))

goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<exists>\<^sub>\<infinity> i. P (i - n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (Suc i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P (i - n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (Suc i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P (i - n))

goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (Suc i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P (i - n))

goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<exists>\<^sub>\<infinity> i. P i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i)

goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i)

goal (1 subgoal):
 1. \<And>n. (\<exists>\<^sub>\<infinity>i. P (i - n)) = (\<exists>\<^sub>\<infinity>i. P i) \<Longrightarrow> (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)

goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
(\<exists>\<^sub>\<infinity>i. P (i - Suc n)) = (\<exists>\<^sub>\<infinity>i. P i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma downset_Sup_pres: "\<down> (\<Squnion>X) = (\<down> \<circ> Sup) (\<Union> (\<down> ` (X::'a::quantale set)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<down> (\<Squnion> X) = (\<down> \<circ> Sup) (\<Union> (\<down> ` X))
[PROOF STEP]
by (metis downset_Sup_pres_var downset_set_prop_var)


[STATEMENT]
lemma sint_lt: "sint x < 2 ^ (LENGTH('a) - 1)"
  for x :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sint x < 2 ^ (LENGTH('a) - 1)
[PROOF STEP]
using sint_less [of x]
[PROOF STATE]
proof (prove)
using this:
sint x < 2 ^ (LENGTH('a) - Suc 0)

goal (1 subgoal):
 1. sint x < 2 ^ (LENGTH('a) - 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma split_if: "split ks ps = (qs, ks', ps') \<Longrightarrow>
  ks = qs @ ks' \<and> ps = qs @ ps' \<and> (ks' \<noteq> [] \<and> ps' \<noteq> [] \<longrightarrow> hd ks' \<noteq> hd ps')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split ks ps = (qs, ks', ps') \<Longrightarrow> ks = qs @ ks' \<and> ps = qs @ ps' \<and> (ks' \<noteq> [] \<and> ps' \<noteq> [] \<longrightarrow> hd ks' \<noteq> hd ps')
[PROOF STEP]
apply(induction ks ps arbitrary: qs ks' ps' rule: split.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ys qs ks' ps'. split [] ys = (qs, ks', ps') \<Longrightarrow> [] = qs @ ks' \<and> ys = qs @ ps' \<and> (ks' \<noteq> [] \<and> ps' \<noteq> [] \<longrightarrow> hd ks' \<noteq> hd ps')
 2. \<And>v va qs ks' ps'. split (v # va) [] = (qs, ks', ps') \<Longrightarrow> v # va = qs @ ks' \<and> [] = qs @ ps' \<and> (ks' \<noteq> [] \<and> ps' \<noteq> [] \<longrightarrow> hd ks' \<noteq> hd ps')
 3. \<And>x xs y ys qs ks' ps'. \<lbrakk>\<And>qs ks' ps'. \<lbrakk>\<not> x \<noteq> y; split xs ys = (qs, ks', ps')\<rbrakk> \<Longrightarrow> xs = qs @ ks' \<and> ys = qs @ ps' \<and> (ks' \<noteq> [] \<and> ps' \<noteq> [] \<longrightarrow> hd ks' \<noteq> hd ps'); split (x # xs) (y # ys) = (qs, ks', ps')\<rbrakk> \<Longrightarrow> x # xs = qs @ ks' \<and> y # ys = qs @ ps' \<and> (ks' \<noteq> [] \<and> ps' \<noteq> [] \<longrightarrow> hd ks' \<noteq> hd ps')
[PROOF STEP]
apply(auto split: prod.splits if_splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma same_util_is_equal_or_more_expensive:
  assumes "i \<in> agents"
  assumes "local_nonsatiation consumption_set Pr[i]"
  assumes "x \<in> arg_max_set U[i] (budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i]))"
  assumes "U[i] y \<ge> U[i] x"
  shows "y \<bullet> P \<ge> P \<bullet> \<E>[i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> \<E>[i] \<le> y \<bullet> P
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<bullet> \<E>[i] \<le> y \<bullet> P
[PROOF STEP]
have not_in: "y \<notin> arg_max_set U[i] (budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i]))
    \<Longrightarrow> y \<bullet> P > P \<bullet> \<E>[i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])) \<Longrightarrow> P \<bullet> \<E>[i] < y \<bullet> P
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])) \<Longrightarrow> P \<bullet> \<E>[i] < y \<bullet> P
[PROOF STEP]
assume "y \<notin> arg_max_set U[i] (budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i]))"
[PROOF STATE]
proof (state)
this:
y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))

goal (1 subgoal):
 1. y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])) \<Longrightarrow> P \<bullet> \<E>[i] < y \<bullet> P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))
[PROOF STEP]
have "y \<notin> budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i])"
[PROOF STATE]
proof (prove)
using this:
y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))

goal (1 subgoal):
 1. y \<notin> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
by (meson assms leq_all_in_sol assms)
[PROOF STATE]
proof (state)
this:
y \<notin> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])) \<Longrightarrow> P \<bullet> \<E>[i] < y \<bullet> P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<notin> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<notin> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. P \<bullet> \<E>[i] < y \<bullet> P
[PROOF STEP]
by (simp add: budget_constraint_def inner_commute
          consumption_set_member)
[PROOF STATE]
proof (state)
this:
P \<bullet> \<E>[i] < y \<bullet> P

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])) \<Longrightarrow> P \<bullet> \<E>[i] < y \<bullet> P

goal (1 subgoal):
 1. P \<bullet> \<E>[i] \<le> y \<bullet> P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> \<E>[i] \<le> y \<bullet> P
[PROOF STEP]
by (metis argmax_entire_budget not_in assms(1,2,3)
        dual_order.order_iff_strict inner_commute)
[PROOF STATE]
proof (state)
this:
P \<bullet> \<E>[i] \<le> y \<bullet> P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ln_times:
  assumes "w \<noteq> 0" "z \<noteq> 0"
    shows "Ln(w * z) =
           (if Im(Ln w + Ln z) \<le> -pi then (Ln(w) + Ln(z)) + \<i> * of_real(2*pi)
            else if Im(Ln w + Ln z) > pi then (Ln(w) + Ln(z)) - \<i> * of_real(2*pi)
            else Ln(w) + Ln(z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ln (w * z) = (if Im (Ln w + Ln z) \<le> - pi then Ln w + Ln z + \<i> * complex_of_real (2 * pi) else if pi < Im (Ln w + Ln z) then Ln w + Ln z - \<i> * complex_of_real (2 * pi) else Ln w + Ln z)
[PROOF STEP]
using pi_ge_zero Im_Ln_le_pi [of w] Im_Ln_le_pi [of z]
[PROOF STATE]
proof (prove)
using this:
0 \<le> pi
w \<noteq> 0 \<Longrightarrow> Im (Ln w) \<le> pi
z \<noteq> 0 \<Longrightarrow> Im (Ln z) \<le> pi

goal (1 subgoal):
 1. Ln (w * z) = (if Im (Ln w + Ln z) \<le> - pi then Ln w + Ln z + \<i> * complex_of_real (2 * pi) else if pi < Im (Ln w + Ln z) then Ln w + Ln z - \<i> * complex_of_real (2 * pi) else Ln w + Ln z)
[PROOF STEP]
using assms mpi_less_Im_Ln [of w] mpi_less_Im_Ln [of z]
[PROOF STATE]
proof (prove)
using this:
0 \<le> pi
w \<noteq> 0 \<Longrightarrow> Im (Ln w) \<le> pi
z \<noteq> 0 \<Longrightarrow> Im (Ln z) \<le> pi
w \<noteq> 0
z \<noteq> 0
w \<noteq> 0 \<Longrightarrow> - pi < Im (Ln w)
z \<noteq> 0 \<Longrightarrow> - pi < Im (Ln z)

goal (1 subgoal):
 1. Ln (w * z) = (if Im (Ln w + Ln z) \<le> - pi then Ln w + Ln z + \<i> * complex_of_real (2 * pi) else if pi < Im (Ln w + Ln z) then Ln w + Ln z - \<i> * complex_of_real (2 * pi) else Ln w + Ln z)
[PROOF STEP]
by (auto simp: exp_add exp_diff sin_double cos_double exp_Euler intro!: Ln_unique)


[STATEMENT]
lemma val_of_frac:
  assumes "a \<in> carrier Z\<^sub>p"
  assumes "b \<in> nonzero Z\<^sub>p"
  shows "val (frac a b) = (val_Zp a) - (val_Zp b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
proof(cases "a = \<zero>\<^bsub>Z\<^sub>p\<^esub>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
 2. a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = \<zero>\<^bsub>Z\<^sub>p\<^esub>

goal (2 subgoals):
 1. a = \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
 2. a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = \<zero>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = \<zero>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
using assms(1) assms(2)  local.val_zero
[PROOF STATE]
proof (prove)
using this:
a = \<zero>\<^bsub>Z\<^sub>p\<^esub>
a \<in> carrier Z\<^sub>p
b \<in> nonzero Z\<^sub>p
val \<zero> = \<infinity>

goal (1 subgoal):
 1. val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
by (simp add: Q\<^sub>p_def val_Zp_def)
[PROOF STATE]
proof (state)
this:
val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
have "a \<in> nonzero Z\<^sub>p"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. a \<in> nonzero Z\<^sub>p
[PROOF STEP]
by (simp add: assms(1) nonzero_def)
[PROOF STATE]
proof (state)
this:
a \<in> nonzero Z\<^sub>p

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> nonzero Z\<^sub>p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Z\<^sub>p

goal (1 subgoal):
 1. val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
using ord_of_frac[of a b] assms(2)  val_def val_ord_Zp
          nonzero_numer_imp_nonzero_fraction
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Z\<^sub>p
\<lbrakk>a \<in> nonzero Z\<^sub>p; b \<in> nonzero Z\<^sub>p\<rbrakk> \<Longrightarrow> ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
b \<in> nonzero Z\<^sub>p
val ?x = (if ?x = \<zero> then \<infinity> else eint (ord ?x))
?a \<noteq> \<zero>\<^bsub>Z\<^sub>p\<^esub> \<Longrightarrow> val_Zp ?a = eint (ord_Zp ?a)
\<lbrakk>?a \<in> nonzero Z\<^sub>p; ?b \<in> nonzero Z\<^sub>p\<rbrakk> \<Longrightarrow> fraction Z\<^sub>p ?a ?b \<noteq> \<zero>

goal (1 subgoal):
 1. val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b
[PROOF STEP]
by (simp add: Zp.nonzero_memE(2))
[PROOF STATE]
proof (state)
this:
val (fraction Z\<^sub>p a b) = val_Zp a - val_Zp b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cong_trans [trans]:
  "[b = c] (mod a) \<Longrightarrow> [c = d] (mod a) \<Longrightarrow> [b = d] (mod a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[b = c] (mod a); [c = d] (mod a)\<rbrakk> \<Longrightarrow> [b = d] (mod a)
[PROOF STEP]
by (simp add: cong_def)


[STATEMENT]
lemma sum_interval_cong:
  "\<lbrakk> \<And> i. \<lbrakk> m \<le> i; i \<le> n \<rbrakk> \<Longrightarrow> P(i) = Q(i) \<rbrakk> \<Longrightarrow> (\<Sum>i=m..n. P(i)) = (\<Sum>i=m..n. Q(i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. \<lbrakk>m \<le> i; i \<le> n\<rbrakk> \<Longrightarrow> P i = Q i) \<Longrightarrow> sum P {m..n} = sum Q {m..n}
[PROOF STEP]
by (auto intro: sum.cong)


[STATEMENT]
lemma lower0: "(lowerPoly i j 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lowerPoly i j 0 = 0
[PROOF STEP]
by (simp add: coeff_all_0 coeff_lowerPoly)


[STATEMENT]
lemma invariant_JoinI:
     "[| F \<in> invariant A; G \<in> invariant A |]
      ==> F\<squnion>G \<in> invariant A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> invariant A; G \<in> invariant A\<rbrakk> \<Longrightarrow> F \<squnion> G \<in> invariant A
[PROOF STEP]
by (auto simp add: invariant_def)


[STATEMENT]
lemma isCont_exp: "isCont exp x"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont exp x
[PROOF STEP]
by (rule DERIV_exp [THEN DERIV_isCont])


[STATEMENT]
lemma integrable_Beta:
  assumes "a > 0" "b > (0::real)"
  shows   "set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
define C where "C = max 1 ((1/2) powr (b - 1))"
[PROOF STATE]
proof (state)
this:
C = max 1 ((1 / 2) powr (b - 1))

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
define D where "D = max 1 ((1/2) powr (a - 1))"
[PROOF STATE]
proof (state)
this:
D = max 1 ((1 / 2) powr (a - 1))

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
have C: "(1 - x) powr (b - 1) \<le> C" if "x \<in> {0..1/2}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - x) powr (b - 1) \<le> C
[PROOF STEP]
proof (cases "b < 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b < 1 \<Longrightarrow> (1 - x) powr (b - 1) \<le> C
 2. \<not> b < 1 \<Longrightarrow> (1 - x) powr (b - 1) \<le> C
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> b < 1

goal (2 subgoals):
 1. b < 1 \<Longrightarrow> (1 - x) powr (b - 1) \<le> C
 2. \<not> b < 1 \<Longrightarrow> (1 - x) powr (b - 1) \<le> C
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
x \<in> {0..1 / 2}
\<not> b < 1
[PROOF STEP]
have "(1 - x) powr (b - 1) \<le> (1 powr (b - 1))"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..1 / 2}
\<not> b < 1

goal (1 subgoal):
 1. (1 - x) powr (b - 1) \<le> 1 powr (b - 1)
[PROOF STEP]
by (intro powr_mono2) auto
[PROOF STATE]
proof (state)
this:
(1 - x) powr (b - 1) \<le> 1 powr (b - 1)

goal (2 subgoals):
 1. b < 1 \<Longrightarrow> (1 - x) powr (b - 1) \<le> C
 2. \<not> b < 1 \<Longrightarrow> (1 - x) powr (b - 1) \<le> C
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 - x) powr (b - 1) \<le> 1 powr (b - 1)

goal (1 subgoal):
 1. (1 - x) powr (b - 1) \<le> C
[PROOF STEP]
by (auto simp: C_def)
[PROOF STATE]
proof (state)
this:
(1 - x) powr (b - 1) \<le> C

goal (1 subgoal):
 1. b < 1 \<Longrightarrow> (1 - x) powr (b - 1) \<le> C
[PROOF STEP]
qed (insert that, auto simp: max.coboundedI1 max.coboundedI2 powr_mono2' powr_mono2 C_def)
[PROOF STATE]
proof (state)
this:
?x \<in> {0..1 / 2} \<Longrightarrow> (1 - ?x) powr (b - 1) \<le> C

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
have D: "x powr (a - 1) \<le> D" if "x \<in> {1/2..1}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr (a - 1) \<le> D
[PROOF STEP]
proof (cases "a < 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
 2. \<not> a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> a < 1

goal (2 subgoals):
 1. a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
 2. \<not> a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
x \<in> {1 / 2..1}
\<not> a < 1
[PROOF STEP]
have "x powr (a - 1) \<le> (1 powr (a - 1))"
[PROOF STATE]
proof (prove)
using this:
x \<in> {1 / 2..1}
\<not> a < 1

goal (1 subgoal):
 1. x powr (a - 1) \<le> 1 powr (a - 1)
[PROOF STEP]
by (intro powr_mono2) auto
[PROOF STATE]
proof (state)
this:
x powr (a - 1) \<le> 1 powr (a - 1)

goal (2 subgoals):
 1. a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
 2. \<not> a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x powr (a - 1) \<le> 1 powr (a - 1)

goal (1 subgoal):
 1. x powr (a - 1) \<le> D
[PROOF STEP]
by (auto simp: D_def)
[PROOF STATE]
proof (state)
this:
x powr (a - 1) \<le> D

goal (1 subgoal):
 1. a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a < 1

goal (1 subgoal):
 1. a < 1 \<Longrightarrow> x powr (a - 1) \<le> D
[PROOF STEP]
qed (insert that, auto simp: max.coboundedI1 max.coboundedI2 powr_mono2' powr_mono2 D_def)
[PROOF STATE]
proof (state)
this:
?x \<in> {1 / 2..1} \<Longrightarrow> ?x powr (a - 1) \<le> D

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
have [simp]: "C \<ge> 0" "D \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> C &&& 0 \<le> D
[PROOF STEP]
by (simp_all add: C_def D_def)
[PROOF STATE]
proof (state)
this:
0 \<le> C
0 \<le> D

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
have I1: "set_integrable lborel {0..1/2} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {0..1 / 2} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1)))
[PROOF STEP]
proof (rule Bochner_Integration.integrable_bound[OF _ _ AE_I2])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
have "(\<lambda>t. t powr (a - 1)) integrable_on {0..1/2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. t powr (a - 1)) integrable_on {0..1 / 2}
[PROOF STEP]
by (rule integrable_on_powr_from_0) (use assms in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t powr (a - 1)) integrable_on {0..1 / 2}

goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
hence "(\<lambda>t. t powr (a - 1)) absolutely_integrable_on {0..1/2}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>t. t powr (a - 1)) integrable_on {0..1 / 2}

goal (1 subgoal):
 1. (\<lambda>t. t powr (a - 1)) absolutely_integrable_on {0..1 / 2}
[PROOF STEP]
by (subst absolutely_integrable_on_iff_nonneg) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t powr (a - 1)) absolutely_integrable_on {0..1 / 2}

goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
from integrable_mult_right[OF this [unfolded set_integrable_def], of C]
[PROOF STATE]
proof (chain)
picking this:
integrable lebesgue (\<lambda>x. C * indicat_real {0..1 / 2} x *\<^sub>R x powr (a - 1))
[PROOF STEP]
show "integrable lborel (\<lambda>x. indicat_real {0..1/2} x *\<^sub>R (C * x powr (a - 1)))"
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue (\<lambda>x. C * indicat_real {0..1 / 2} x *\<^sub>R x powr (a - 1))

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))
[PROOF STEP]
by (subst (asm) integrable_completion) (auto simp: mult_ac)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))

goal (2 subgoals):
 1. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))
[PROOF STEP]
have "x powr (a - 1) * (1 - x) powr (b - 1) \<le> x powr (a - 1) * C" if "x \<in> {0..1/2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr (a - 1) * (1 - x) powr (b - 1) \<le> x powr (a - 1) * C
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..1 / 2}

goal (1 subgoal):
 1. x powr (a - 1) * (1 - x) powr (b - 1) \<le> x powr (a - 1) * C
[PROOF STEP]
by (intro mult_left_mono powr_mono2 C) auto
[PROOF STATE]
proof (state)
this:
x \<in> {0..1 / 2} \<Longrightarrow> x powr (a - 1) * (1 - x) powr (b - 1) \<le> x powr (a - 1) * C

goal (2 subgoals):
 1. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))
[PROOF STEP]
thus "norm (indicator {0..1/2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le>
            norm (indicator {0..1/2} x *\<^sub>R (C * x powr (a - 1)))"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..1 / 2} \<Longrightarrow> x powr (a - 1) * (1 - x) powr (b - 1) \<le> x powr (a - 1) * C

goal (1 subgoal):
 1. norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))
[PROOF STEP]
by (auto simp: indicator_def abs_mult mult_ac)
[PROOF STATE]
proof (state)
this:
norm (indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {0..1 / 2} x *\<^sub>R (C * x powr (a - 1)))

goal (1 subgoal):
 1. (\<lambda>x. indicat_real {0..1 / 2} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
[PROOF STEP]
qed (auto intro!: AE_I2 simp: indicator_def)
[PROOF STATE]
proof (state)
this:
set_integrable lborel {0..1 / 2} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
have I2: "set_integrable lborel {1/2..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {1 / 2..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1)))
[PROOF STEP]
proof (rule Bochner_Integration.integrable_bound[OF _ _ AE_I2])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
have "(\<lambda>t. t powr (b - 1)) integrable_on {0..1/2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. t powr (b - 1)) integrable_on {0..1 / 2}
[PROOF STEP]
by (rule integrable_on_powr_from_0) (use assms in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t powr (b - 1)) integrable_on {0..1 / 2}

goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
hence "(\<lambda>t. t powr (b - 1)) integrable_on (cbox 0 (1/2))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>t. t powr (b - 1)) integrable_on {0..1 / 2}

goal (1 subgoal):
 1. (\<lambda>t. t powr (b - 1)) integrable_on cbox 0 (1 / 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>t. t powr (b - 1)) integrable_on cbox 0 (1 / 2)

goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
from integrable_affinity[OF this, of "-1" 1]
[PROOF STATE]
proof (chain)
picking this:
- 1 \<noteq> 0 \<Longrightarrow> (\<lambda>x. (- 1 *\<^sub>R x + 1) powr (b - 1)) integrable_on (\<lambda>x. (1 / - 1) *\<^sub>R x + - ((1 / - 1) *\<^sub>R 1)) ` cbox 0 (1 / 2)
[PROOF STEP]
have "(\<lambda>t. (1 - t) powr (b - 1)) integrable_on {1/2..1}"
[PROOF STATE]
proof (prove)
using this:
- 1 \<noteq> 0 \<Longrightarrow> (\<lambda>x. (- 1 *\<^sub>R x + 1) powr (b - 1)) integrable_on (\<lambda>x. (1 / - 1) *\<^sub>R x + - ((1 / - 1) *\<^sub>R 1)) ` cbox 0 (1 / 2)

goal (1 subgoal):
 1. (\<lambda>t. (1 - t) powr (b - 1)) integrable_on {1 / 2..1}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>t. (1 - t) powr (b - 1)) integrable_on {1 / 2..1}

goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
hence "(\<lambda>t. (1 - t) powr (b - 1)) absolutely_integrable_on {1/2..1}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>t. (1 - t) powr (b - 1)) integrable_on {1 / 2..1}

goal (1 subgoal):
 1. (\<lambda>t. (1 - t) powr (b - 1)) absolutely_integrable_on {1 / 2..1}
[PROOF STEP]
by (subst absolutely_integrable_on_iff_nonneg) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. (1 - t) powr (b - 1)) absolutely_integrable_on {1 / 2..1}

goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 3. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (?f x)
[PROOF STEP]
from integrable_mult_right[OF this [unfolded set_integrable_def], of D]
[PROOF STATE]
proof (chain)
picking this:
integrable lebesgue (\<lambda>x. D * indicat_real {1 / 2..1} x *\<^sub>R (1 - x) powr (b - 1))
[PROOF STEP]
show "integrable lborel (\<lambda>x. indicat_real {1/2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))"
[PROOF STATE]
proof (prove)
using this:
integrable lebesgue (\<lambda>x. D * indicat_real {1 / 2..1} x *\<^sub>R (1 - x) powr (b - 1))

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))
[PROOF STEP]
by (subst (asm) integrable_completion) (auto simp: mult_ac)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))

goal (2 subgoals):
 1. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))
[PROOF STEP]
have "x powr (a - 1) * (1 - x) powr (b - 1) \<le> D * (1 - x) powr (b - 1)" if "x \<in> {1/2..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr (a - 1) * (1 - x) powr (b - 1) \<le> D * (1 - x) powr (b - 1)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> {1 / 2..1}

goal (1 subgoal):
 1. x powr (a - 1) * (1 - x) powr (b - 1) \<le> D * (1 - x) powr (b - 1)
[PROOF STEP]
by (intro mult_right_mono powr_mono2 D) auto
[PROOF STATE]
proof (state)
this:
x \<in> {1 / 2..1} \<Longrightarrow> x powr (a - 1) * (1 - x) powr (b - 1) \<le> D * (1 - x) powr (b - 1)

goal (2 subgoals):
 1. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
 2. \<And>x. x \<in> space lborel \<Longrightarrow> norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))
[PROOF STEP]
thus "norm (indicator {1/2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le>
            norm (indicator {1/2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))"
[PROOF STATE]
proof (prove)
using this:
x \<in> {1 / 2..1} \<Longrightarrow> x powr (a - 1) * (1 - x) powr (b - 1) \<le> D * (1 - x) powr (b - 1)

goal (1 subgoal):
 1. norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))
[PROOF STEP]
by (auto simp: indicator_def abs_mult mult_ac)
[PROOF STATE]
proof (state)
this:
norm (indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<le> norm (indicat_real {1 / 2..1} x *\<^sub>R (D * (1 - x) powr (b - 1)))

goal (1 subgoal):
 1. (\<lambda>x. indicat_real {1 / 2..1} x *\<^sub>R (x powr (a - 1) * (1 - x) powr (b - 1))) \<in> borel_measurable lborel
[PROOF STEP]
qed (auto intro!: AE_I2 simp: indicator_def)
[PROOF STATE]
proof (state)
this:
set_integrable lborel {1 / 2..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
have "set_integrable lborel ({0..1/2} \<union> {1/2..1}) (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel ({0..1 / 2} \<union> {1 / 2..1}) (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
by (intro set_integrable_Un I1 I2) auto
[PROOF STATE]
proof (state)
this:
set_integrable lborel ({0..1 / 2} \<union> {1 / 2..1}) (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_integrable lborel ({0..1 / 2} \<union> {1 / 2..1}) (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
have "{0..1/2} \<union> {1/2..1} = {0..(1::real)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..1 / 2} \<union> {1 / 2..1} = {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..1 / 2} \<union> {1 / 2..1} = {0..1}

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))

goal (1 subgoal):
 1. set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
set_integrable lborel {0..1} (\<lambda>t. t powr (a - 1) * (1 - t) powr (b - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ltake_eq_ltake_antimono:
  "\<lbrakk> ltake n xs = ltake n ys; m \<le> n \<rbrakk> \<Longrightarrow> ltake m xs = ltake m ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ltake n xs = ltake n ys; m \<le> n\<rbrakk> \<Longrightarrow> ltake m xs = ltake m ys
[PROOF STEP]
by (metis ltake_ltake min_def)


[STATEMENT]
lemma (in infinite_cts_filtration) borel_Suc_expectation_pseudo_proj:
  fixes f::"bool stream\<Rightarrow> real"
  assumes "f\<in> borel_measurable (F (Suc n))"
  shows "expectation (\<lambda>x. f x * indicator (pseudo_proj_True n -` {pseudo_proj_True n z}) x) =
    prob (pseudo_proj_True n -` {pseudo_proj_True n z}) *
    (p * (f (pseudo_proj_True n z)) + (1-p) * (f (pseudo_proj_False n z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. f x * indicat_real (pseudo_proj_True n -` {pseudo_proj_True n z}) x) = prob (pseudo_proj_True n -` {pseudo_proj_True n z}) * (p * f (pseudo_proj_True n z) + (1 - p) * f (pseudo_proj_False n z))
[PROOF STEP]
proof (rule borel_Suc_expectation)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. f \<in> borel_measurable (F (Suc n))
 2. pseudo_proj_True n \<in> F n \<rightarrow>\<^sub>M ?N
 3. set_discriminating n (pseudo_proj_True n) ?N
 4. pseudo_proj_True n -` {pseudo_proj_True n z} \<in> sets (F n)
 5. \<forall>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<longrightarrow> f y = f z
[PROOF STEP]
show "f \<in> borel_measurable (F (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable (F (Suc n))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (F (Suc n))

goal (1 subgoal):
 1. f \<in> borel_measurable (F (Suc n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (F (Suc n))

goal (4 subgoals):
 1. pseudo_proj_True n \<in> F n \<rightarrow>\<^sub>M ?N
 2. set_discriminating n (pseudo_proj_True n) ?N
 3. pseudo_proj_True n -` {pseudo_proj_True n z} \<in> sets (F n)
 4. \<forall>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<longrightarrow> f y = f z
[PROOF STEP]
show "pseudo_proj_True n \<in> F n \<rightarrow>\<^sub>M M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pseudo_proj_True n \<in> F n \<rightarrow>\<^sub>M M
[PROOF STEP]
by (simp add: nat_filtration_pseudo_proj_True_measurable natural_filtration)
[PROOF STATE]
proof (state)
this:
pseudo_proj_True n \<in> F n \<rightarrow>\<^sub>M M

goal (3 subgoals):
 1. set_discriminating n (pseudo_proj_True n) M
 2. pseudo_proj_True n -` {pseudo_proj_True n z} \<in> sets (F n)
 3. \<forall>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<longrightarrow> f y = f z
[PROOF STEP]
show "pseudo_proj_True n -` {pseudo_proj_True n z} \<in> sets (F n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pseudo_proj_True n -` {pseudo_proj_True n z} \<in> sets (F n)
[PROOF STEP]
by (simp add: nat_filtration_singleton natural_filtration pseudo_proj_True_proj)
[PROOF STATE]
proof (state)
this:
pseudo_proj_True n -` {pseudo_proj_True n z} \<in> sets (F n)

goal (2 subgoals):
 1. set_discriminating n (pseudo_proj_True n) M
 2. \<forall>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<longrightarrow> f y = f z
[PROOF STEP]
show "\<forall>y z. (pseudo_proj_True n y = pseudo_proj_True n z \<and> snth y n = snth z n) \<longrightarrow> f y = f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<longrightarrow> f y = f z
[PROOF STEP]
proof (intro allI impI conjI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<Longrightarrow> f y = f z
[PROOF STEP]
fix y z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<Longrightarrow> f y = f z
[PROOF STEP]
assume "pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n"
[PROOF STATE]
proof (state)
this:
pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n

goal (1 subgoal):
 1. \<And>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<Longrightarrow> f y = f z
[PROOF STEP]
hence "pseudo_proj_True n y = pseudo_proj_True n z" and "snth y n = snth z n"
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n

goal (1 subgoal):
 1. pseudo_proj_True n y = pseudo_proj_True n z &&& y !! n = z !! n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pseudo_proj_True n y = pseudo_proj_True n z
y !! n = z !! n

goal (1 subgoal):
 1. \<And>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<Longrightarrow> f y = f z
[PROOF STEP]
hence "pseudo_proj_True (Suc n) y = pseudo_proj_True (Suc n) z"
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True n y = pseudo_proj_True n z
y !! n = z !! n

goal (1 subgoal):
 1. pseudo_proj_True (Suc n) y = pseudo_proj_True (Suc n) z
[PROOF STEP]
unfolding pseudo_proj_True_def
[PROOF STATE]
proof (prove)
using this:
stake n y @- sconst True = stake n z @- sconst True
y !! n = z !! n

goal (1 subgoal):
 1. stake (Suc n) y @- sconst True = stake (Suc n) z @- sconst True
[PROOF STEP]
by (metis (full_types) \<open>pseudo_proj_True n y = pseudo_proj_True n z\<close> pseudo_proj_True_same_img stake_Suc)
[PROOF STATE]
proof (state)
this:
pseudo_proj_True (Suc n) y = pseudo_proj_True (Suc n) z

goal (1 subgoal):
 1. \<And>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<Longrightarrow> f y = f z
[PROOF STEP]
thus "f y = f z"
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True (Suc n) y = pseudo_proj_True (Suc n) z

goal (1 subgoal):
 1. f y = f z
[PROOF STEP]
using nat_filtration_info assms natural_filtration
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True (Suc n) y = pseudo_proj_True (Suc n) z
?f \<in> borel_measurable (nat_filtration ?n) \<Longrightarrow> ?f \<circ> pseudo_proj_True ?n = ?f
f \<in> borel_measurable (F (Suc n))
F = nat_filtration

goal (1 subgoal):
 1. f y = f z
[PROOF STEP]
by (metis comp_apply)
[PROOF STATE]
proof (state)
this:
f y = f z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y z. pseudo_proj_True n y = pseudo_proj_True n z \<and> y !! n = z !! n \<longrightarrow> f y = f z

goal (1 subgoal):
 1. set_discriminating n (pseudo_proj_True n) M
[PROOF STEP]
show "set_discriminating n (pseudo_proj_True n) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_discriminating n (pseudo_proj_True n) M
[PROOF STEP]
unfolding set_discriminating_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>w. pseudo_proj_True n w \<noteq> pseudo_proj_True n (pseudo_proj_True n w) \<longrightarrow> (\<exists>A\<in>events. (pseudo_proj_True n w \<in> A) = (pseudo_proj_True n (pseudo_proj_True n w) \<notin> A))
[PROOF STEP]
using pseudo_proj_True_proj
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True ?n (pseudo_proj_True ?n ?w) = pseudo_proj_True ?n ?w

goal (1 subgoal):
 1. \<forall>w. pseudo_proj_True n w \<noteq> pseudo_proj_True n (pseudo_proj_True n w) \<longrightarrow> (\<exists>A\<in>events. (pseudo_proj_True n w \<in> A) = (pseudo_proj_True n (pseudo_proj_True n w) \<notin> A))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_discriminating n (pseudo_proj_True n) M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma even_One_int: "even (numeral Num.One :: int) = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even Numeral1 = False
[PROOF STEP]
by simp


[STATEMENT]
lemma "(\<forall>x. f(x) \<longrightarrow>
             (\<exists>y. g(y) \<and> h x y \<and> (\<exists>y. g(y) \<and> ~ h x y)))  \<and>
             (\<exists>x. j(x) \<and> (\<forall>y. g(y) \<longrightarrow> h x y))
             \<longrightarrow> (\<exists>x. j(x) \<and> \<not>f(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. f x \<longrightarrow> (\<exists>y. g y \<and> h x y \<and> (\<exists>y. g y \<and> \<not> h x y))) \<and> (\<exists>x. j x \<and> (\<forall>y. g y \<longrightarrow> h x y)) \<longrightarrow> (\<exists>x. j x \<and> \<not> f x)
[PROOF STEP]
by iprover


[STATEMENT]
lemma count_sum_mset_if_1_0: \<open>count M a = (\<Sum>x\<in>#M. if x = a then 1 else 0)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count M a = (\<Sum>x\<in>#M. if x = a then 1 else 0)
[PROOF STEP]
by (induction M) auto


[STATEMENT]
lemma "pred n = 42 \<Longrightarrow> n = 43"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred n = 42 \<Longrightarrow> n = 43
[PROOF STEP]
by (erule pred42E)


[STATEMENT]
lemma E_2: assumes "\<not> QuadRes p a"
  shows "[a ^ ((p - 1) div 2) = -1] (mod p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a ^ ((p - 1) div 2) = - 1] (mod int p)
[PROOF STEP]
using l9 l12 cong_trans cong_sym assms
[PROOF STATE]
proof (prove)
using this:
[prod Prod S2 = - 1] (mod int p)
\<not> QuadRes (int p) a \<Longrightarrow> [prod Prod S2 = a ^ ((p - 1) div 2)] (mod int p)
\<lbrakk>[?b = ?c] (mod ?a); [?c = ?d] (mod ?a)\<rbrakk> \<Longrightarrow> [?b = ?d] (mod ?a)
[?b = ?c] (mod ?a) \<Longrightarrow> [?c = ?b] (mod ?a)
\<not> QuadRes (int p) a

goal (1 subgoal):
 1. [a ^ ((p - 1) div 2) = - 1] (mod int p)
[PROOF STEP]
by blast


[STATEMENT]
lemma "successive (\<lambda> x. x > (0 :: nat)) [Suc 0, 0, Suc 0, 0, Suc 0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. successive ((<) 0) [Suc 0, 0, Suc 0, 0, Suc 0]
[PROOF STEP]
by simp


[STATEMENT]
lemma forall_1[simp]: "(\<forall>i::num1. P i) \<longleftrightarrow> P 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i. P i) = P 1
[PROOF STEP]
by (metis (full_types) num1_eq_iff)


[STATEMENT]
lemma function_sum_comp_is_seq_sum:
  assumes "s \<in> closed_seqs R"
  assumes "f \<in> carrier (Fun R)"
  assumes "g \<in> carrier (Fun R)"
  shows "(f \<oplus>\<^bsub>Fun R\<^esub> g) \<circ> s = (f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s = (f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)
[PROOF STEP]
apply(rule ring_functions.function_ring_car_eqI[of R _ "UNIV :: nat set"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. ring_functions R
 2. f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s \<in> carrier (function_ring UNIV R)
 3. (f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 4. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
apply (simp add: ring_functions_axioms)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s \<in> carrier (function_ring UNIV R)
 2. (f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 3. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
using function_comp_is_closed_seq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?s \<in> carrier R\<^bsup>\<omega>\<^esup>; ?f \<in> carrier (function_ring (carrier R) R)\<rbrakk> \<Longrightarrow> ?f \<circ> ?s \<in> carrier R\<^bsup>\<omega>\<^esup>

goal (3 subgoals):
 1. f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s \<in> carrier (function_ring UNIV R)
 2. (f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 3. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
apply (metis assms(1) assms(2) assms(3) fun_add_closed nat_seqs_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 2. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
apply (metis assms(1) assms(2) assms(3) function_comp_is_closed_seq nat_seqs_def seq_plus_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<oplus>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<oplus>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
by (smt UNIV_eq_I assms(1) assms(2) assms(3) closed_seqs_memE comp_apply function_comp_is_closed_seq nat_seqs_def ring_functions.fun_add_eval_car ring_functions_axioms)


[STATEMENT]
lemma subs_def2:
"!!gamma.
   ~ SATAxiom (sequent gamma) ==>
   subs gamma = (case nforms gamma of
                     []     => {}
                   | nA#nAs => let (n,A) = nA
                               in  (case A of
                                        FAtom z P vs  => subsFAtom (atoms gamma) nAs z P vs
                                      | FConj z A0 A1 => subsFConj (atoms gamma) nAs z A0 A1
                                      | FAll  z A     => subsFAll  (atoms gamma) nAs n z A (freeVarsFL (sequent gamma))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>gamma. \<not> SATAxiom (sequent gamma) \<Longrightarrow> subs gamma = (case nforms gamma of [] \<Rightarrow> {} | nA # nAs \<Rightarrow> let (n, A) = nA in case A of FAtom z P vs \<Rightarrow> subsFAtom (atoms gamma) nAs z P vs | FConj z A0 A1 \<Rightarrow> subsFConj (atoms gamma) nAs z A0 A1 | FAll z A \<Rightarrow> subsFAll (atoms gamma) nAs n z A (freeVarsFL (sequent gamma)))
[PROOF STEP]
apply(simp add: subs_def Let_def nforms_def atoms_def split_beta split: list.split)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma union_diff_inter_eq_sup:
  "A + B - A \<inter># B = A \<union># B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B - A \<inter># B = A \<union># B
[PROOF STEP]
by (auto simp add: multiset_eq_iff)


[STATEMENT]
lemma asymp_equiv_sandwich'':
  fixes f :: "'a \<Rightarrow> real"
  assumes "\<And>c'. c' \<in> {l<..<1} \<Longrightarrow> eventually (\<lambda>x. f x \<ge> c' * g x) F"
  assumes "\<And>c'. c' \<in> {1<..<u} \<Longrightarrow> eventually (\<lambda>x. f x \<le> c' * g x) F"
  assumes "l < 1" "1 < u"
  shows   "f \<sim>[F] (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<sim>[F] g
[PROOF STEP]
using asymp_equiv_sandwich'[of l 1 g f F u] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>c'. c' \<in> {l<..<1} \<Longrightarrow> \<forall>\<^sub>F x in F. c' * g x \<le> f x; \<And>c'. c' \<in> {1<..<u} \<Longrightarrow> \<forall>\<^sub>F x in F. f x \<le> c' * g x; l < 1; 1 < u; 1 \<noteq> 0\<rbrakk> \<Longrightarrow> f \<sim>[F] (\<lambda>x. 1 * g x)
?c' \<in> {l<..<1} \<Longrightarrow> \<forall>\<^sub>F x in F. ?c' * g x \<le> f x
?c' \<in> {1<..<u} \<Longrightarrow> \<forall>\<^sub>F x in F. f x \<le> ?c' * g x
l < 1
1 < u

goal (1 subgoal):
 1. f \<sim>[F] g
[PROOF STEP]
by simp


[STATEMENT]
theorem f0_alg_correct:
  assumes "\<epsilon> \<in> {0<..<1}"
  assumes "\<delta> \<in> {0<..<1}"
  assumes "set as \<subseteq> {..<n}"
  defines "\<Omega> \<equiv> fold (\<lambda>a state. state \<bind> f0_update a) as (f0_init \<delta> \<epsilon> n) \<bind> f0_result"
  shows "\<P>(\<omega> in measure_pmf \<Omega>. \<bar>\<omega> - F 0 as\<bar> \<le> \<delta> * F 0 as) \<ge> 1 - of_rat \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - real_of_rat \<epsilon> \<le> measure_pmf.prob \<Omega> {\<omega> \<in> space (measure_pmf \<Omega>). \<bar>\<omega> - F 0 as\<bar> \<le> \<delta> * F 0 as}
[PROOF STEP]
using f0_alg_correct'[OF assms(1-3)]
[PROOF STATE]
proof (prove)
using this:
1 - real_of_rat \<epsilon> \<le> measure_pmf.prob (fold (\<lambda>a state. state \<bind> f0_update a) as (f0_init \<delta> \<epsilon> n) \<bind> f0_result) {\<omega> \<in> space (measure_pmf (fold (\<lambda>a state. state \<bind> f0_update a) as (f0_init \<delta> \<epsilon> n) \<bind> f0_result)). \<bar>\<omega> - F 0 as\<bar> \<le> \<delta> * F 0 as}

goal (1 subgoal):
 1. 1 - real_of_rat \<epsilon> \<le> measure_pmf.prob \<Omega> {\<omega> \<in> space (measure_pmf \<Omega>). \<bar>\<omega> - F 0 as\<bar> \<le> \<delta> * F 0 as}
[PROOF STEP]
unfolding \<Omega>_def
[PROOF STATE]
proof (prove)
using this:
1 - real_of_rat \<epsilon> \<le> measure_pmf.prob (fold (\<lambda>a state. state \<bind> f0_update a) as (f0_init \<delta> \<epsilon> n) \<bind> f0_result) {\<omega> \<in> space (measure_pmf (fold (\<lambda>a state. state \<bind> f0_update a) as (f0_init \<delta> \<epsilon> n) \<bind> f0_result)). \<bar>\<omega> - F 0 as\<bar> \<le> \<delta> * F 0 as}

goal (1 subgoal):
 1. 1 - real_of_rat \<epsilon> \<le> measure_pmf.prob (fold (\<lambda>a state. state \<bind> f0_update a) as (f0_init \<delta> \<epsilon> n) \<bind> f0_result) {\<omega> \<in> space (measure_pmf (fold (\<lambda>a state. state \<bind> f0_update a) as (f0_init \<delta> \<epsilon> n) \<bind> f0_result)). \<bar>\<omega> - F 0 as\<bar> \<le> \<delta> * F 0 as}
[PROOF STEP]
by blast


[STATEMENT]
lemma LowLink_le_disc:
    assumes "v \<in> dom (discovered s)"
    shows "LowLink s v \<le> \<delta> s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) \<le> \<delta> s v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> dom (discovered s)

goal (1 subgoal):
 1. Min (\<delta> s ` lowlink_set s v) \<le> \<delta> s v
[PROOF STEP]
unfolding lowlink_set_def
[PROOF STATE]
proof (prove)
using this:
v \<in> dom (discovered s)

goal (1 subgoal):
 1. Min (\<delta> s ` {w \<in> dom (discovered s). v = w \<or> (v, w) \<in> E\<^sup>+ \<and> (w, v) \<in> E\<^sup>+ \<and> (\<exists>p. lowlink_path s v p w)}) \<le> \<delta> s v
[PROOF STEP]
by clarsimp


[STATEMENT]
theorem N1:
  assumes h: "\<turnstile> F \<longrightarrow> G"
  shows "|~ \<circle>F \<longrightarrow> \<circle>G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |~ \<circle>F \<longrightarrow> \<circle>G
[PROOF STEP]
by (rule pmp[OF nex[OF h] pax2])


[STATEMENT]
theorem F'set2_bd: "|F'set2 (x :: ('c, 'a, 'b, 'd) F)| <o (F'bd :: 'c bd_type_F rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |F'set2 x| <o F'bd
[PROOF STEP]
by (rule F.set_bd(3))


[STATEMENT]
lemma "encode (Term (Prod (Const (1::nat)) (Factor (Const (2::nat)))))
  = [False, False, True, False, True, True, True, False, True, True, False, False, True, True, False, True, True]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. encode (Term (trm.Prod (Const 1) (Factor (Const 2)))) = [False, False, True, False, True, True, True, False, True, True, False, False, True, True, False, True, True]
[PROOF STEP]
by code_simp


[STATEMENT]
lemma stereographic_sphere_circle_set:
  shows "stereographic ` sphere_circle_set H = circline_set (stereographic_circline H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stereographic ` sphere_circle_set H = circline_set (stereographic_circline H)
[PROOF STEP]
using stereographic_sphere_circle_set'[of "stereographic_circline H"]
[PROOF STATE]
proof (prove)
using this:
stereographic ` sphere_circle_set (inv_stereographic_circline (stereographic_circline H)) = circline_set (stereographic_circline H)

goal (1 subgoal):
 1. stereographic ` sphere_circle_set H = circline_set (stereographic_circline H)
[PROOF STEP]
using inv_stereographic_circline_stereographic_circline
[PROOF STATE]
proof (prove)
using this:
stereographic ` sphere_circle_set (inv_stereographic_circline (stereographic_circline H)) = circline_set (stereographic_circline H)
inv_stereographic_circline \<circ> stereographic_circline = id

goal (1 subgoal):
 1. stereographic ` sphere_circle_set H = circline_set (stereographic_circline H)
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
stereographic ` sphere_circle_set (inv_stereographic_circline (stereographic_circline H)) = circline_set (stereographic_circline H)
(\<lambda>x. inv_stereographic_circline (stereographic_circline x)) = id

goal (1 subgoal):
 1. stereographic ` sphere_circle_set H = circline_set (stereographic_circline H)
[PROOF STEP]
by (metis id_apply)


[STATEMENT]
lemma set_neg_intro: "a \<in> (- 1) *o C \<Longrightarrow> - a \<in> C"
  for a :: "'a::ring_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> - (1::'a) *o C \<Longrightarrow> - a \<in> C
[PROOF STEP]
by (auto simp add: elt_set_times_def)


[STATEMENT]
lemma top_S_sup_conv_Z:
  "top * S \<squnion> Z\<^sup>T = top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top * S \<squnion> Z\<^sup>T = top
[PROOF STEP]
by (metis S_star_Z_top conv_dist_comp conv_involutive conv_star_commute star.circ_back_loop_fixpoint symmetric_top_closed)


[STATEMENT]
lemma sup_subdistl: "(x \<cdot> y) \<squnion> (x \<cdot> z) \<le> x \<cdot> (y \<squnion> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> y \<squnion> x \<cdot> z \<le> x \<cdot> (y \<squnion> z)
[PROOF STEP]
by (smt SUP_empty SUP_insert Sup_subdistl sup_Sup sup_bot_right)


[STATEMENT]
lemma summable_geometric: "norm c < 1 \<Longrightarrow> summable (\<lambda>n. c^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm c < 1 \<Longrightarrow> summable ((^) c)
[PROOF STEP]
by (rule geometric_sums [THEN sums_summable])


[STATEMENT]
lemma inorder_split: "inorder(split t) = inorder t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tree2.inorder (split t) = Tree2.inorder t
[PROOF STEP]
by(cases t rule: split.cases) (auto)


[STATEMENT]
lemma countable_Un[intro]: "countable A \<Longrightarrow> countable B \<Longrightarrow> countable (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; countable B\<rbrakk> \<Longrightarrow> countable (A \<union> B)
[PROOF STEP]
by (rule countable_UN[of "{True, False}" "\<lambda>True \<Rightarrow> A | False \<Rightarrow> B", simplified])
     (simp split: bool.split)


[STATEMENT]
lemma alg_dvd_trans [trans]:
  fixes x y z :: "'a :: field_char_0"
  shows "x alg_dvd y \<Longrightarrow> y alg_dvd z \<Longrightarrow> x alg_dvd z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x alg_dvd y; y alg_dvd z\<rbrakk> \<Longrightarrow> x alg_dvd z
[PROOF STEP]
using algebraic_int_times[of "y / x" "z / y"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>algebraic_int (y / x); algebraic_int (z / y)\<rbrakk> \<Longrightarrow> algebraic_int (y / x * (z / y))

goal (1 subgoal):
 1. \<lbrakk>x alg_dvd y; y alg_dvd z\<rbrakk> \<Longrightarrow> x alg_dvd z
[PROOF STEP]
by (auto simp: alg_dvd_def)


[STATEMENT]
lemma top_scene_eq: "\<top>\<^sub>S = \<Squnion>\<^sub>S Vars"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<top>\<^sub>S = \<Squnion>\<^sub>S Vars
[PROOF STEP]
using local.span_Vars scene_span_def
[PROOF STATE]
proof (prove)
using this:
scene_span Vars
scene_span ?S = (\<Squnion>\<^sub>S ?S = \<top>\<^sub>S)

goal (1 subgoal):
 1. \<top>\<^sub>S = \<Squnion>\<^sub>S Vars
[PROOF STEP]
by force


[STATEMENT]
lemma sets_pair_measure_cong[measurable_cong, cong]:
  "sets M1 = sets M1' \<Longrightarrow> sets M2 = sets M2' \<Longrightarrow> sets (M1 \<Otimes>\<^sub>M M2) = sets (M1' \<Otimes>\<^sub>M M2')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sets M1 = sets M1'; sets M2 = sets M2'\<rbrakk> \<Longrightarrow> sets (M1 \<Otimes>\<^sub>M M2) = sets (M1' \<Otimes>\<^sub>M M2')
[PROOF STEP]
unfolding sets_pair_measure
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sets M1 = sets M1'; sets M2 = sets M2'\<rbrakk> \<Longrightarrow> sigma_sets (space M1 \<times> space M2) {a \<times> b |a b. a \<in> sets M1 \<and> b \<in> sets M2} = sigma_sets (space M1' \<times> space M2') {a \<times> b |a b. a \<in> sets M1' \<and> b \<in> sets M2'}
[PROOF STEP]
by (simp cong: sets_eq_imp_space_eq)


[STATEMENT]
lemma codomain_additive:   "(codomain_block (x\<otimes>y))= (codomain_block x) + (codomain_block y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain_block (x \<otimes> y) = codomain_block x + codomain_block y
[PROOF STEP]
by (induction x)(auto)


[STATEMENT]
lemma aux1_lm0241_pow2_up_bound:"(\<exists>(p::nat). (a::nat) < 2^(Suc p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. a < 2 ^ Suc p
[PROOF STEP]
by (induction a) (use less_exp in fastforce)+


[STATEMENT]
lemma subset_image_lepoll: "B \<subseteq> f ` A \<Longrightarrow> B \<lesssim> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> f ` A \<Longrightarrow> B \<lesssim> A
[PROOF STEP]
by (auto simp: lepoll_iff)


[STATEMENT]
lemma COND_upd_uinfo_ik:
    "\<lbrakk>terms_uinfo uinfo \<subseteq> synth (analz ik); terms_hf hf \<subseteq> synth (analz ik)\<rbrakk>
    \<Longrightarrow> terms_uinfo (upd_uinfo uinfo hf) \<subseteq> synth (analz ik)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fset uinfo \<subseteq> synth (analz ik); terms_hf hf \<subseteq> synth (analz ik)\<rbrakk> \<Longrightarrow> fset (upd_uinfo uinfo hf) \<subseteq> synth (analz ik)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma tau_star_var:
assumes "\<And>x y z. x \<cdot> (y \<cdot> z) = (x \<cdot> y) \<cdot> z"
and "\<And>x. x\<^sup>\<star> \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>"
shows "\<tau> (x\<^sup>\<star>) = (\<nu> x)\<^sup>\<star> \<cdot> \<tau> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> (x\<^sup>\<star>) = \<nu> x\<^sup>\<star> \<cdot> \<tau> x
[PROOF STEP]
by (metis (no_types, lifting) assms(1) assms(2) local.add_0_right local.add_comm local.s_prod_distr local.s_prod_idl local.tau_def local.tau_zero nu_star)


[STATEMENT]
lemma mod_ring_plus64: "(mod_ring_rel64 ===> mod_ring_rel64 ===> mod_ring_rel64) (plus_p64 pp) (+)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64 ===> mod_ring_rel64) (plus_p64 pp) (+)
[PROOF STEP]
using urel64_plus mod_ring_plus
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>urel64 ?x ?y; urel64 ?x' ?y'\<rbrakk> \<Longrightarrow> urel64 (plus_p64 pp ?x ?x') (plus_p p ?y ?y')
(mod_ring_rel ===> mod_ring_rel ===> mod_ring_rel) (plus_p p) (+)

goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64 ===> mod_ring_rel64) (plus_p64 pp) (+)
[PROOF STEP]
unfolding mod_ring_rel64_def rel_fun_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>urel64 ?x ?y; urel64 ?x' ?y'\<rbrakk> \<Longrightarrow> urel64 (plus_p64 pp ?x ?x') (plus_p p ?y ?y')
\<forall>x y. mod_ring_rel x y \<longrightarrow> (\<forall>xa ya. mod_ring_rel xa ya \<longrightarrow> mod_ring_rel (plus_p p x xa) (y + ya))

goal (1 subgoal):
 1. \<forall>x y. (\<exists>z. urel64 x z \<and> mod_ring_rel z y) \<longrightarrow> (\<forall>xa ya. (\<exists>z. urel64 xa z \<and> mod_ring_rel z ya) \<longrightarrow> (\<exists>z. urel64 (plus_p64 pp x xa) z \<and> mod_ring_rel z (y + ya)))
[PROOF STEP]
by blast


[STATEMENT]
lemma indep_vars_Pi_pmf:
  assumes fin: "finite I"
  shows   "prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p))
             (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
proof (cases "I = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. I = {} \<Longrightarrow> prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
 2. I \<noteq> {} \<Longrightarrow> prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
I = {}

goal (2 subgoals):
 1. I = {} \<Longrightarrow> prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
 2. I \<noteq> {} \<Longrightarrow> prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
by (subst prob_space.indep_vars_def [OF measure_pmf.prob_space_axioms],
        subst prob_space.indep_sets_def [OF measure_pmf.prob_space_axioms]) (simp_all add: True)
[PROOF STATE]
proof (state)
this:
prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
case [simp]: False
[PROOF STATE]
proof (state)
this:
I \<noteq> {}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I
[PROOF STEP]
proof (subst prob_space.indep_vars_iff_distr_eq_PiM')
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. prob_space (measure_pmf (Pi_pmf I dflt p))
 2. I \<noteq> {}
 3. \<And>i. i \<in> I \<Longrightarrow> measure_pmf.random_variable (Pi_pmf I dflt p) (count_space UNIV) (\<lambda>f. f i)
 4. distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I) = Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))
[PROOF STEP]
show "distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I) =
          Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I) = Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))
[PROOF STEP]
proof (rule product_sigma_finite.PiM_eqI, goal_cases)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. product_sigma_finite (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))
 2. finite I
 3. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)))
 4. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (4 subgoals):
 1. product_sigma_finite (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))
 2. finite I
 3. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)))
 4. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
interpret product_prob_space "\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_prob_space (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))
[PROOF STEP]
by (intro product_prob_spaceI prob_space.prob_space_distr measure_pmf.prob_space_axioms)
           simp_all
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. product_sigma_finite (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))
 2. finite I
 3. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = P.events
 4. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> M.events i) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
product_sigma_finite (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))

goal (3 subgoals):
 1. finite I
 2. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = P.events
 3. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> M.events i) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite I
 2. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)))
 3. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
case 3
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. finite I
 2. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)))
 3. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
have "sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) =
            sets (Pi\<^sub>M I (\<lambda>_. count_space UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) = sets (Pi\<^sub>M I (\<lambda>_. count_space UNIV))
[PROOF STEP]
by (intro sets_PiM_cong) simp_all
[PROOF STATE]
proof (state)
this:
sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) = sets (Pi\<^sub>M I (\<lambda>_. count_space UNIV))

goal (3 subgoals):
 1. finite I
 2. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)))
 3. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) = sets (Pi\<^sub>M I (\<lambda>_. count_space UNIV))

goal (1 subgoal):
 1. sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sets (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) = sets (Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)))

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
case (4 A)
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> A ?i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f ?i))

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
have "Pi\<^sub>E I A \<in> sets (Pi\<^sub>M I (\<lambda>i. count_space UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>E I A \<in> sets (Pi\<^sub>M I (\<lambda>i. count_space UNIV))
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> A ?i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f ?i))

goal (1 subgoal):
 1. Pi\<^sub>E I A \<in> sets (Pi\<^sub>M I (\<lambda>i. count_space UNIV))
[PROOF STEP]
by (intro sets_PiM_I_finite fin) auto
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E I A \<in> sets (Pi\<^sub>M I (\<lambda>i. count_space UNIV))

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
hence "emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV))
              (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) =
             emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A)"
[PROOF STATE]
proof (prove)
using this:
Pi\<^sub>E I A \<in> sets (Pi\<^sub>M I (\<lambda>i. count_space UNIV))

goal (1 subgoal):
 1. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A)
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
Pi\<^sub>E I A \<in> sets (Pi\<^sub>M I (\<lambda>i. count_space UNIV))
?i \<in> I \<Longrightarrow> A ?i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f ?i))

goal (1 subgoal):
 1. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A)
[PROOF STEP]
by (subst emeasure_distr) (auto simp: space_PiM)
[PROOF STATE]
proof (state)
this:
emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A)

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A)

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
have "\<dots> = emeasure (measure_pmf (Pi_pmf I dflt p)) (PiE_dflt I dflt A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A) = emeasure (measure_pmf (Pi_pmf I dflt p)) (PiE_dflt I dflt A)
[PROOF STEP]
by (intro emeasure_eq_AE AE_pmfI) (auto simp: PiE_dflt_def set_Pi_pmf fin)
[PROOF STATE]
proof (state)
this:
emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A) = emeasure (measure_pmf (Pi_pmf I dflt p)) (PiE_dflt I dflt A)

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (measure_pmf (Pi_pmf I dflt p)) ((\<lambda>x. restrict x I) -` Pi\<^sub>E I A) = emeasure (measure_pmf (Pi_pmf I dflt p)) (PiE_dflt I dflt A)

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
have "\<dots> = (\<Prod>i\<in>I. emeasure (measure_pmf (p i)) (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf (Pi_pmf I dflt p)) (PiE_dflt I dflt A) = (\<Prod>i\<in>I. emeasure (measure_pmf (p i)) (A i))
[PROOF STEP]
by (simp add: measure_pmf.emeasure_eq_measure measure_Pi_pmf_PiE_dflt fin prod_ennreal)
[PROOF STATE]
proof (state)
this:
emeasure (measure_pmf (Pi_pmf I dflt p)) (PiE_dflt I dflt A) = (\<Prod>i\<in>I. emeasure (measure_pmf (p i)) (A i))

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (measure_pmf (Pi_pmf I dflt p)) (PiE_dflt I dflt A) = (\<Prod>i\<in>I. emeasure (measure_pmf (p i)) (A i))

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
have "\<dots> = (\<Prod>i\<in>I. emeasure (measure_pmf (map_pmf (\<lambda>f. f i) (Pi_pmf I dflt p))) (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>I. emeasure (measure_pmf (p i)) (A i)) = (\<Prod>i\<in>I. emeasure (measure_pmf (map_pmf (\<lambda>f. f i) (Pi_pmf I dflt p))) (A i))
[PROOF STEP]
by (intro prod.cong refl, subst Pi_pmf_component) (auto simp: fin)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>I. emeasure (measure_pmf (p i)) (A i)) = (\<Prod>i\<in>I. emeasure (measure_pmf (map_pmf (\<lambda>f. f i) (Pi_pmf I dflt p))) (A i))

goal (2 subgoals):
 1. finite I
 2. \<And>A. (\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))) \<Longrightarrow> emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (measure_pmf (map_pmf (\<lambda>f. f i) (Pi_pmf I dflt p))) (A i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (measure_pmf (map_pmf (\<lambda>f. f i) (Pi_pmf I dflt p))) (A i))

goal (1 subgoal):
 1. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))
[PROOF STEP]
by (simp add: map_pmf_rep_eq)
[PROOF STATE]
proof (state)
this:
emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I)) (Pi\<^sub>E I A) = (\<Prod>i\<in>I. emeasure (distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i)) (A i))

goal (1 subgoal):
 1. finite I
[PROOF STEP]
qed fact+
[PROOF STATE]
proof (state)
this:
distr (measure_pmf (Pi_pmf I dflt p)) (Pi\<^sub>M I (\<lambda>i. count_space UNIV)) (\<lambda>x. restrict x I) = Pi\<^sub>M I (\<lambda>i. distr (measure_pmf (Pi_pmf I dflt p)) (count_space UNIV) (\<lambda>f. f i))

goal (3 subgoals):
 1. prob_space (measure_pmf (Pi_pmf I dflt p))
 2. I \<noteq> {}
 3. \<And>i. i \<in> I \<Longrightarrow> measure_pmf.random_variable (Pi_pmf I dflt p) (count_space UNIV) (\<lambda>f. f i)
[PROOF STEP]
qed (simp_all add: measure_pmf.prob_space_axioms)
[PROOF STATE]
proof (state)
this:
prob_space.indep_vars (measure_pmf (Pi_pmf I dflt p)) (\<lambda>_. count_space UNIV) (\<lambda>x f. f x) I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transpose_empty: "(transpose xs = []) \<longleftrightarrow> (\<forall>x \<in> set xs. x = [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (transpose xs = []) = (\<forall>x\<in>set xs. x = [])
[PROOF STEP]
by (induct rule: transpose.induct) simp_all


[STATEMENT]
lemma Suc_to_right: "Suc n = m \<Longrightarrow> n = m - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n = m \<Longrightarrow> n = m - Suc 0
[PROOF STEP]
by simp


[STATEMENT]
lemma powerset_lift_UNION:
  "(\<Union>x\<in>S. \<^ps>g\<cdot>(A x)) = \<^ps>g\<cdot>(\<Union>x\<in>S. A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>S. \<^ps> g\<cdot>(A x)) = \<^ps> g\<cdot>(\<Union> (A ` S))
[PROOF STEP]
unfolding powerset_lift_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>S. (\<Lambda> S. \<Union> (Rep_cfun g ` S))\<cdot>(A x)) = (\<Lambda> S. \<Union> (Rep_cfun g ` S))\<cdot>(\<Union> (A ` S))
[PROOF STEP]
by auto


[STATEMENT]
lemma repeat_mset_eq_empty_iff: "repeat_mset n A = {#} \<longleftrightarrow> n = 0 \<or> A = {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (repeat_mset n A = {#}) = (n = 0 \<or> A = {#})
[PROOF STEP]
by (cases n) auto


[STATEMENT]
lemma integrable_normal_moment: "integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>)^k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
 2. \<not> ?P \<Longrightarrow> integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
assume "even k"
[PROOF STATE]
proof (state)
this:
even k

goal (2 subgoals):
 1. ?P \<Longrightarrow> integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
 2. \<not> ?P \<Longrightarrow> integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
even k

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
using integrable.intros[OF normal_moment_even]
[PROOF STATE]
proof (prove)
using this:
even k
0 < ?\<sigma>1 \<Longrightarrow> integrable lborel (\<lambda>x. normal_density ?\<mu>1 ?\<sigma>1 x * (x - ?\<mu>1) ^ (2 * ?k1))

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
by (auto elim: evenE)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)

goal (1 subgoal):
 1. odd k \<Longrightarrow> integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd k \<Longrightarrow> integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
assume "odd k"
[PROOF STATE]
proof (state)
this:
odd k

goal (1 subgoal):
 1. odd k \<Longrightarrow> integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
odd k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
odd k

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
using integrable.intros[OF normal_moment_odd]
[PROOF STATE]
proof (prove)
using this:
odd k
0 < ?\<sigma>1 \<Longrightarrow> integrable lborel (\<lambda>x. normal_density ?\<mu>1 ?\<sigma>1 x * (x - ?\<mu>1) ^ (2 * ?k1 + 1))

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)
[PROOF STEP]
by (auto elim: oddE)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ k)

goal:
No subgoals!
[PROOF STEP]
qed