[STATEMENT]
lemma RSubmodule_RSpan_single :
  assumes "m \<in> M"
  shows   "RSubmodule (RSpan [m])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RSubmodule (RSpan [m])
[PROOF STEP]
proof (rule RSubmoduleI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. VecGroup.Subgroup (RSpan [m])
 2. \<And>r n. \<lbrakk>r \<in> R; n \<in> RSpan [m]\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
m \<in> M
[PROOF STEP]
show "Subgroup (RSpan [m])"
[PROOF STATE]
proof (prove)
using this:
m \<in> M

goal (1 subgoal):
 1. VecGroup.Subgroup (RSpan [m])
[PROOF STEP]
using Group_RSpan_single RSpan_closed[of "[m]"]
[PROOF STATE]
proof (prove)
using this:
m \<in> M
?m \<in> M \<Longrightarrow> Group (RSpan [?m])
set [m] \<subseteq> M \<Longrightarrow> RSpan [m] \<subseteq> M

goal (1 subgoal):
 1. VecGroup.Subgroup (RSpan [m])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
VecGroup.Subgroup (RSpan [m])

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> RSpan [m]\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> RSpan [m]\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
fix r n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> RSpan [m]\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
assume rn: "r \<in> R" "n \<in> RSpan [m]"
[PROOF STATE]
proof (state)
this:
r \<in> R
n \<in> RSpan [m]

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> RSpan [m]\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
from rn(2)
[PROOF STATE]
proof (chain)
picking this:
n \<in> RSpan [m]
[PROOF STEP]
obtain s where s: "s \<in> R" "n = s \<cdot> m"
[PROOF STATE]
proof (prove)
using this:
n \<in> RSpan [m]

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>s \<in> R; n = s \<cdot> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using RSpan_single
[PROOF STATE]
proof (prove)
using this:
n \<in> RSpan [m]
RSpan [?m] = {r \<cdot> ?m |r. r \<in> R}

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>s \<in> R; n = s \<cdot> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
s \<in> R
n = s \<cdot> m

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> RSpan [m]\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
with assms rn(1)
[PROOF STATE]
proof (chain)
picking this:
m \<in> M
r \<in> R
s \<in> R
n = s \<cdot> m
[PROOF STEP]
have "r * s \<in> R" "r \<cdot> n = (r * s) \<cdot> m"
[PROOF STATE]
proof (prove)
using this:
m \<in> M
r \<in> R
s \<in> R
n = s \<cdot> m

goal (1 subgoal):
 1. r * s \<in> R &&& r \<cdot> n = (r * s) \<cdot> m
[PROOF STEP]
using mult_closed
[PROOF STATE]
proof (prove)
using this:
m \<in> M
r \<in> R
s \<in> R
n = s \<cdot> m
\<lbrakk>?r \<in> R; ?s \<in> R\<rbrakk> \<Longrightarrow> ?r * ?s \<in> R

goal (1 subgoal):
 1. r * s \<in> R &&& r \<cdot> n = (r * s) \<cdot> m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r * s \<in> R
r \<cdot> n = (r * s) \<cdot> m

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> RSpan [m]\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
thus "r \<cdot> n \<in> RSpan [m]"
[PROOF STATE]
proof (prove)
using this:
r * s \<in> R
r \<cdot> n = (r * s) \<cdot> m

goal (1 subgoal):
 1. r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
using RSpan_single
[PROOF STATE]
proof (prove)
using this:
r * s \<in> R
r \<cdot> n = (r * s) \<cdot> m
RSpan [?m] = {r \<cdot> ?m |r. r \<in> R}

goal (1 subgoal):
 1. r \<cdot> n \<in> RSpan [m]
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
r \<cdot> n \<in> RSpan [m]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma standard_liouville_summable:
  fixes p :: "nat \<Rightarrow> int" and q :: int
  assumes "q > 1" "range p \<subseteq> {0..<q}"
  shows   "summable (\<lambda>k. p k / of_int q ^ fact (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>k. real_of_int (p k) / real_of_int q ^ fact (Suc k))
[PROOF STEP]
proof (rule summable_comparison_test')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable ?g
 2. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> ?g n
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
1 < q
[PROOF STEP]
show "summable (\<lambda>n. (1 / q) ^ n)"
[PROOF STATE]
proof (prove)
using this:
1 < q

goal (1 subgoal):
 1. summable ((^) (1 / real_of_int q))
[PROOF STEP]
by (intro summable_geometric) simp_all
[PROOF STATE]
proof (state)
this:
summable ((^) (1 / real_of_int q))

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < q
range p \<subseteq> {0..<q}
[PROOF STEP]
have "p n \<in> {0..<q}"
[PROOF STATE]
proof (prove)
using this:
1 < q
range p \<subseteq> {0..<q}

goal (1 subgoal):
 1. p n \<in> {0..<q}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p n \<in> {0..<q}

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
1 < q
p n \<in> {0..<q}
[PROOF STEP]
have "norm (p n / of_int q ^ fact (Suc n)) \<le>
                        q / of_int q ^ (fact (Suc n))"
[PROOF STATE]
proof (prove)
using this:
1 < q
p n \<in> {0..<q}

goal (1 subgoal):
 1. norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> real_of_int q / real_of_int q ^ fact (Suc n)
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> real_of_int q / real_of_int q ^ fact (Suc n)

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> real_of_int q / real_of_int q ^ fact (Suc n)

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
1 < q
[PROOF STEP]
have "\<dots> = 1 / of_int q ^ (fact (Suc n) - 1)"
[PROOF STATE]
proof (prove)
using this:
1 < q

goal (1 subgoal):
 1. real_of_int q / real_of_int q ^ fact (Suc n) = 1 / real_of_int q ^ (fact (Suc n) - 1)
[PROOF STEP]
by (subst power_diff) (auto simp del: fact_Suc)
[PROOF STATE]
proof (state)
this:
real_of_int q / real_of_int q ^ fact (Suc n) = 1 / real_of_int q ^ (fact (Suc n) - 1)

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int q / real_of_int q ^ fact (Suc n) = 1 / real_of_int q ^ (fact (Suc n) - 1)

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
have "Suc n \<le> fact (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n \<le> fact (Suc n)
[PROOF STEP]
by (rule fact_ge_self)
[PROOF STATE]
proof (state)
this:
Suc n \<le> fact (Suc n)

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
1 < q
Suc n \<le> fact (Suc n)
[PROOF STEP]
have "1 / real_of_int q ^ (fact (Suc n) - 1) \<le> 1 / of_int q ^ n"
[PROOF STATE]
proof (prove)
using this:
1 < q
Suc n \<le> fact (Suc n)

goal (1 subgoal):
 1. 1 / real_of_int q ^ (fact (Suc n) - 1) \<le> 1 / real_of_int q ^ n
[PROOF STEP]
by (intro divide_left_mono power_increasing)
       (auto simp del: fact_Suc simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
1 / real_of_int q ^ (fact (Suc n) - 1) \<le> 1 / real_of_int q ^ n

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> 1 / real_of_int q ^ n
[PROOF STEP]
show "norm (p n / of_int q ^ fact (Suc n)) \<le> (1 / q) ^ n"
[PROOF STATE]
proof (prove)
using this:
norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> 1 / real_of_int q ^ n

goal (1 subgoal):
 1. norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n
[PROOF STEP]
by (simp add: power_divide)
[PROOF STATE]
proof (state)
this:
norm (real_of_int (p n) / real_of_int q ^ fact (Suc n)) \<le> (1 / real_of_int q) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SUP_SUP_L [simp]: "Sup (range (SUP_LE_P X)) = Sup (range X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>range (SUP_LE_P X) = \<Squnion>range X
[PROOF STEP]
apply (simp add: fun_eq_iff Sup_fun_def image_comp, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (SUP xa. SUP_LE_P X xa x) = (SUP xa. X xa x)
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. (SUP xa. SUP_LE_P X xa x) \<sqsubseteq> (SUP xa. X xa x)
 2. \<And>x. (SUP xa. X xa x) \<sqsubseteq> (SUP xa. SUP_LE_P X xa x)
[PROOF STEP]
apply (rule SUP_least)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> SUP_LE_P X xa x \<sqsubseteq> (SUP xa. X xa x)
 2. \<And>x. (SUP xa. X xa x) \<sqsubseteq> (SUP xa. SUP_LE_P X xa x)
[PROOF STEP]
apply (rule SUP_LE_P_least)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa v. \<lbrakk>xa \<in> UNIV; pair v x \<sqsubseteq> xa\<rbrakk> \<Longrightarrow> X v x \<sqsubseteq> (SUP xa. X xa x)
 2. \<And>x. (SUP xa. X xa x) \<sqsubseteq> (SUP xa. SUP_LE_P X xa x)
[PROOF STEP]
apply (rule SUP_upper, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (SUP xa. X xa x) \<sqsubseteq> (SUP xa. SUP_LE_P X xa x)
[PROOF STEP]
apply (rule SUP_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> X xa x \<sqsubseteq> (SUP xa. SUP_LE_P X xa x)
[PROOF STEP]
apply (rule_tac y = "SUP_LE_P X (pair xa x) x" in order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> X xa x \<sqsubseteq> SUP_LE_P X (pair xa x) x
 2. \<And>x xa. xa \<in> UNIV \<Longrightarrow> SUP_LE_P X (pair xa x) x \<sqsubseteq> (SUP xa. SUP_LE_P X xa x)
[PROOF STEP]
apply (rule SUP_LE_P_upper, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> SUP_LE_P X (pair xa x) x \<sqsubseteq> (SUP xa. SUP_LE_P X xa x)
[PROOF STEP]
by (rule SUP_upper, simp)


[STATEMENT]
lemma VectorSpaceHomSetD_VectorSpaceHom :
  "T \<in> VectorSpaceHomSet fsmult V fsmult' N
        \<Longrightarrow> VectorSpaceHom fsmult V fsmult' T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<in> VectorSpaceHomSet fsmult V fsmult' N \<Longrightarrow> VectorSpaceHom fsmult V fsmult' T
[PROOF STEP]
unfolding VectorSpaceHomSet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<in> {T. VectorSpaceHom fsmult V fsmult' T} \<inter> {T. T ` V \<subseteq> N} \<Longrightarrow> VectorSpaceHom fsmult V fsmult' T
[PROOF STEP]
by fast


[STATEMENT]
lemma abc_append_first_step_eq_pre:
  "st < length A
 \<Longrightarrow> abc_step_l (st, lm) (abc_fetch st (A @ B)) =
    abc_step_l (st, lm) (abc_fetch st A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. st < length A \<Longrightarrow> abc_step_l (st, lm) (abc_fetch st (A @ B)) = abc_step_l (st, lm) (abc_fetch st A)
[PROOF STEP]
by(simp add: abc_step_l.simps abc_fetch.simps nth_append)


[STATEMENT]
theorem index_of_pr_is_real: "f \<in> PrimRec1 \<Longrightarrow> nat_to_pr (index_of_pr f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> nat_to_pr (index_of_pr f) = f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> nat_to_pr (index_of_pr f) = f
[PROOF STEP]
assume "f \<in> PrimRec1"
[PROOF STATE]
proof (state)
this:
f \<in> PrimRec1

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> nat_to_pr (index_of_pr f) = f
[PROOF STEP]
hence "\<exists> n. f = nat_to_pr n"
[PROOF STATE]
proof (prove)
using this:
f \<in> PrimRec1

goal (1 subgoal):
 1. \<exists>n. f = nat_to_pr n
[PROOF STEP]
by (rule nat_to_pr_srj)
[PROOF STATE]
proof (state)
this:
\<exists>n. f = nat_to_pr n

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> nat_to_pr (index_of_pr f) = f
[PROOF STEP]
hence "f = nat_to_pr (SOME n. f = nat_to_pr n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. f = nat_to_pr n

goal (1 subgoal):
 1. f = nat_to_pr (SOME n. f = nat_to_pr n)
[PROOF STEP]
by (rule someI_ex)
[PROOF STATE]
proof (state)
this:
f = nat_to_pr (SOME n. f = nat_to_pr n)

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> nat_to_pr (index_of_pr f) = f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f = nat_to_pr (SOME n. f = nat_to_pr n)

goal (1 subgoal):
 1. nat_to_pr (index_of_pr f) = f
[PROOF STEP]
by (simp add: index_of_pr_def)
[PROOF STATE]
proof (state)
this:
nat_to_pr (index_of_pr f) = f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring) indexed_eval_aux_in_carrier:
  assumes "list_all carrier_coeff Ps" shows "carrier_coeff (indexed_eval_aux Ps i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier_coeff (indexed_eval_aux Ps i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
list_all carrier_coeff Ps

goal (1 subgoal):
 1. carrier_coeff (indexed_eval_aux Ps i)
[PROOF STEP]
unfolding carrier_coeff_def
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>P. \<forall>m. P m \<in> carrier R) Ps

goal (1 subgoal):
 1. \<forall>m. indexed_eval_aux Ps i m \<in> carrier R
[PROOF STEP]
by (induct Ps) (auto simp add: indexed_zero_def indexed_padd_def indexed_pmult_def)


[STATEMENT]
lemma subcocycle_lim_ereal_cmult:
  assumes "subcocycle u" "c\<ge>(0::real)"
  shows "AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = c * subcocycle_lim_ereal u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
have "AE x in M. (\<lambda>n. (c * u n x)/n) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (c * u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x
[PROOF STEP]
by (rule kingman_theorem_AE_nonergodic_ereal[OF subcocycle_cmult[OF assms]])
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (c * u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (c * u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
have "AE x in M. (\<lambda>n. u n x / n) \<longlonglongrightarrow> subcocycle_lim_ereal u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
[PROOF STEP]
by (rule kingman_theorem_AE_nonergodic_ereal[OF assms(1)])
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
assume H: "(\<lambda>n. (c * u n x)/n) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x"
                    "(\<lambda>n. u n x / n) \<longlonglongrightarrow> subcocycle_lim_ereal u x"
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. ereal (c * u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x
(\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
have "(\<lambda>n. c * ereal (u n x / n)) \<longlonglongrightarrow> c * subcocycle_lim_ereal u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal c * ereal (u n x / real n)) \<longlonglongrightarrow> ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
by (rule tendsto_cmult_ereal[OF _ H(2)], auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal c * ereal (u n x / real n)) \<longlonglongrightarrow> ereal c * subcocycle_lim_ereal u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ereal c * ereal (u n x / real n)) \<longlonglongrightarrow> ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
have "subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = c * subcocycle_lim_ereal u x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal c * ereal (u n x / real n)) \<longlonglongrightarrow> ereal c * subcocycle_lim_ereal u x

goal (1 subgoal):
 1. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
using H(1)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal c * ereal (u n x / real n)) \<longlonglongrightarrow> ereal c * subcocycle_lim_ereal u x
(\<lambda>xa. ereal (c * u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x

goal (1 subgoal):
 1. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
by (simp add: LIMSEQ_unique)
[PROOF STATE]
proof (state)
this:
subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>x. ereal (c * u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) ?x5; (\<lambda>x. ereal (u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal u ?x5\<rbrakk> \<Longrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) ?x5 = ereal c * subcocycle_lim_ereal u ?x5

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>xa. ereal (c * u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x
AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
\<lbrakk>(\<lambda>x. ereal (c * u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) ?x5; (\<lambda>x. ereal (u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal u ?x5\<rbrakk> \<Longrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) ?x5 = ereal c * subcocycle_lim_ereal u ?x5
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>xa. ereal (c * u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) x
AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
\<lbrakk>(\<lambda>x. ereal (c * u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) ?x5; (\<lambda>x. ereal (u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal u ?x5\<rbrakk> \<Longrightarrow> subcocycle_lim_ereal (\<lambda>n x. c * u n x) ?x5 = ereal c * subcocycle_lim_ereal u ?x5

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. subcocycle_lim_ereal (\<lambda>n x. c * u n x) x = ereal c * subcocycle_lim_ereal u x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_power [continuous_intros]:
  fixes f :: "_ \<Rightarrow> 'b::{power,real_normed_algebra}"
  shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. (f x)^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. f x ^ n)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s) \<Longrightarrow> \<forall>x\<in>s. ((\<lambda>x. f x ^ n) \<longlongrightarrow> f x ^ n) (at x within s)
[PROOF STEP]
by (auto intro: tendsto_power)


[STATEMENT]
lemma smult_as_map_poly: "smult a = map_poly ((*) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult a = map_poly ((*) a)
[PROOF STEP]
by (rule ext, rule poly_eqI, subst coeff_map_poly, auto)


[STATEMENT]
lemma free_tv_comp_subst:
  "free_tv (\<lambda>u::nat. $ s1 (s2 u) :: typ) \<subseteq>
    free_tv s1 Un free_tv s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. free_tv (\<lambda>u. $ s1 (s2 u)) \<subseteq> free_tv s1 \<union> free_tv s2
[PROOF STEP]
unfolding free_tv_subst dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. $ s1 (s2 n) \<noteq> TVar n} \<union> cod (\<lambda>u. $ s1 (s2 u)) \<subseteq> {n. s1 n \<noteq> TVar n} \<union> cod s1 \<union> ({n. s2 n \<noteq> TVar n} \<union> cod s2)
[PROOF STEP]
by (force simp add: cod_def dom_def dest!:free_tv_app_subst_te [THEN subsetD])


[STATEMENT]
lemma lincomb_append_right :
  "rs \<bullet>\<cdot> (ms@ns) = rs \<bullet>\<cdot> ms + (drop (length ms) rs) \<bullet>\<cdot> ns"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rs \<bullet>\<cdot> (ms @ ns) = rs \<bullet>\<cdot> ms + drop (length ms) rs \<bullet>\<cdot> ns
[PROOF STEP]
using zip_append_right[of rs ms]
[PROOF STATE]
proof (prove)
using this:
zip rs (ms @ ?zs) = zip rs ms @ zip (drop (length ms) rs) ?zs

goal (1 subgoal):
 1. rs \<bullet>\<cdot> (ms @ ns) = rs \<bullet>\<cdot> ms + drop (length ms) rs \<bullet>\<cdot> ns
[PROOF STEP]
unfolding lincomb_def
[PROOF STATE]
proof (prove)
using this:
zip rs (ms @ ?zs) = zip rs ms @ zip (drop (length ms) rs) ?zs

goal (1 subgoal):
 1. sum_list (map2 (\<cdot>) rs (ms @ ns)) = sum_list (map2 (\<cdot>) rs ms) + sum_list (map2 (\<cdot>) (drop (length ms) rs) ns)
[PROOF STEP]
by simp


[STATEMENT]
lemma cr_scalar_bi_unique[transfer_rule]:
  assumes "bi_unique R"
  shows "bi_unique (cr_scalar R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bi_unique (cr_scalar R)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bi_unique R

goal (1 subgoal):
 1. bi_unique (cr_scalar R)
[PROOF STEP]
unfolding cr_scalar_def bi_unique_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x y z. R x y \<longrightarrow> R x z \<longrightarrow> y = z) \<and> (\<forall>x y z. R x z \<longrightarrow> R y z \<longrightarrow> x = y)

goal (1 subgoal):
 1. (\<forall>x y z. (\<exists>a. x = [a]\<^sub>\<circ> \<and> R a y) \<longrightarrow> (\<exists>a. x = [a]\<^sub>\<circ> \<and> R a z) \<longrightarrow> y = z) \<and> (\<forall>x y z. (\<exists>a. x = [a]\<^sub>\<circ> \<and> R a z) \<longrightarrow> (\<exists>a. y = [a]\<^sub>\<circ> \<and> R a z) \<longrightarrow> x = y)
[PROOF STEP]
by auto


[STATEMENT]
lemma gcd_integer_code [code]:
"gcd_integer l k = \<bar>if l = (0::integer) then k else gcd_integer l (\<bar>k\<bar> mod \<bar>l\<bar>)\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd_integer l k = \<bar>if l = 0 then k else gcd_integer l (\<bar>k\<bar> mod \<bar>l\<bar>)\<bar>
[PROOF STEP]
by transfer (simp add: gcd_code_int [symmetric] ac_simps)


[STATEMENT]
lemma netmap_subnets_samef:
  assumes "netmap s1 = f"
      and "netmap s2 = f"
    shows "netmap (SubnetS s1 s2) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. netmap (SubnetS s1 s2) = f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
netmap s1 = f
netmap s2 = f

goal (1 subgoal):
 1. netmap (SubnetS s1 s2) = f
[PROOF STEP]
by simp (metis map_add_le_mapI map_le_antisym map_le_map_add map_le_refl)


[STATEMENT]
lemma telescope_sums:
  fixes c :: "'a::real_normed_vector"
  assumes "f \<longlonglongrightarrow> c"
  shows "(\<lambda>n. f (Suc n) - f n) sums (c - f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f (Suc n) - f n) sums (c - f 0)
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>n<n. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
proof (subst filterlim_sequentially_Suc [symmetric])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<Suc x. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
have "(\<lambda>n. \<Sum>k<Suc n. f (Suc k) - f k) = (\<lambda>n. f (Suc n) - f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k<Suc n. f (Suc k) - f k) = (\<lambda>n. f (Suc n) - f 0)
[PROOF STEP]
by (simp add: lessThan_Suc_atMost atLeast0AtMost [symmetric] sum_Suc_diff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<Suc n. f (Suc k) - f k) = (\<lambda>n. f (Suc n) - f 0)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<Suc x. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k<Suc n. f (Suc k) - f k) = (\<lambda>n. f (Suc n) - f 0)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<Suc x. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
have "\<dots> \<longlonglongrightarrow> c - f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f (Suc n) - f 0) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
by (intro tendsto_diff LIMSEQ_Suc[OF assms] tendsto_const)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f (Suc n) - f 0) \<longlonglongrightarrow> c - f 0

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<Suc x. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>k<Suc n. f (Suc k) - f k) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
show "(\<lambda>n. \<Sum>n<Suc n. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>k<Suc n. f (Suc k) - f k) \<longlonglongrightarrow> c - f 0

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>n<Suc n. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>n<Suc n. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lowner_le_inner_prod_le:
  fixes A B :: "complex mat" and v :: "complex vec"
  assumes A: "A \<in> carrier_mat n n" and B: "B \<in> carrier_mat n n"
    and v: "v \<in> carrier_vec n"
    and "A \<le>\<^sub>L B"
  shows "inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
v \<in> carrier_vec n
A \<le>\<^sub>L B
[PROOF STEP]
have "positive (B-A)"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
v \<in> carrier_vec n
A \<le>\<^sub>L B

goal (1 subgoal):
 1. positive (B - A)
[PROOF STEP]
by (auto simp add: lowner_le_def)
[PROOF STATE]
proof (state)
this:
positive (B - A)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
v \<in> carrier_vec n
A \<le>\<^sub>L B
positive (B - A)
[PROOF STEP]
have geq: "inner_prod v ((B-A) *\<^sub>v v) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
v \<in> carrier_vec n
A \<le>\<^sub>L B
positive (B - A)

goal (1 subgoal):
 1. 0 \<le> inner_prod v ((B - A) *\<^sub>v v)
[PROOF STEP]
unfolding positive_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
v \<in> carrier_vec n
A \<le>\<^sub>L B
B - A \<in> carrier_mat (dim_col (B - A)) (dim_col (B - A)) \<and> (\<forall>v. dim_vec v = dim_col (B - A) \<longrightarrow> 0 \<le> inner_prod v ((B - A) *\<^sub>v v))

goal (1 subgoal):
 1. 0 \<le> inner_prod v ((B - A) *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod v ((B - A) *\<^sub>v v)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)
[PROOF STEP]
have "inner_prod v ((B-A) *\<^sub>v v) = inner_prod v (B *\<^sub>v v) - inner_prod v (A *\<^sub>v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod v ((B - A) *\<^sub>v v) = inner_prod v (B *\<^sub>v v) - inner_prod v (A *\<^sub>v v)
[PROOF STEP]
unfolding minus_add_uminus_mat[OF B A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod v ((B + - A) *\<^sub>v v) = inner_prod v (B *\<^sub>v v) - inner_prod v (A *\<^sub>v v)
[PROOF STEP]
by (subst add_mult_distrib_mat_vec[OF B _ v], insert A B v, auto simp add: inner_prod_distrib_right[OF v])
[PROOF STATE]
proof (state)
this:
inner_prod v ((B - A) *\<^sub>v v) = inner_prod v (B *\<^sub>v v) - inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inner_prod v ((B - A) *\<^sub>v v) = inner_prod v (B *\<^sub>v v) - inner_prod v (A *\<^sub>v v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inner_prod v ((B - A) *\<^sub>v v) = inner_prod v (B *\<^sub>v v) - inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)
[PROOF STEP]
using geq
[PROOF STATE]
proof (prove)
using this:
inner_prod v ((B - A) *\<^sub>v v) = inner_prod v (B *\<^sub>v v) - inner_prod v (A *\<^sub>v v)
0 \<le> inner_prod v ((B - A) *\<^sub>v v)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod v (A *\<^sub>v v) \<le> inner_prod v (B *\<^sub>v v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  discounted_adapted:
  assumes "borel_adapt_stoch_proc F X"
  shows "borel_adapt_stoch_proc F (discounted_value r X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel_adapt_stoch_proc F (discounted_value r X)
[PROOF STEP]
unfolding adapt_stoch_proc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t. discounted_value r X t \<in> borel_measurable (F t)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. discounted_value r X t \<in> borel_measurable (F t)
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. discounted_value r X t \<in> borel_measurable (F t)
[PROOF STEP]
show "discounted_value r X t \<in> borel_measurable (F t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. discounted_value r X t \<in> borel_measurable (F t)
[PROOF STEP]
unfolding discounted_value_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. discount_factor r t w * X t w) \<in> borel_measurable (F t)
[PROOF STEP]
proof (rule borel_measurable_times)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. discount_factor r t \<in> borel_measurable (F t)
 2. X t \<in> borel_measurable (F t)
[PROOF STEP]
show "X t \<in> borel_measurable (F t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X t \<in> borel_measurable (F t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
borel_adapt_stoch_proc F X

goal (1 subgoal):
 1. X t \<in> borel_measurable (F t)
[PROOF STEP]
unfolding adapt_stoch_proc_def
[PROOF STATE]
proof (prove)
using this:
\<forall>t. X t \<in> borel_measurable (F t)

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

goal (1 subgoal):
 1. discount_factor r t \<in> borel_measurable (F t)
[PROOF STEP]
show "discount_factor r t \<in> borel_measurable (F t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. discount_factor r t \<in> borel_measurable (F t)
[PROOF STEP]
using discount_factor_borel_measurable
[PROOF STATE]
proof (prove)
using this:
discount_factor ?r ?n \<in> borel_measurable ?M

goal (1 subgoal):
 1. discount_factor r t \<in> borel_measurable (F t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
discount_factor r t \<in> borel_measurable (F t)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
discounted_value r X t \<in> borel_measurable (F t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_interior_affine_hull [simp]:
  fixes S :: "'n::euclidean_space set"
  shows "rel_interior (affine hull S) = affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
have *: "rel_interior (affine hull S) \<subseteq> affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (affine hull S) \<subseteq> affine hull S
[PROOF STEP]
using rel_interior_subset
[PROOF STATE]
proof (prove)
using this:
rel_interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. rel_interior (affine hull S) \<subseteq> affine hull S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior (affine hull S) \<subseteq> affine hull S

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
rel_interior (affine hull S) \<subseteq> affine hull S

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
assume x: "x \<in> affine hull S"
[PROOF STATE]
proof (state)
this:
x \<in> affine hull S

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
define e :: real where "e = 1"
[PROOF STATE]
proof (state)
this:
e = 1

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e = 1
[PROOF STEP]
have "e > 0" "ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S"
[PROOF STATE]
proof (prove)
using this:
e = 1

goal (1 subgoal):
 1. 0 < e &&& ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S
[PROOF STEP]
using hull_hull[of _ S]
[PROOF STATE]
proof (prove)
using this:
e = 1
?S hull (?S hull S) = ?S hull S

goal (1 subgoal):
 1. 0 < e &&& ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S
[PROOF STEP]
have "x \<in> rel_interior (affine hull S)"
[PROOF STATE]
proof (prove)
using this:
0 < e
ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S

goal (1 subgoal):
 1. x \<in> rel_interior (affine hull S)
[PROOF STEP]
using x rel_interior_ball[of "affine hull S"]
[PROOF STATE]
proof (prove)
using this:
0 < e
ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S
x \<in> affine hull S
rel_interior (affine hull S) = {x \<in> affine hull S. \<exists>e>0. ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S}

goal (1 subgoal):
 1. x \<in> rel_interior (affine hull S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> rel_interior (affine hull S)

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> affine hull S \<Longrightarrow> ?x2 \<in> rel_interior (affine hull S)

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2 \<in> affine hull S \<Longrightarrow> ?x2 \<in> rel_interior (affine hull S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> affine hull S \<Longrightarrow> ?x2 \<in> rel_interior (affine hull S)

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> affine hull S \<Longrightarrow> ?x2 \<in> rel_interior (affine hull S)
rel_interior (affine hull S) \<subseteq> affine hull S

goal (1 subgoal):
 1. rel_interior (affine hull S) = affine hull S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior (affine hull S) = affine hull S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_alg_set_insert:
"affine_alg_set R n (insert a A) = zero_set R n a \<inter> (affine_alg_set R n A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_alg_set R n (insert a A) = V n a \<inter> affine_alg_set R n A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. affine_alg_set R n (insert a A) \<subseteq> V n a \<inter> affine_alg_set R n A
 2. V n a \<inter> affine_alg_set R n A \<subseteq> affine_alg_set R n (insert a A)
[PROOF STEP]
show "affine_alg_set R n (insert a A) \<subseteq> V\<^bsub>R\<^esub> n a \<inter> affine_alg_set R n A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_alg_set R n (insert a A) \<subseteq> V n a \<inter> affine_alg_set R n A
[PROOF STEP]
using affine_alg_set_subset
[PROOF STATE]
proof (prove)
using this:
?as \<subseteq> ?bs \<Longrightarrow> affine_alg_set R ?n ?bs \<subseteq> affine_alg_set R ?n ?as

goal (1 subgoal):
 1. affine_alg_set R n (insert a A) \<subseteq> V n a \<inter> affine_alg_set R n A
[PROOF STEP]
by (metis Int_greatest affine_alg_set_subset_zero_set insertI1 subset_insertI)
[PROOF STATE]
proof (state)
this:
affine_alg_set R n (insert a A) \<subseteq> V n a \<inter> affine_alg_set R n A

goal (1 subgoal):
 1. V n a \<inter> affine_alg_set R n A \<subseteq> affine_alg_set R n (insert a A)
[PROOF STEP]
show "V\<^bsub>R\<^esub> n a \<inter> affine_alg_set R n A \<subseteq> affine_alg_set R n (insert a A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V n a \<inter> affine_alg_set R n A \<subseteq> affine_alg_set R n (insert a A)
[PROOF STEP]
unfolding affine_alg_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V n a \<inter> {a \<in> carrier (R\<^bsup>n\<^esup>). \<forall>b\<in>A. a \<in> V n b} \<subseteq> {aa \<in> carrier (R\<^bsup>n\<^esup>). \<forall>b\<in>insert a A. aa \<in> V n b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
V n a \<inter> affine_alg_set R n A \<subseteq> affine_alg_set R n (insert a A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VSagree_UNIV_eq:"VSagree A B UNIV \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VSagree A B UNIV \<Longrightarrow> A = B
[PROOF STEP]
unfolding VSagree_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>UNIV. A $ i = B $ i \<Longrightarrow> A = B
[PROOF STEP]
by (auto simp add: vec_eq_iff)


[STATEMENT]
lemma homologous_rel_restrict [simp]:
   "homologous_rel p X (topspace X \<inter> S) = homologous_rel p X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homologous_rel p X (topspace X \<inter> S) = homologous_rel p X S
[PROOF STEP]
unfolding homologous_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a b. singular_relboundary p X (topspace X \<inter> S) (a - b)) = (\<lambda>a b. singular_relboundary p X S (a - b))
[PROOF STEP]
by (metis singular_relboundary_restrict)


[STATEMENT]
lemma principal_dchar_minus1 [simp]: "principal_dchar n (n - Suc 0) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. principal_dchar n (n - Suc 0) = 1
[PROOF STEP]
using principal_dchar_minus1[of n] n
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> principal_dchar n (n - Suc 0) = 1
1 < n

goal (1 subgoal):
 1. principal_dchar n (n - Suc 0) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma aless_nat_less:"(an n < an m) = (n < m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (an n < an m) = (n < m)
[PROOF STEP]
by (simp add:an_def, subst aless_zless[of "int n" "int m"], simp)


[STATEMENT]
lemma ex1_unique: "\<exists>!x. P x \<Longrightarrow> P a \<Longrightarrow> P b \<Longrightarrow> a=b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>!x. P x; P a; P b\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
by blast


[STATEMENT]
lemma eulerian_poly:
  "fps_of_poly (eulerian_poly k :: 'a :: field poly) =
     Abs_fps (\<lambda>n. of_nat (n+1) ^ k) * (1 - fps_X) ^ (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1)
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fps_of_poly (eulerian_poly 0) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ 0) * (1 - fps_X) ^ (0 + 1)
 2. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. fps_of_poly (eulerian_poly 0) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ 0) * (1 - fps_X) ^ (0 + 1)
 2. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
have "Abs_fps (\<lambda>_. 1 :: 'a) = inverse (1 - fps_X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>_. 1::'a) = inverse (1 - fps_X)
[PROOF STEP]
by (rule fps_inverse_unique [symmetric])
       (simp add: inverse_mult_eq_1 fps_inverse_gp' [symmetric])
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>_. 1::'a) = inverse (1 - fps_X)

goal (2 subgoals):
 1. fps_of_poly (eulerian_poly 0) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ 0) * (1 - fps_X) ^ (0 + 1)
 2. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Abs_fps (\<lambda>_. 1::'a) = inverse (1 - fps_X)

goal (1 subgoal):
 1. fps_of_poly (eulerian_poly 0) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ 0) * (1 - fps_X) ^ (0 + 1)
[PROOF STEP]
by (simp add: inverse_mult_eq_1)
[PROOF STATE]
proof (state)
this:
fps_of_poly (eulerian_poly 0) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ 0) * (1 - fps_X) ^ (0 + 1)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
define p :: "'a fps" where "p = fps_of_poly (eulerian_poly k)"
[PROOF STATE]
proof (state)
this:
p = fps_of_poly (eulerian_poly k)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
define F :: "'a fps" where "F = Abs_fps (\<lambda>n. of_nat (n+1) ^ k)"
[PROOF STATE]
proof (state)
this:
F = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
have p: "p = F * (1 - fps_X) ^ (k+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = F * (1 - fps_X) ^ (k + 1)
[PROOF STEP]
by (simp add: p_def Suc F_def)
[PROOF STATE]
proof (state)
this:
p = F * (1 - fps_X) ^ (k + 1)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
have p': "fps_deriv p = fps_deriv F * (1 - fps_X) ^ (k + 1) - F * (1 - fps_X) ^ k * of_nat (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv p = fps_deriv F * (1 - fps_X) ^ (k + 1) - F * (1 - fps_X) ^ k * of_nat (k + 1)
[PROOF STEP]
by (simp add: p fps_deriv_power algebra_simps fps_const_neg [symmetric] fps_of_nat
             del: power_Suc of_nat_Suc fps_const_neg)
[PROOF STATE]
proof (state)
this:
fps_deriv p = fps_deriv F * (1 - fps_X) ^ (k + 1) - F * (1 - fps_X) ^ k * of_nat (k + 1)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
have "fps_of_poly (eulerian_poly (Suc k)) = (fps_X * fps_deriv F + F) * (1 - fps_X) ^ (Suc k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (eulerian_poly (Suc k)) = (fps_X * fps_deriv F + F) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
apply (simp add: Let_def p_def [symmetric] fps_of_poly_simps eulerian_poly_Suc del: power_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_deriv p - fps_deriv p * fps_X) * fps_X + (p + fps_const (of_nat k) * p * fps_X) = (fps_X * fps_deriv F + F) * (1 - fps_X) ^ Suc (Suc k)
[PROOF STEP]
apply (simp add: p p' fps_deriv_power fps_const_neg [symmetric] fps_of_nat
                del: power_Suc of_nat_Suc fps_const_neg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_deriv F * (1 - fps_X) ^ Suc k - F * (of_nat (Suc k) * (1 - fps_X) ^ k) - (fps_deriv F * (1 - fps_X) ^ Suc k - F * (of_nat (Suc k) * (1 - fps_X) ^ k)) * fps_X) * fps_X + (F * (1 - fps_X) ^ Suc k + of_nat k * (F * (1 - fps_X) ^ Suc k) * fps_X) = (fps_X * fps_deriv F + F) * (1 - fps_X) ^ Suc (Suc k)
[PROOF STEP]
apply (simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
fps_of_poly (eulerian_poly (Suc k)) = (fps_X * fps_deriv F + F) * (1 - fps_X) ^ (Suc k + 1)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_of_poly (eulerian_poly (Suc k)) = (fps_X * fps_deriv F + F) * (1 - fps_X) ^ (Suc k + 1)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
have "fps_X * fps_deriv F + F = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_X * fps_deriv F + F = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k)
[PROOF STEP]
unfolding F_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_X * fps_deriv (Abs_fps (\<lambda>n. of_nat (n + 1) ^ k)) + Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k)
[PROOF STEP]
by (intro fps_ext) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
fps_X * fps_deriv F + F = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k)

goal (1 subgoal):
 1. \<And>k. fps_of_poly (eulerian_poly k) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ k) * (1 - fps_X) ^ (k + 1) \<Longrightarrow> fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fps_of_poly (eulerian_poly (Suc k)) = Abs_fps (\<lambda>n. of_nat (n + 1) ^ Suc k) * (1 - fps_X) ^ (Suc k + 1)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "reflexive aRel \<and> euclidean aRel  \<Longrightarrow>  \<lfloor>M\<rfloor> \<and> \<lfloor>V\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflexive (r) \<and> euclidean (r) \<Longrightarrow> \<lfloor>(\<lambda>w. \<forall>x. (\<^bold>\<box>x \<^bold>\<rightarrow> x) w)\<rfloor> \<and> \<lfloor>(\<lambda>w. \<forall>x. (\<^bold>\<diamond>x \<^bold>\<rightarrow> \<^bold>\<box>\<^bold>\<diamond>x) w)\<rfloor>
[PROOF STEP]
by blast \<comment> \<open>S5\<close>


[STATEMENT]
lemma "(10::int) mod -3 = -2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 10 mod - 3 = - 2
[PROOF STEP]
by simp


[STATEMENT]
lemma "(X = Y \<inter> Z) =
    (X \<subseteq> Y \<and> X \<subseteq> Z \<and> (\<forall>V. V \<subseteq> Y \<and> V \<subseteq> Z \<longrightarrow> V \<subseteq> X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X = Y \<inter> Z) = (X \<subseteq> Y \<and> X \<subseteq> Z \<and> (\<forall>V. V \<subseteq> Y \<and> V \<subseteq> Z \<longrightarrow> V \<subseteq> X))
[PROOF STEP]
by blast


[STATEMENT]
lemma independent_vnmD1:
  assumes "independent_vnm C P"
  shows "(\<forall>p \<in> C. \<forall>q \<in> C. \<forall>r \<in> C. \<forall>\<alpha> \<in> {0<..1}. p \<succeq>[P] q \<longleftrightarrow> mix_pmf \<alpha> p r \<succeq>[P] mix_pmf \<alpha> q r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>C. \<forall>q\<in>C. \<forall>r\<in>C. \<forall>\<alpha>\<in>{0<..1}. p \<succeq>[P] q = mix_pmf \<alpha> p r \<succeq>[P] mix_pmf \<alpha> q r
[PROOF STEP]
using assms independent_vnm_def
[PROOF STATE]
proof (prove)
using this:
independent_vnm C P
independent_vnm ?C ?P = (\<forall>p\<in>?C. \<forall>q\<in>?C. \<forall>r\<in>?C. \<forall>\<alpha>\<in>{0<..1}. p \<succeq>[?P] q = mix_pmf \<alpha> p r \<succeq>[?P] mix_pmf \<alpha> q r)

goal (1 subgoal):
 1. \<forall>p\<in>C. \<forall>q\<in>C. \<forall>r\<in>C. \<forall>\<alpha>\<in>{0<..1}. p \<succeq>[P] q = mix_pmf \<alpha> p r \<succeq>[P] mix_pmf \<alpha> q r
[PROOF STEP]
by blast


[STATEMENT]
lemma bres_sol: "(x \<cdot> (x \<rightarrow> y) = y) = (\<exists>z. x \<cdot> z = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<cdot> (x \<rightarrow> y) = y) = (\<exists>z. x \<cdot> z = y)
[PROOF STEP]
using bres_galois order.antisym mult_isol
[PROOF STATE]
proof (prove)
using this:
(?x \<cdot> ?y \<le> ?z) = (?y \<le> ?x \<rightarrow> ?z)
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b
?x \<le> ?y \<Longrightarrow> ?z \<cdot> ?x \<le> ?z \<cdot> ?y

goal (1 subgoal):
 1. (x \<cdot> (x \<rightarrow> y) = y) = (\<exists>z. x \<cdot> z = y)
[PROOF STEP]
by force


[STATEMENT]
lemma defensive_strategy_Even:
  assumes "\<not> winning_position_Odd p"
  shows "\<not> winning_position_Odd (((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o)) ^^ n) p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> winning_position_Odd p

goal (1 subgoal):
 1. \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) p)
[PROOF STEP]
proof(induct n arbitrary:p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<not> winning_position_Odd p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ 0) p)
 2. \<And>n p. \<lbrakk>\<And>p. \<not> winning_position_Odd p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) p); \<not> winning_position_Odd p\<rbrakk> \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<not> winning_position_Odd ?p1 \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) ?p1)
\<not> winning_position_Odd p

goal (2 subgoals):
 1. \<And>p. \<not> winning_position_Odd p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ 0) p)
 2. \<And>n p. \<lbrakk>\<And>p. \<not> winning_position_Odd p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) p); \<not> winning_position_Odd p\<rbrakk> \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
proof(cases "position p")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
 2. \<not> position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
position p

goal (2 subgoals):
 1. position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
 2. \<not> position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
from Suc.prems defensive_move_exists_for_Even[OF True] defensive_strategy_Even_def someI
[PROOF STATE]
proof (chain)
picking this:
\<not> winning_position_Odd p
winning_position_Odd p \<or> (\<exists>m. move_defensive_by_Even m p)
defensive_strategy_Even ?p \<equiv> SOME m. move_defensive_by_Even m ?p
?P ?x \<Longrightarrow> ?P (Eps ?P)
[PROOF STEP]
have "move_defensive_by_Even (defensive_strategy_Even p) p"
[PROOF STATE]
proof (prove)
using this:
\<not> winning_position_Odd p
winning_position_Odd p \<or> (\<exists>m. move_defensive_by_Even m p)
defensive_strategy_Even ?p \<equiv> SOME m. move_defensive_by_Even m ?p
?P ?x \<Longrightarrow> ?P (Eps ?P)

goal (1 subgoal):
 1. move_defensive_by_Even (defensive_strategy_Even p) p
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
move_defensive_by_Even (defensive_strategy_Even p) p

goal (2 subgoals):
 1. position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
 2. \<not> position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
from this[unfolded move_defensive_by_Even_def] Suc.prems
           non_winning_moves_remains_non_winning_Odd[of p]
[PROOF STATE]
proof (chain)
picking this:
even (length p) \<longrightarrow> \<not> winning_position_Odd (augment_list defensive_strategy_Even p)
\<not> winning_position_Odd p
\<lbrakk>odd (length p); \<forall>\<sigma>. \<not> strategy_winning_by_Odd \<sigma> p\<rbrakk> \<Longrightarrow> \<not> strategy_winning_by_Odd ?\<sigma> (p @ [?m])
[PROOF STEP]
have "\<not> winning_position_Odd (p @ [joint_strategy defensive_strategy_Even \<sigma>\<^sub>o p])"
[PROOF STATE]
proof (prove)
using this:
even (length p) \<longrightarrow> \<not> winning_position_Odd (augment_list defensive_strategy_Even p)
\<not> winning_position_Odd p
\<lbrakk>odd (length p); \<forall>\<sigma>. \<not> strategy_winning_by_Odd \<sigma> p\<rbrakk> \<Longrightarrow> \<not> strategy_winning_by_Odd ?\<sigma> (p @ [?m])

goal (1 subgoal):
 1. \<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p)
[PROOF STEP]
by (simp add: joint_strategy_def True)
[PROOF STATE]
proof (state)
this:
\<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p)

goal (2 subgoals):
 1. position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
 2. \<not> position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
with Suc.hyps[of "p @ [joint_strategy defensive_strategy_Even \<sigma>\<^sub>o p]"]
[PROOF STATE]
proof (chain)
picking this:
\<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p) \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p))
\<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p) \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p))
\<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p)

goal (1 subgoal):
 1. \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
unfolding funpow_Suc_right comp_def
[PROOF STATE]
proof (prove)
using this:
\<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p) \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p))
\<not> winning_position_Odd (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p)

goal (1 subgoal):
 1. \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) (augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) p))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)

goal (1 subgoal):
 1. \<not> position p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)
[PROOF STEP]
qed (insert position_augment,blast)
[PROOF STATE]
proof (state)
this:
\<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ Suc n) p)

goal (1 subgoal):
 1. \<And>p. \<not> winning_position_Odd p \<Longrightarrow> \<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ 0) p)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<not> winning_position_Odd ((augment_list (joint_strategy defensive_strategy_Even \<sigma>\<^sub>o) ^^ n) p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma partial_pullback_intersect:
"partial_pullback m f l (S1 \<inter> S2) = (partial_pullback m f l S1) \<inter> (partial_pullback m f l S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_pullback m f l (S1 \<inter> S2) = partial_pullback m f l S1 \<inter> partial_pullback m f l S2
[PROOF STEP]
unfolding partial_pullback_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_fields.partial_image m f \<inverse>\<^bsub>m + l\<^esub> (S1 \<inter> S2) = padic_fields.partial_image m f \<inverse>\<^bsub>m + l\<^esub> S1 \<inter> padic_fields.partial_image m f \<inverse>\<^bsub>m + l\<^esub> S2
[PROOF STEP]
by simp


[STATEMENT]
lemma int_of_integer_mult: "int_of_integer (x * y) = (int_of_integer x * int_of_integer y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_integer (x * y) = int_of_integer x * int_of_integer y
[PROOF STEP]
by simp


[STATEMENT]
lemma decompress_compress:
  assumes "x\<in>{0..<q}"
          "of_nat d < \<lceil>(log 2 q)::real\<rceil>"
          "d>0"
  shows "let x' = decompress d (compress d x) in
         abs ((x' - x) mod+- q) \<le>
          round ( real_of_int q / real_of_int (2^(d+1)) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
proof (cases "x<\<lceil>q-(q/(2*2^d))\<rceil>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
 2. \<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (2 subgoals):
 1. x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
 2. \<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
have range_x: "x\<in>{0..\<lceil>q-(q/(2*2^d))\<rceil>-1}"
[PROOF STATE]
proof (prove)
using this:
x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (1 subgoal):
 1. x \<in> {0..\<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> - 1}
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
x \<in> {0..<q}

goal (1 subgoal):
 1. x \<in> {0..\<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {0..\<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> - 1}

goal (2 subgoals):
 1. x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
 2. \<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>(decompress d (compress d x) - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
using decompress_compress_no_mod_plus_minus[OF
    range_x assms(2) assms(3)]
[PROOF STATE]
proof (prove)
using this:
\<bar>(decompress d (compress d x) - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))

goal (1 subgoal):
 1. \<bar>(decompress d (compress d x) - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))

goal (1 subgoal):
 1. \<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (1 subgoal):
 1. \<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
have range_x: "x\<in>{\<lceil>q-(q/(2*2^d))\<rceil>..q-1}"
[PROOF STATE]
proof (prove)
using this:
\<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (1 subgoal):
 1. x \<in> {\<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>..q - 1}
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
\<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
x \<in> {0..<q}

goal (1 subgoal):
 1. x \<in> {\<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>..q - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {\<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>..q - 1}

goal (1 subgoal):
 1. \<not> x < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> \<Longrightarrow> let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>(decompress d (compress d x) - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
using decompress_compress_mod[OF range_x assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<bar>(decompress d (compress d x) - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))

goal (1 subgoal):
 1. \<bar>(decompress d (compress d x) - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
let x' = decompress d (compress d x) in \<bar>(x' - x) mod+- q\<bar> \<le> round (real_of_int q / real_of_int (2 ^ (d + 1)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma euler_64:
  "\<bar>exp 1 - 50143449209799256683 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp 1 - 50143449209799256683 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64)
[PROOF STEP]
by (rule approx_coarsen[OF euler_128]) simp_all


[STATEMENT]
lemma to_fun_unit_eq:
  assumes "f \<in> carrier (SA n)"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f x \<noteq> \<zero>"
  shows "to_fun_unit n f x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun_unit n f x = f x
[PROOF STEP]
unfolding to_fun_unit_def fun_glue_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). if x \<in> {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>} then f x else \<one>\<^bsub>SA n\<^esub> x) x = f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f x \<noteq> \<zero>

goal (1 subgoal):
 1. (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). if x \<in> {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>} then f x else \<one>\<^bsub>SA n\<^esub> x) x = f x
[PROOF STEP]
by simp


[STATEMENT]
lemma gt_0_lt_mult_gt_1_zhmset:
  fixes m n :: zhmultiset
  assumes "m > 0" and "n > 1"
  shows "m < m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < m * n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
1 < n

goal (1 subgoal):
 1. m < m * n
[PROOF STEP]
by simp


[STATEMENT]
lemma path_connectedin_imp_connectedin:
     "path_connectedin X S \<Longrightarrow> connectedin X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin X S \<Longrightarrow> connectedin X S
[PROOF STEP]
by (simp add: connectedin_def path_connected_imp_connected_space path_connectedin_def)


[STATEMENT]
lemma iprev_nth_atLeastAtMost: "\<lbrakk> a \<le> n - m; m \<le> n \<rbrakk> \<Longrightarrow> {m..n} \<leftarrow> a = n - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> n - m; m \<le> n\<rbrakk> \<Longrightarrow> {m..n} \<leftarrow> a = n - a
[PROOF STEP]
apply (induct a, simp add: Max_atLeastAtMost)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>\<lbrakk>a \<le> n - m; m \<le> n\<rbrakk> \<Longrightarrow> {m..n} \<leftarrow> a = n - a; Suc a \<le> n - m; m \<le> n\<rbrakk> \<Longrightarrow> {m..n} \<leftarrow> Suc a = n - Suc a
[PROOF STEP]
apply (simp add: iprev_atLeastAtMost)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma spmf_conv_measure_spmf: "spmf p x = measure (measure_spmf p) {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spmf p x = Sigma_Algebra.measure (measure_spmf p) {x}
[PROOF STEP]
by(auto simp add: measure_spmf_def measure_distr measure_restrict_space pmf.rep_eq space_restrict_space intro: arg_cong2[where f=measure])


[STATEMENT]
lemma fps_X_power_nth[simp]: "(fps_X^k) $n = (if n = k then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_X ^ k $ n = (if n = k then 1::'a else (0::'a))
[PROOF STEP]
by (simp add: fps_X_power_iff)


[STATEMENT]
lemma R_loopI:
  "X \<le> rel_R \<lceil>I\<rceil> \<lceil>I\<rceil> \<Longrightarrow> \<lceil>P\<rceil> \<le> \<lceil>I\<rceil> \<Longrightarrow> \<lceil>I\<rceil> \<le> \<lceil>Q\<rceil> \<Longrightarrow> LOOP X INV I \<le> rel_R \<lceil>P\<rceil> \<lceil>Q\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> rel_R \<lceil>I\<rceil> \<lceil>I\<rceil>; \<lceil>P\<rceil> \<subseteq> \<lceil>I\<rceil>; \<lceil>I\<rceil> \<subseteq> \<lceil>Q\<rceil>\<rbrakk> \<Longrightarrow> LOOP X INV I  \<subseteq> rel_R \<lceil>P\<rceil> \<lceil>Q\<rceil>
[PROOF STEP]
unfolding rel_rkat.spec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<^bold>{I\<^bold>}X\<^bold>{I\<^bold>}; \<lceil>P\<rceil> \<subseteq> \<lceil>I\<rceil>; \<lceil>I\<rceil> \<subseteq> \<lceil>Q\<rceil>\<rbrakk> \<Longrightarrow> \<^bold>{P\<^bold>}LOOP X INV I \<^bold>{Q\<^bold>}
[PROOF STEP]
using H_loopI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<^bold>{?I\<^bold>}?X\<^bold>{?I\<^bold>}; \<lceil>?P\<rceil> \<subseteq> \<lceil>?I\<rceil>; \<lceil>?I\<rceil> \<subseteq> \<lceil>?Q\<rceil>\<rbrakk> \<Longrightarrow> \<^bold>{?P\<^bold>}LOOP ?X INV ?I \<^bold>{?Q\<^bold>}

goal (1 subgoal):
 1. \<lbrakk>\<^bold>{I\<^bold>}X\<^bold>{I\<^bold>}; \<lceil>P\<rceil> \<subseteq> \<lceil>I\<rceil>; \<lceil>I\<rceil> \<subseteq> \<lceil>Q\<rceil>\<rbrakk> \<Longrightarrow> \<^bold>{P\<^bold>}LOOP X INV I \<^bold>{Q\<^bold>}
[PROOF STEP]
by blast


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


[STATEMENT]
lemma surj_swap_iff: "surj (Fun.swap a b f) \<longleftrightarrow> surj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj (f \<circ> Transposition.transpose a b) = surj f
[PROOF STEP]
by (metis fun.set_map surj_transpose)


[STATEMENT]
lemma ennexp_le1 [simp]:
  "ennexp x \<le> 1 \<longleftrightarrow> x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ennexp x \<le> 1) = (x \<le> 0)
[PROOF STEP]
by (metis ennexp_0 ennexp_mono2 ennexp_strict_mono eq_iff le_cases strict_mono_eq)


[STATEMENT]
lemma mat_of_cols_Cons_index_0: "i < n \<Longrightarrow> mat_of_cols n (w # ws) $$ (i, 0) = w $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> mat_of_cols n (w # ws) $$ (i, 0) = w $ i
[PROOF STEP]
by (unfold mat_of_cols_def, transfer', auto simp: mk_mat_def)


[STATEMENT]
lemma strict_subtuple_rtranclp_intro:
  assumes "\<And>xm ym. R (f xm) (f ym) \<Longrightarrow>
           strict_subtuple (\<lambda>x y. R x y \<or> x = y) xm ym"
      and "bij_on_trancl R f"
      and "acyclicP_on (fmran' ym) R"
      and "R\<^sup>+\<^sup>+ (f xm) (f ym)"
    shows "strict_subtuple R\<^sup>*\<^sup>* xm ym"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_subtuple R\<^sup>*\<^sup>* xm ym
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. strict_subtuple R\<^sup>*\<^sup>* xm ym
[PROOF STEP]
have "(\<lambda>xm ym. R (f xm) (f ym))\<^sup>+\<^sup>+ xm ym"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xm ym. R (f xm) (f ym))\<^sup>+\<^sup>+ xm ym
[PROOF STEP]
apply (insert assms(1) assms(2) assms(4))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>xm ym. R (f xm) (f ym) \<Longrightarrow> strict_subtuple (\<lambda>x y. R x y \<or> x = y) xm ym; bij_on_trancl R f; R\<^sup>+\<^sup>+ (f xm) (f ym)\<rbrakk> \<Longrightarrow> (\<lambda>xm ym. R (f xm) (f ym))\<^sup>+\<^sup>+ xm ym
[PROOF STEP]
by (rule reflect_tranclp; auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>xm ym. R (f xm) (f ym))\<^sup>+\<^sup>+ xm ym

goal (1 subgoal):
 1. strict_subtuple R\<^sup>*\<^sup>* xm ym
[PROOF STEP]
hence "(strict_subtuple (\<lambda>x y. R x y \<or> x = y))\<^sup>+\<^sup>+ xm ym"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xm ym. R (f xm) (f ym))\<^sup>+\<^sup>+ xm ym

goal (1 subgoal):
 1. (strict_subtuple (\<lambda>x y. R x y \<or> x = y))\<^sup>+\<^sup>+ xm ym
[PROOF STEP]
by (rule tranclp_trans_induct;
        auto simp add: assms(1) tranclp.r_into_trancl)
[PROOF STATE]
proof (state)
this:
(strict_subtuple (\<lambda>x y. R x y \<or> x = y))\<^sup>+\<^sup>+ xm ym

goal (1 subgoal):
 1. strict_subtuple R\<^sup>*\<^sup>* xm ym
[PROOF STEP]
with assms(3)
[PROOF STATE]
proof (chain)
picking this:
acyclicP_on (fmran' ym) R
(strict_subtuple (\<lambda>x y. R x y \<or> x = y))\<^sup>+\<^sup>+ xm ym
[PROOF STEP]
have "strict_subtuple (\<lambda>x y. R x y \<or> x = y)\<^sup>*\<^sup>* xm ym"
[PROOF STATE]
proof (prove)
using this:
acyclicP_on (fmran' ym) R
(strict_subtuple (\<lambda>x y. R x y \<or> x = y))\<^sup>+\<^sup>+ xm ym

goal (1 subgoal):
 1. strict_subtuple (\<lambda>x y. R x y \<or> x = y)\<^sup>*\<^sup>* xm ym
[PROOF STEP]
by (rule trancl_to_strict_subtuple')
[PROOF STATE]
proof (state)
this:
strict_subtuple (\<lambda>x y. R x y \<or> x = y)\<^sup>*\<^sup>* xm ym

goal (1 subgoal):
 1. strict_subtuple R\<^sup>*\<^sup>* xm ym
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
strict_subtuple (\<lambda>x y. R x y \<or> x = y)\<^sup>*\<^sup>* xm ym

goal (1 subgoal):
 1. strict_subtuple R\<^sup>*\<^sup>* xm ym
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
strict_subtuple R\<^sup>*\<^sup>* xm ym

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Units_nonzero_Qp:
assumes "u \<in> Units Q\<^sub>p"
shows "u \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> nonzero Q\<^sub>p
[PROOF STEP]
by (simp add: Qp.Units_nonzero assms)


[STATEMENT]
lemma project_leadsTo_D:
     "F\<squnion>project h UNIV G \<in> A leadsTo B
      ==> extend h F\<squnion>G \<in> (extend_set h A) leadsTo (extend_set h B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<squnion> project h UNIV G \<in> A \<longmapsto> B \<Longrightarrow> extend h F \<squnion> G \<in> extend_set h A \<longmapsto> extend_set h B
[PROOF STEP]
apply (rule_tac C1 = UNIV in project_leadsTo_D_lemma [THEN leadsTo_weaken], auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma trcl_uncons_cases: "\<lbrakk>
    (c,e#w,c')\<in>trcl S;
    !!ch. \<lbrakk> (c,e,ch)\<in>S; (ch,w,c')\<in>trcl S \<rbrakk> \<Longrightarrow> P
  \<rbrakk> \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, e # w, c') \<in> trcl S; \<And>ch. \<lbrakk>(c, e, ch) \<in> S; (ch, w, c') \<in> trcl S\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (blast dest: trcl_uncons)


[STATEMENT]
lemma hv_him: "Hv(HIm q) = Octo 0 (Im1 q) (Im2 q) (Im3 q)  (Im4 q) (Im5 q) (Im6 q)  (Im7 q)  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hv (HIm q) = Octo 0 (Im1 q) (Im2 q) (Im3 q) (Im4 q) (Im5 q) (Im6 q) (Im7 q)
[PROOF STEP]
by (simp add: HIm_def)


[STATEMENT]
lemma satPB_o:
"satPB (int \<xi> o \<rho>) \<Phi> = satPB \<xi> (substPB \<rho> \<Phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. satPB (int \<xi> \<circ> \<rho>) \<Phi> = satPB \<xi> (substPB \<rho> \<Phi>)
[PROOF STEP]
using satC_o[of \<xi> \<rho>]
[PROOF STATE]
proof (prove)
using this:
satC (int \<xi> \<circ> \<rho>) ?c = satC \<xi> (substC \<rho> ?c)

goal (1 subgoal):
 1. satPB (int \<xi> \<circ> \<rho>) \<Phi> = satPB \<xi> (substPB \<rho> \<Phi>)
[PROOF STEP]
unfolding satPB_def substPB_def
[PROOF STATE]
proof (prove)
using this:
satC (int \<xi> \<circ> \<rho>) ?c = satC \<xi> (substC \<rho> ?c)

goal (1 subgoal):
 1. (\<forall>c\<in>\<Phi>. satC (int \<xi> \<circ> \<rho>) c) = (\<forall>c\<in>{substC \<rho> c |c. c \<in> \<Phi>}. satC \<xi> c)
[PROOF STEP]
by auto


[STATEMENT]
lemma nonpos_Ints_mult_Nats:
  "x \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> y \<in> \<nat> \<Longrightarrow> x * y \<in> \<int>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<int>\<^sub>\<le>\<^sub>0; y \<in> \<nat>\<rbrakk> \<Longrightarrow> x * y \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
using Nats_mult[of "-x" y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- x \<in> \<nat>; y \<in> \<nat>\<rbrakk> \<Longrightarrow> - x * y \<in> \<nat>

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<int>\<^sub>\<le>\<^sub>0; y \<in> \<nat>\<rbrakk> \<Longrightarrow> x * y \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (simp add: uminus_in_Nats_iff)


[STATEMENT]
lemma size_of_mat_R:
  fixes subsets :: "(nat list*nat list) list"
  fixes signs :: "rat list list"
  shows "(matrix_A_R signs subsets) \<in> carrier_mat (length subsets) (length signs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_mat_R signs subsets \<in> carrier_mat (length subsets) (length signs)
[PROOF STEP]
unfolding matrix_A_R_def carrier_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows_list (length signs) (map (mtx_row_R signs) subsets) \<in> {m. dim_row m = length subsets \<and> dim_col m = length signs}
[PROOF STEP]
by auto


[STATEMENT]
lemma eucl_truncate_up_eq_eucl_truncate_down:
  "eucl_truncate_up p x = - (eucl_truncate_down p (- x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_truncate_up p x = - eucl_truncate_down p (- x)
[PROOF STEP]
by (auto simp: eucl_truncate_up_def eucl_truncate_down_def truncate_up_eq_truncate_down sum_negf)


[STATEMENT]
lemma distinct_insert [simp]: "distinct (List.insert x xs) = distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (List.insert x xs) = distinct xs
[PROOF STEP]
by (simp add: List.insert_def)


[STATEMENT]
lemma mcont_comp: "\<lbrakk> mcont luba orda lubb ordb g; mcont lubb ordb lubc ordc f \<rbrakk> \<Longrightarrow> mcont luba orda lubc ordc (f \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mcont luba orda lubb ordb g; mcont lubb ordb lubc ordc f\<rbrakk> \<Longrightarrow> mcont luba orda lubc ordc (f \<circ> g)
[PROOF STEP]
by(auto simp add: mcont_def intro: cont_comp monotone_comp)


[STATEMENT]
lemma partition_onE:
  assumes "partition_on A P"
  obtains "\<And>p. p \<in> P \<Longrightarrow> p \<noteq> {}"
     "\<Union>P = A"
     "\<And>p p'. p \<in> P \<Longrightarrow> p' \<in> P \<Longrightarrow> p \<noteq> p' \<Longrightarrow> p \<inter> p' = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>\<And>p. p \<in> P \<Longrightarrow> p \<noteq> {}; \<Union> P = A; \<And>p p'. \<lbrakk>p \<in> P; p' \<in> P; p \<noteq> p'\<rbrakk> \<Longrightarrow> p \<inter> p' = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
partition_on A P

goal (1 subgoal):
 1. (\<lbrakk>\<And>p. p \<in> P \<Longrightarrow> p \<noteq> {}; \<Union> P = A; \<And>p p'. \<lbrakk>p \<in> P; p' \<in> P; p \<noteq> p'\<rbrakk> \<Longrightarrow> p \<inter> p' = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding partition_on_def disjoint_def
[PROOF STATE]
proof (prove)
using this:
\<Union> P = A \<and> (\<forall>a\<in>P. \<forall>b\<in>P. a \<noteq> b \<longrightarrow> a \<inter> b = {}) \<and> {} \<notin> P

goal (1 subgoal):
 1. (\<lbrakk>\<And>p. p \<in> P \<Longrightarrow> p \<noteq> {}; \<Union> P = A; \<And>p p'. \<lbrakk>p \<in> P; p' \<in> P; p \<noteq> p'\<rbrakk> \<Longrightarrow> p \<inter> p' = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma length_filter_eq [simp]: "length (filter ((=) x) xs) = count_list xs x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) x) xs) = count_list xs x
[PROOF STEP]
by (induct xs, simp_all)


[STATEMENT]
lemma prod_prime_factors': "n > 0 \<Longrightarrow> f n = (\<Prod>p\<in>prime_factors n. f p ^ multiplicity p n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> f n = (\<Prod>p\<in>prime_factors n. f p ^ multiplicity p n)
[PROOF STEP]
by (subst prime_factorization_nat) (simp_all add: prod power)


[STATEMENT]
lemma comm_add_exps: assumes "r \<cdot> u = u \<cdot> r" shows "r\<^sup>@m \<cdot> u\<^sup>@k = u\<^sup>@k \<cdot> r\<^sup>@m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<^sup>@ m \<cdot> u \<^sup>@ k = u \<^sup>@ k \<cdot> r \<^sup>@ m
[PROOF STEP]
using comm_add_exp[OF comm_add_exp[OF assms, symmetric], symmetric]
[PROOF STATE]
proof (prove)
using this:
r \<^sup>@ ?na \<cdot> u \<^sup>@ ?n = u \<^sup>@ ?n \<cdot> r \<^sup>@ ?na

goal (1 subgoal):
 1. r \<^sup>@ m \<cdot> u \<^sup>@ k = u \<^sup>@ k \<cdot> r \<^sup>@ m
[PROOF STEP]
.


[STATEMENT]
lemma size_mset_union [simp]:
  "size_mset (M + N) = size_mset N + size_mset M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size_mset (M + N) = size_mset N + size_mset M
[PROOF STEP]
by (auto simp: size_mset_def fold_pair_size_plus)


[STATEMENT]
lemma Ring1_RG :
  defines RG: "RG \<equiv> group_ring :: ('r::ring_1, 'g) aezfun set"
  shows   "Ring1 RG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ring1 RG
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. RG \<noteq> {}
 2. \<And>g h. \<lbrakk>g \<in> RG; h \<in> RG\<rbrakk> \<Longrightarrow> g - h \<in> RG
 3. 1 \<in> RG
 4. \<And>r s. \<lbrakk>r \<in> RG; s \<in> RG\<rbrakk> \<Longrightarrow> r * s \<in> RG
[PROOF STEP]
from RG
[PROOF STATE]
proof (chain)
picking this:
RG \<equiv> group_ring
[PROOF STEP]
show "RG \<noteq> {}" "1 \<in> RG" "\<And>x y. x \<in> RG \<Longrightarrow> y \<in> RG \<Longrightarrow> x * y \<in> RG"
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring

goal (1 subgoal):
 1. RG \<noteq> {} &&& 1 \<in> RG &&& (\<And>x y. \<lbrakk>x \<in> RG; y \<in> RG\<rbrakk> \<Longrightarrow> x * y \<in> RG)
[PROOF STEP]
using RG_one_closed RG_mult_closed
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring
1 \<in> group_ring
\<lbrakk>?x \<in> group_ring; ?y \<in> group_ring\<rbrakk> \<Longrightarrow> ?x * ?y \<in> group_ring

goal (1 subgoal):
 1. RG \<noteq> {} &&& 1 \<in> RG &&& (\<And>x y. \<lbrakk>x \<in> RG; y \<in> RG\<rbrakk> \<Longrightarrow> x * y \<in> RG)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
RG \<noteq> {}
1 \<in> RG
\<lbrakk>?x1 \<in> RG; ?y1 \<in> RG\<rbrakk> \<Longrightarrow> ?x1 * ?y1 \<in> RG

goal (1 subgoal):
 1. \<And>g h. \<lbrakk>g \<in> RG; h \<in> RG\<rbrakk> \<Longrightarrow> g - h \<in> RG
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>g h. \<lbrakk>g \<in> RG; h \<in> RG\<rbrakk> \<Longrightarrow> g - h \<in> RG
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>g h. \<lbrakk>g \<in> RG; h \<in> RG\<rbrakk> \<Longrightarrow> g - h \<in> RG
[PROOF STEP]
assume "x \<in> RG" "y \<in> RG"
[PROOF STATE]
proof (state)
this:
x \<in> RG
y \<in> RG

goal (1 subgoal):
 1. \<And>g h. \<lbrakk>g \<in> RG; h \<in> RG\<rbrakk> \<Longrightarrow> g - h \<in> RG
[PROOF STEP]
with RG
[PROOF STATE]
proof (chain)
picking this:
RG \<equiv> group_ring
x \<in> RG
y \<in> RG
[PROOF STEP]
show "x - y \<in> RG"
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring
x \<in> RG
y \<in> RG

goal (1 subgoal):
 1. x - y \<in> RG
[PROOF STEP]
using supp_aezfun_diff[of x y] group_ringD
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring
x \<in> RG
y \<in> RG
supp (aezfun (x - y)) \<subseteq> supp (aezfun x) \<union> supp (aezfun y)
group_ring = {x. supp (aezfun x) \<subseteq> G}

goal (1 subgoal):
 1. x - y \<in> RG
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x - y \<in> RG

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem substn_subst_0: "subst_bv1 t 0 s = subst_bv2 t 0 s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_bv1 t 0 s = subst_bv2 t 0 s
[PROOF STEP]
by (simp add: substn_subst_n)


[STATEMENT]
lemma list_ord_trans: "
  transP ord \<Longrightarrow>
  (list_ord ord xs) =
  (\<forall>j < length xs. \<forall>i < j. ord (xs ! i) (xs ! j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans {(x, y). ord x y} \<Longrightarrow> list_ord ord xs = (\<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>trans {(x, y). ord x y}; list_ord ord xs\<rbrakk> \<Longrightarrow> \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)
 2. \<lbrakk>trans {(x, y). ord x y}; \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> list_ord ord xs
[PROOF STEP]
apply (simp add: list_ord_trans_imp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trans {(x, y). ord x y}; \<forall>j<length xs. \<forall>i<j. ord (xs ! i) (xs ! j)\<rbrakk> \<Longrightarrow> list_ord ord xs
[PROOF STEP]
apply (simp add: list_ord_all_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma get_min: "\<lbrakk> heap t;  t \<noteq> Leaf \<rbrakk> \<Longrightarrow> get_min t = Min_mset (mset_tree t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>heap t; t \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> get_min t = Min_mset (mset_tree t)
[PROOF STEP]
by (auto simp add: eq_Min_iff neq_Leaf_iff)


[STATEMENT]
lemma compat_last_chart: "\<infinity>-smooth_compat last_chart (basis_chart b)"
  if [transfer_rule]: "b \<in> Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity>-smooth_compat last_chart (basis_chart b)
[PROOF STEP]
unfolding smooth_compat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on (apply_chart last_chart ` (domain last_chart \<inter> domain (basis_chart b))) (apply_chart (basis_chart b) \<circ> inv_chart last_chart) \<and> smooth_on (apply_chart (basis_chart b) ` (domain last_chart \<inter> domain (basis_chart b))) (apply_chart last_chart \<circ> inv_chart (basis_chart b))
[PROOF STEP]
proof (transfer; auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)
 2. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
have "smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis_nonzero b \<circ> chart_last_inv_nonzero)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} ((\<lambda>(x, c). (x + (c - x \<bullet> b) *\<^sub>R b) /\<^sub>R (x \<bullet> b)) \<circ> (\<lambda>x. (x, 1)))
[PROOF STEP]
by (auto simp: o_def intro!: smooth_on_inverse smooth_on_scaleR smooth_on_inner smooth_on_add
        smooth_on_minus open_Collect_neq continuous_intros)
[PROOF STATE]
proof (state)
this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)

goal (2 subgoals):
 1. smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)
 2. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)
[PROOF STEP]
show "smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)"
[PROOF STATE]
proof (prove)
using this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_basis b \<circ> chart_last_inv)

goal (1 subgoal):
 1. smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)
[PROOF STEP]
by (rule smooth_on_subset) (auto simp: chart_last_basis_defined)
[PROOF STATE]
proof (state)
this:
smooth_on (chart_last ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_basis b \<circ> chart_last_inv)

goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
have "smooth_on {x. x \<bullet> b \<noteq> 0}  (chart_last \<circ> chart_basis_inv b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last_nonzero \<circ> chart_basis_inv_nonzero b)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smooth_on {x. x \<bullet> b \<noteq> 0} ((\<lambda>(x, c). x /\<^sub>R c) \<circ> (\<lambda>x. (x + (1 - x \<bullet> b) *\<^sub>R b, x \<bullet> b)))
[PROOF STEP]
by (auto simp: o_def intro!: smooth_on_add smooth_on_scaleR smooth_on_minus smooth_on_inverse
        smooth_on_inner open_Collect_neq continuous_intros)
[PROOF STATE]
proof (state)
this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)

goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
show "smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)"
[PROOF STATE]
proof (prove)
using this:
smooth_on {x. x \<bullet> b \<noteq> 0} (chart_last \<circ> chart_basis_inv b)

goal (1 subgoal):
 1. smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)
[PROOF STEP]
by (rule smooth_on_subset) (auto simp: chart_basis_last_defined that)
[PROOF STATE]
proof (state)
this:
smooth_on (chart_basis b ` (Collect chart_last_domainP \<inter> Collect (chart_basis_domainP b))) (chart_last \<circ> chart_basis_inv b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma padl_inj:
  shows "inj_on (padl m) (carrier_vec n :: 'a vec set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((@\<^sub>v) (0\<^sub>v m)) (carrier_vec n)
[PROOF STEP]
apply(intro inj_onI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; 0\<^sub>v m @\<^sub>v x = 0\<^sub>v m @\<^sub>v y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using append_vec_eq[OF zero_carrier_vec zero_carrier_vec]
[PROOF STATE]
proof (prove)
using this:
(0\<^sub>v ?n @\<^sub>v ?w = 0\<^sub>v ?n @\<^sub>v ?w') = (0\<^sub>v ?n = 0\<^sub>v ?n \<and> ?w = ?w')

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; 0\<^sub>v m @\<^sub>v x = 0\<^sub>v m @\<^sub>v y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by auto


[STATEMENT]
lemma eq_minus_cnj_iff_imag:
  shows "cnj z = -z \<longleftrightarrow> is_imag z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cnj z = - z) = is_imag z
[PROOF STEP]
by (cases z) (simp add: Complex_eq)


[STATEMENT]
lemma big_sum_in_smallo:
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<in> o[F](g)"
  shows   "(\<lambda>x. sum (\<lambda>y. f y x) A) \<in> o[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>y\<in>A. f y x) \<in> o[F](g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> f ?x \<in> o[F](g)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>y\<in>A. f y x) \<in> o[F](g)
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (auto intro: sum_in_smallo)


[STATEMENT]
theorem Gamma_plus1: "z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma (z + 1) = z * Gamma z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma (z + (1::'a)) = z * Gamma z
[PROOF STEP]
using rGamma_plus1[of z]
[PROOF STATE]
proof (prove)
using this:
z * rGamma (z + (1::'a)) = rGamma z

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma (z + (1::'a)) = z * Gamma z
[PROOF STEP]
by (simp add: rGamma_inverse_Gamma field_simps Gamma_eq_zero_iff)


[STATEMENT]
lemma hmset_of_enat_lt_iff_ne_infinity: "hmset_of_enat x < \<omega> \<longleftrightarrow> x \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (hmset_of_enat x < \<omega>) = (x \<noteq> \<infinity>)
[PROOF STEP]
by (cases x; simp)


[STATEMENT]
lemma (in monoid) Units_pow_closed :
  fixes d :: nat
  assumes "x \<in> Units G"
  shows "x [^] d \<in> Units G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^] d \<in> Units G
[PROOF STEP]
by (metis assms group.is_monoid monoid.nat_pow_closed units_group units_of_carrier units_of_pow)


[STATEMENT]
lemma delete_edge_set_nodes: "set (nodesL (delete_edge v v' G)) = set (nodesL G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (nodesL (FiniteListGraph.delete_edge v v' G)) = set (nodesL G)
[PROOF STEP]
unfolding delete_edge_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (nodesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> v \<or> e2 \<noteq> v') (edgesL G)\<rparr>) = set (nodesL G)
[PROOF STEP]
by simp


[STATEMENT]
lemma invariant_JN_I:
     "[| !!i. i \<in> I ==> F i \<in> invariant A;  i \<in> I |]
       ==> (\<Squnion>i \<in> I. F i) \<in> invariant A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i \<in> I \<Longrightarrow> F i \<in> invariant A; i \<in> I\<rbrakk> \<Longrightarrow> JOIN I F \<in> invariant A
[PROOF STEP]
by (simp add: invariant_def JN_stable, blast)