[STATEMENT]
lemma padic_is_abelian_group:
assumes "prime p"
shows "abelian_group (padic_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_group (padic_int p)
[PROOF STEP]
proof (rule abelian_groupI)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
 2. \<zero>\<^bsub>padic_int p\<^esub> \<in> carrier (padic_int p)
 3. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<oplus>\<^bsub>padic_int p\<^esub> z = x \<oplus>\<^bsub>padic_int p\<^esub> (y \<oplus>\<^bsub>padic_int p\<^esub> z)
 4. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
 5. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x
 6. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show 0: "\<And>x y. x \<in> carrier (padic_int p) \<Longrightarrow>
                y \<in> carrier (padic_int p) \<Longrightarrow>
                x \<oplus>\<^bsub>(padic_int p)\<^esub> y \<in> carrier (padic_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
using padic_add_closed
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime ?p; ?x \<in> carrier (padic_int ?p); ?y \<in> carrier (padic_int ?p)\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>padic_int ?p\<^esub> ?y \<in> carrier (padic_int ?p)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<in> carrier (padic_int p)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier (padic_int p); ?y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>padic_int p\<^esub> ?y \<in> carrier (padic_int p)

goal (5 subgoals):
 1. \<zero>\<^bsub>padic_int p\<^esub> \<in> carrier (padic_int p)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<oplus>\<^bsub>padic_int p\<^esub> z = x \<oplus>\<^bsub>padic_int p\<^esub> (y \<oplus>\<^bsub>padic_int p\<^esub> z)
 3. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
 4. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x
 5. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show zero: "\<zero>\<^bsub>padic_int p\<^esub> \<in> carrier (padic_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>padic_int p\<^esub> \<in> carrier (padic_int p)
[PROOF STEP]
by (metis "0" assms padic_add_inv padic_int_simps(5) padic_one_in_padic_set)
[PROOF STATE]
proof (state)
this:
\<zero>\<^bsub>padic_int p\<^esub> \<in> carrier (padic_int p)

goal (4 subgoals):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<oplus>\<^bsub>padic_int p\<^esub> z = x \<oplus>\<^bsub>padic_int p\<^esub> (y \<oplus>\<^bsub>padic_int p\<^esub> z)
 2. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
 3. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x
 4. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show add_assoc: " \<And>x y z.
                      x \<in> carrier (padic_int p) \<Longrightarrow>
                      y \<in> carrier (padic_int p) \<Longrightarrow>
                      z \<in> carrier (padic_int p) \<Longrightarrow>
                             x \<oplus>\<^bsub>padic_int p\<^esub> y \<oplus>\<^bsub>padic_int p\<^esub> z
                           = x \<oplus>\<^bsub>padic_int p\<^esub> (y \<oplus>\<^bsub>padic_int p\<^esub> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<oplus>\<^bsub>padic_int p\<^esub> z = x \<oplus>\<^bsub>padic_int p\<^esub> (y \<oplus>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
using assms padic_add_assoc
[PROOF STATE]
proof (prove)
using this:
prime p
\<lbrakk>prime ?p; ?x \<in> carrier (padic_int ?p); ?y \<in> carrier (padic_int ?p); ?z \<in> carrier (padic_int ?p)\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>padic_int ?p\<^esub> ?y \<oplus>\<^bsub>padic_int ?p\<^esub> ?z = ?x \<oplus>\<^bsub>padic_int ?p\<^esub> (?y \<oplus>\<^bsub>padic_int ?p\<^esub> ?z)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p); z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y \<oplus>\<^bsub>padic_int p\<^esub> z = x \<oplus>\<^bsub>padic_int p\<^esub> (y \<oplus>\<^bsub>padic_int p\<^esub> z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier (padic_int p); ?y \<in> carrier (padic_int p); ?z \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>padic_int p\<^esub> ?y \<oplus>\<^bsub>padic_int p\<^esub> ?z = ?x \<oplus>\<^bsub>padic_int p\<^esub> (?y \<oplus>\<^bsub>padic_int p\<^esub> ?z)

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
 2. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x
 3. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show comm: " \<And>x y.
                      x \<in> carrier (padic_int p) \<Longrightarrow>
                      y \<in> carrier (padic_int p) \<Longrightarrow>
                      x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
using assms padic_add_comm
[PROOF STATE]
proof (prove)
using this:
prime p
\<lbrakk>prime ?p; ?x \<in> carrier (padic_int ?p); ?y \<in> carrier (padic_int ?p)\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>padic_int ?p\<^esub> ?y = ?y \<oplus>\<^bsub>padic_int ?p\<^esub> ?x

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier (padic_int p); ?y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>padic_int p\<^esub> ?y = ?y \<oplus>\<^bsub>padic_int p\<^esub> ?x

goal (2 subgoals):
 1. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x
 2. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show "\<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x
[PROOF STEP]
using assms padic_add_zero
[PROOF STATE]
proof (prove)
using this:
prime p
\<lbrakk>prime ?p; ?x \<in> carrier (padic_int ?p)\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>padic_int ?p\<^esub> \<oplus>\<^bsub>padic_int ?p\<^esub> ?x = ?x

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> x = x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> carrier (padic_int p) \<Longrightarrow> \<zero>\<^bsub>padic_int p\<^esub> \<oplus>\<^bsub>padic_int p\<^esub> ?x = ?x

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show "\<And>x. x \<in> carrier (padic_int p) \<Longrightarrow>
          \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
using assms padic_add_inv
[PROOF STATE]
proof (prove)
using this:
prime p
\<lbrakk>prime ?p; ?x \<in> carrier (padic_int ?p)\<rbrakk> \<Longrightarrow> \<exists>y\<in>carrier (padic_int ?p). y \<oplus>\<^bsub>padic_int ?p\<^esub> ?x = \<zero>\<^bsub>padic_int ?p\<^esub>

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> x = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> carrier (padic_int p) \<Longrightarrow> \<exists>y\<in>carrier (padic_int p). y \<oplus>\<^bsub>padic_int p\<^esub> ?x = \<zero>\<^bsub>padic_int p\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_to_iarray_morph:
  fixes A::"'a^'n::{mod_type}"
  shows "(A = B) = (vec_to_iarray A = vec_to_iarray B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A = B) = (vec_to_iarray A = vec_to_iarray B)
[PROOF STEP]
by (metis vec_eq_iff vec_to_iarray_nth')


[STATEMENT]
lemma combine_hom:
  "\<lbrakk> set Ks \<subseteq> carrier R; set Us \<subseteq> carrier R \<rbrakk> \<Longrightarrow> combine (map h Ks) (map h Us) = h (R.combine Ks Us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set Ks \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> S.combine (map h Ks) (map h Us) = h (R.combine Ks Us)
[PROOF STEP]
by (induct Ks Us rule: R.combine.induct) (auto)


[STATEMENT]
lemma three_step_zero [simp]: "three_step 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. three_step 0 = 0
[PROOF STEP]
by (simp add: three_step_def)


[STATEMENT]
lemma gen_analz_insert_eq [rule_format]:
     "X \<in> analz H ==> ALL G. H \<subseteq> G --> analz (insert X G) = analz G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> analz H \<Longrightarrow> \<forall>G. H \<subseteq> G \<longrightarrow> analz (insert X G) = analz G
[PROOF STEP]
by (blast intro: analz_cut analz_insertI analz_mono [THEN [2] rev_subsetD])


[STATEMENT]
lemma nonzero_Solutions_iff:
  assumes "(x, y) \<in> Solutions"
  shows "nonzero x \<longleftrightarrow> nonzero y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonzero x = nonzero y
[PROOF STEP]
using assms and no0
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> local.Solutions
0 \<notin> set a
0 \<notin> set b

goal (1 subgoal):
 1. nonzero x = nonzero y
[PROOF STEP]
by (auto simp: in_Solutions_iff dest: dotprod_eq_nonzero_iff)


[STATEMENT]
lemma pmf_integral_pmf_set_integral [code]:
  "pmf_integral p f = pmf_set_integral p f (set_pmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_integral p f = pmf_set_integral p f (set_pmf p)
[PROOF STEP]
unfolding pmf_integral_def pmf_set_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation p f = measure_pmf.expectation p (\<lambda>x. indicat_real (set_pmf p) x * f x)
[PROOF STEP]
by (intro integral_cong_AE) (simp_all add: AE_measure_pmf_iff)


[STATEMENT]
lemma Inter_eqvt [eqvt]:
  shows "p \<bullet> \<Inter>S = \<Inter>(p \<bullet> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<bullet> \<Inter> S = \<Inter> (p \<bullet> S)
[PROOF STEP]
unfolding Inter_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<bullet> {x. Ball S ((\<in>) x)} = {x. Ball (p \<bullet> S) ((\<in>) x)}
[PROOF STEP]
by simp


[STATEMENT]
lemma det_eq: "det A = (\<Sum>p|p permutes UNIV. of_int (sign p) * (\<Prod>i\<in>UNIV. to_fun A i (p i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det A = (\<Sum>p | p permutes UNIV. of_int (sign p) * (\<Prod>i\<in>UNIV. to_fun A i (p i)))
[PROOF STEP]
by transfer rule


[STATEMENT]
lemma "((\<lambda>x::real. exp (ln (ln (x + exp (ln x * ln (ln x)))) /
                       (ln (ln (ln (exp x + x + ln x)))))) \<longlongrightarrow> exp 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (ln (ln (x + exp (ln x * ln (ln x)))) / ln (ln (ln (exp x + x + ln x))))) \<longlongrightarrow> exp 1) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma quot_of_fract_diff:
  "quot_of_fract (x - y) =
     (let (a,b) = quot_of_fract x; (c,d) = quot_of_fract y
      in  normalize_quot (a * d - b * c, b * d))" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_of_fract (x - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. quot_of_fract (x - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
have "x - y = x + -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - y = x + - y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - y = x + - y

goal (1 subgoal):
 1. quot_of_fract (x - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x - y = x + - y

goal (1 subgoal):
 1. quot_of_fract (x - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
have "quot_of_fract \<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_of_fract (x + - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
by (simp only: quot_of_fract_add quot_of_fract_uminus Let_def case_prod_unfold) simp_all
[PROOF STATE]
proof (state)
this:
quot_of_fract (x + - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))

goal (1 subgoal):
 1. quot_of_fract (x - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
quot_of_fract (x - y) = (let a = quot_of_fract x in case a of (a, b) \<Rightarrow> let c = quot_of_fract y in case c of (c, d) \<Rightarrow> normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
quot_of_fract (x - y) = (let a = quot_of_fract x in case a of (a, b) \<Rightarrow> let c = quot_of_fract y in case c of (c, d) \<Rightarrow> normalize_quot (a * d - b * c, b * d))

goal (1 subgoal):
 1. quot_of_fract (x - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
quot_of_fract (x - y) = (let (a, b) = quot_of_fract x; (c, d) = quot_of_fract y in normalize_quot (a * d - b * c, b * d))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_valid_path_image: "valid_path g \<Longrightarrow> connected(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path g \<Longrightarrow> connected (path_image g)
[PROOF STEP]
by (metis connected_path_image valid_path_imp_path)


[STATEMENT]
lemma cinner_mult_right: "cinner a (of_complex m * b) = m * (cinner a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner a (of_complex m * b) = m * cinner a b
[PROOF STEP]
by (metis complex_inner_class.cinner_scaleC_right scaleC_conv_of_complex)


[STATEMENT]
lemma sup_Sup:
  "A \<noteq> {} \<Longrightarrow> sup x (Sup A) = Sup ((sup x) ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> x \<squnion> Sup A = Sup ((\<squnion>) x ` A)
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A \<noteq> {} \<Longrightarrow> x \<squnion> Sup A \<le> Sup ((\<squnion>) x ` A)
 2. A \<noteq> {} \<Longrightarrow> Sup ((\<squnion>) x ` A) \<le> x \<squnion> Sup A
[PROOF STEP]
apply (meson ex_in_conv imageI SUP_upper2 Sup_mono sup.boundedI sup_left_divisibility sup_right_divisibility)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Sup ((\<squnion>) x ` A) \<le> x \<squnion> Sup A
[PROOF STEP]
by (meson SUP_least Sup_upper sup_right_isotone)


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


[STATEMENT]
lemma wordinterval_list_to_set_compressed:
  "wordinterval_to_set (wordinterval_compress (foldr wordinterval_union xs Empty_WordInterval)) =
          wordinterval_list_to_set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (wordinterval_compress (foldr wordinterval_union xs Empty_WordInterval)) = wordinterval_list_to_set xs
[PROOF STEP]
proof(induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. wordinterval_to_set (wordinterval_compress (foldr wordinterval_union [] Empty_WordInterval)) = wordinterval_list_to_set []
 2. \<And>a xs. wordinterval_to_set (wordinterval_compress (foldr wordinterval_union xs Empty_WordInterval)) = wordinterval_list_to_set xs \<Longrightarrow> wordinterval_to_set (wordinterval_compress (foldr wordinterval_union (a # xs) Empty_WordInterval)) = wordinterval_list_to_set (a # xs)
[PROOF STEP]
qed(simp_all add: wordinterval_compress wordinterval_list_to_set_def)


[STATEMENT]
lemma rel_interior_EpigraphI:
  fixes f :: "'a::euclidean_space \<Rightarrow> ereal"
  assumes "convex_on UNIV f"
  shows "rel_interior (Epigraph UNIV f) =
    {(x,z) |x z. x : rel_interior (domain f) \<and> f x < ereal z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}
[PROOF STEP]
fix x z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}
[PROOF STEP]
have "(x,z):rel_interior (Epigraph UNIV f) \<longleftrightarrow> (x : rel_interior (domain f) \<and> f x < ereal z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, z) \<in> rel_interior (Epigraph UNIV f)) = (x \<in> rel_interior (domain f) \<and> f x < ereal z)
[PROOF STEP]
using rel_interior_Epigraph[of f x z] assms
[PROOF STATE]
proof (prove)
using this:
Lower_Semicontinuous.convex_on UNIV f \<Longrightarrow> ((x, z) \<in> rel_interior (Epigraph UNIV f)) = (x \<in> rel_interior (domain f) \<and> f x < ereal z)
Lower_Semicontinuous.convex_on UNIV f

goal (1 subgoal):
 1. ((x, z) \<in> rel_interior (Epigraph UNIV f)) = (x \<in> rel_interior (domain f) \<and> f x < ereal z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((x, z) \<in> rel_interior (Epigraph UNIV f)) = (x \<in> rel_interior (domain f) \<and> f x < ereal z)

goal (1 subgoal):
 1. rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
((?x2, ?z2) \<in> rel_interior (Epigraph UNIV f)) = (?x2 \<in> rel_interior (domain f) \<and> f ?x2 < ereal ?z2)

goal (1 subgoal):
 1. rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
((?x2, ?z2) \<in> rel_interior (Epigraph UNIV f)) = (?x2 \<in> rel_interior (domain f) \<and> f ?x2 < ereal ?z2)

goal (1 subgoal):
 1. rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior (Epigraph UNIV f) = {(x, z) |x z. x \<in> rel_interior (domain f) \<and> f x < ereal z}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma state_mask:
fixes c :: nat
  and l :: register
  and ic :: configuration
  and p :: program
  and q :: nat
  and a :: nat

defines "b \<equiv> B c"
    and "m \<equiv> length p - 1"

defines "e \<equiv> E q b"

assumes is_val: "is_valid_initial ic p a"
    and q: "q > 0"
    and "c > 0"

assumes terminate: "terminates ic p q"
  shows "SKe ic p b q k \<preceq> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
have "1 \<le> 2 ^ c - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 2 ^ c - Suc 0
[PROOF STEP]
using \<open>c>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. 1 \<le> 2 ^ c - Suc 0
[PROOF STEP]
by (metis One_nat_def Suc_leI one_less_numeral_iff
                                           one_less_power semiring_norm(76) zero_less_diff)
[PROOF STATE]
proof (state)
this:
1 \<le> 2 ^ c - Suc 0

goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
have Smask: "S ic p k t \<preceq> 1" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S ic p k t \<preceq> 1
[PROOF STEP]
by (simp add: S_def)
[PROOF STATE]
proof (state)
this:
S ic p k ?t \<preceq> 1

goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
have Sbound: "S ic p k t \<le> 2 ^ c - Suc 0" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S ic p k t \<le> 2 ^ c - Suc 0
[PROOF STEP]
using \<open>1\<le>2^c-Suc 0\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> 2 ^ c - Suc 0

goal (1 subgoal):
 1. S ic p k t \<le> 2 ^ c - Suc 0
[PROOF STEP]
by (simp add: S_def)
[PROOF STATE]
proof (state)
this:
S ic p k ?t \<le> 2 ^ c - Suc 0

goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
have rlmasked: "(\<Sum>t = 0..q. S ic p k t * b^t) \<preceq> (\<Sum>t = 0..q. 1 * b^t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t = 0..q. S ic p k t * b ^ t) \<preceq> (\<Sum>t = 0..q. 1 * b ^ t)
[PROOF STEP]
using b_def B_def Smask Sbound mask_conserved_sum[of "S ic p k" 1] \<open>1 \<le> 2^c-Suc 0\<close>
[PROOF STATE]
proof (prove)
using this:
b \<equiv> B c
B ?c = 2 ^ Suc ?c
S ic p k ?t \<preceq> 1
S ic p k ?t \<le> 2 ^ c - Suc 0
\<lbrakk>\<forall>t. S ic p k t \<preceq> 1; \<forall>t. S ic p k t \<le> 2 ^ ?c - Suc 0; 1 \<le> 2 ^ ?c - Suc 0\<rbrakk> \<Longrightarrow> (\<Sum>t = 0..?q. S ic p k t * B ?c ^ t) \<preceq> (\<Sum>t = 0..?q. 1 * B ?c ^ t)
1 \<le> 2 ^ c - Suc 0

goal (1 subgoal):
 1. (\<Sum>t = 0..q. S ic p k t * b ^ t) \<preceq> (\<Sum>t = 0..q. 1 * b ^ t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..q. S ic p k t * b ^ t) \<preceq> (\<Sum>t = 0..q. 1 * b ^ t)

goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>t = 0..q. S ic p k t * b ^ t) \<preceq> (\<Sum>t = 0..q. 1 * b ^ t)

goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
using SKe_def e_def E_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>t = 0..q. S ic p k t * b ^ t) \<preceq> (\<Sum>t = 0..q. 1 * b ^ t)
SKe ?c ?p ?b ?q ?k = (\<Sum>t = 0..?q. ?b ^ t * S ?c ?p ?k t)
e \<equiv> E q b
E ?q ?b = sum ((^) ?b) {0..?q}

goal (1 subgoal):
 1. SKe ic p b q k \<preceq> e
[PROOF STEP]
by (auto simp: mult.commute)
[PROOF STATE]
proof (state)
this:
SKe ic p b q k \<preceq> e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pochhammer_poly_Suc':
    "pochhammer_poly (Suc n) = pCons 0 (pcompose (pochhammer_poly n) [:1,1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer_poly (Suc n) = pCons (0::'a) (pochhammer_poly n \<circ>\<^sub>p [:1::'a, 1::'a:])
[PROOF STEP]
by (simp add: pochhammer_poly_altdef prod.lessThan_Suc_shift pcompose_prod pcompose_pCons add_ac del: prod.lessThan_Suc)


[STATEMENT]
lemma upper_dim_implies_all_coplanar:
  assumes "upper_dim_axiom"
  shows "all_coplanar_axiom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AllCoplanarAxiom
[PROOF STEP]
using all_coplanar_axiom_def assms upper_dim_axiom_def
[PROOF STATE]
proof (prove)
using this:
AllCoplanarAxiom \<equiv> \<forall>A B C P Q. P \<noteq> Q \<and> Cong A P A Q \<and> Cong B P B Q \<and> Cong C P C Q \<longrightarrow> Bet A B C \<or> Bet B C A \<or> Bet C A B
UpperDimAxiom
UpperDimAxiom \<equiv> \<forall>A B C P Q. P \<noteq> Q \<and> Cong A P A Q \<and> Cong B P B Q \<and> Cong C P C Q \<longrightarrow> Bet A B C \<or> Bet B C A \<or> Bet C A B

goal (1 subgoal):
 1. AllCoplanarAxiom
[PROOF STEP]
by auto


[STATEMENT]
lemma sparse_row_diff_spmat: "sparse_row_matrix (diff_spmat A B ) = (sparse_row_matrix A) - (sparse_row_matrix B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sparse_row_matrix (diff_spmat A B) = sparse_row_matrix A - sparse_row_matrix B
[PROOF STEP]
by (simp add: diff_spmat_def sparse_row_add_spmat sparse_row_matrix_minus)


[STATEMENT]
lemma normal_moment_even:
  "has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2)^k * fact k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
have eq: "\<And>x::real. x\<^sup>2^k = (x^k)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x\<^sup>2 ^ k = (x ^ k)\<^sup>2
[PROOF STEP]
by (simp add: power_mult[symmetric] ac_simps)
[PROOF STATE]
proof (state)
this:
?x\<^sup>2 ^ k = (?x ^ k)\<^sup>2

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
have "has_bochner_integral lborel (\<lambda>x. exp (-x\<^sup>2)*x^(2 * k))
      (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k)) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)))
[PROOF STEP]
using has_bochner_integral_even_function[OF gaussian_moment_even_pos[where k=k]]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. exp (- (- x)\<^sup>2) * (- x) ^ (2 * k) = exp (- x\<^sup>2) * x ^ (2 * k)) \<Longrightarrow> has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k)) (2 *\<^sub>R (sqrt pi / 2 * (fact (2 * k) / (2 ^ (2 * k) * fact k))))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k)) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k)) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k)) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)))
[PROOF STEP]
have "has_bochner_integral lborel (\<lambda>x. (exp (-x\<^sup>2)*x^(2 * k)) * ((2*\<sigma>\<^sup>2)^k / sqrt (2 * pi * \<sigma>\<^sup>2)))
      ((sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k))) * ((2*\<sigma>\<^sup>2)^k / sqrt (2 * pi * \<sigma>\<^sup>2)))"
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k)) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2))) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2)))
[PROOF STEP]
by (rule has_bochner_integral_mult_left)
[PROOF STATE]
proof (state)
this:
has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2))) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2)))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
has_bochner_integral lborel (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2))) (sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2)))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
have "(\<lambda>x. (exp (-x\<^sup>2)*x^(2 * k)) * ((2*\<sigma>\<^sup>2)^k / sqrt (2 * pi * \<sigma>\<^sup>2))) =
    (\<lambda>x. exp (- ((sqrt 2 * \<sigma>) * x)\<^sup>2 / (2*\<sigma>\<^sup>2)) * ((sqrt 2 * \<sigma>) * x) ^ (2 * k) / sqrt (2 * pi * \<sigma>\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2))) = (\<lambda>x. exp (- (sqrt 2 * \<sigma> * x)\<^sup>2 / (2 * \<sigma>\<^sup>2)) * (sqrt 2 * \<sigma> * x) ^ (2 * k) / sqrt (2 * pi * \<sigma>\<^sup>2))
[PROOF STEP]
by (auto simp: fun_eq_iff field_simps real_sqrt_power[symmetric] real_sqrt_mult
                   real_sqrt_divide power_mult eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2))) = (\<lambda>x. exp (- (sqrt 2 * \<sigma> * x)\<^sup>2 / (2 * \<sigma>\<^sup>2)) * (sqrt 2 * \<sigma> * x) ^ (2 * k) / sqrt (2 * pi * \<sigma>\<^sup>2))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. exp (- x\<^sup>2) * x ^ (2 * k) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2))) = (\<lambda>x. exp (- (sqrt 2 * \<sigma> * x)\<^sup>2 / (2 * \<sigma>\<^sup>2)) * (sqrt 2 * \<sigma> * x) ^ (2 * k) / sqrt (2 * pi * \<sigma>\<^sup>2))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
have "((sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k))) * ((2*\<sigma>\<^sup>2)^k / sqrt (2 * pi * \<sigma>\<^sup>2))) =
    (inverse (sqrt 2 * \<sigma>) * ((fact (2 * k))) / ((2/\<sigma>\<^sup>2) ^ k * (fact k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2)) = inverse (sqrt 2 * \<sigma>) * fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k)
[PROOF STEP]
by (auto simp: fun_eq_iff power_mult field_simps real_sqrt_power[symmetric] real_sqrt_mult
                   power2_eq_square)
[PROOF STATE]
proof (state)
this:
sqrt pi * (fact (2 * k) / (2 ^ (2 * k) * fact k)) * ((2 * \<sigma>\<^sup>2) ^ k / sqrt (2 * pi * \<sigma>\<^sup>2)) = inverse (sqrt 2 * \<sigma>) * fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k)

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
has_bochner_integral lborel (\<lambda>x. exp (- (sqrt 2 * \<sigma> * x)\<^sup>2 / (2 * \<sigma>\<^sup>2)) * (sqrt 2 * \<sigma> * x) ^ (2 * k) / sqrt (2 * pi * \<sigma>\<^sup>2)) (inverse (sqrt 2 * \<sigma>) * fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral lborel (\<lambda>x. exp (- (sqrt 2 * \<sigma> * x)\<^sup>2 / (2 * \<sigma>\<^sup>2)) * (sqrt 2 * \<sigma> * x) ^ (2 * k) / sqrt (2 * pi * \<sigma>\<^sup>2)) (inverse (sqrt 2 * \<sigma>) * fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
unfolding normal_density_def
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral lborel (\<lambda>x. exp (- (sqrt 2 * \<sigma> * x)\<^sup>2 / (2 * \<sigma>\<^sup>2)) * (sqrt 2 * \<sigma> * x) ^ (2 * k) / sqrt (2 * pi * \<sigma>\<^sup>2)) (inverse (sqrt 2 * \<sigma>) * fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))

goal (1 subgoal):
 1. has_bochner_integral lborel (\<lambda>x. 1 / sqrt (2 * pi * \<sigma>\<^sup>2) * exp (- (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))
[PROOF STEP]
by (subst lborel_has_bochner_integral_real_affine_iff[where c="sqrt 2 * \<sigma>" and t=\<mu>]) simp_all
[PROOF STATE]
proof (state)
this:
has_bochner_integral lborel (\<lambda>x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * k)) (fact (2 * k) / ((2 / \<sigma>\<^sup>2) ^ k * fact k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Frct_add: "Frct (a, numeral b) + Frct (c, numeral d) =
                   Frct (Rat.normalize (a * numeral d + c * numeral b, numeral (b*d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Frct (a, numeral b) + Frct (c, numeral d) = Frct (Rat.normalize (a * numeral d + c * numeral b, numeral (b * d)))
[PROOF STEP]
by (auto simp: rat_number_collapse Fract_normalize)


[STATEMENT]
lemma (in comm_semiring_1) poly_exp_add: "poly (p %^ (n + d)) x = poly (p %^ n *** p %^ d) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (p %^ (n + d)) x = poly (p %^ n *** p %^ d) x
[PROOF STEP]
by (induct n) (auto simp add: poly_mult mult.assoc)


[STATEMENT]
lemma inner_commute_zero: "(inner xa x = 0) = (inner x xa = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inner xa x = (0::'a)) = (inner x xa = (0::'a))
[PROOF STEP]
by (metis cnj_0 local.inner_commute)


[STATEMENT]
lemma compact_valid_path_image: "valid_path g \<Longrightarrow> compact(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path g \<Longrightarrow> compact (path_image g)
[PROOF STEP]
by (metis compact_path_image valid_path_imp_path)


[STATEMENT]
lemma nn_contains_Inf:
  fixes S :: "nat set"
  assumes nn: "S \<noteq> {}"
  shows "Inf S \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> S \<in> S
[PROOF STEP]
using assms Inf_nat_def LeastI
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
\<Sqinter> ?X = (LEAST n. n \<in> ?X)
?P ?k \<Longrightarrow> ?P (LEAST x. ?P x)

goal (1 subgoal):
 1. \<Sqinter> S \<in> S
[PROOF STEP]
by force


[STATEMENT]
lemma (in type_definition) card: "card (UNIV :: 'b set) = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV = card A
[PROOF STEP]
by (simp add: univ card_image inj_on_def Abs_inject)


[STATEMENT]
lemma distribute_interest_plus:
   "just_cash (i * net_asset_value (\<alpha> + \<beta>)) =
      just_cash (i * net_asset_value \<alpha>) +
      just_cash (i * net_asset_value \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. just_cash (i * net_asset_value (\<alpha> + \<beta>)) = just_cash (i * net_asset_value \<alpha>) + just_cash (i * net_asset_value \<beta>)
[PROOF STEP]
unfolding just_cash_def net_asset_value_plus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<iota> (\<lambda>n. if n = 0 then i * (net_asset_value \<alpha> + net_asset_value \<beta>) else 0) = \<iota> (\<lambda>n. if n = 0 then i * net_asset_value \<alpha> else 0) + \<iota> (\<lambda>n. if n = 0 then i * net_asset_value \<beta> else 0)
[PROOF STEP]
by (metis
        distrib_left
        just_cash_plus
        just_cash_def)


[STATEMENT]
lemma param_op_graph_succ[param]:
  "\<lbrakk>IS_LEFT_UNIQUE A; IS_RIGHT_UNIQUE A\<rbrakk> \<Longrightarrow> (op_graph_succ, op_graph_succ) \<in> \<langle>A\<rangle>graph_rel \<rightarrow> A \<rightarrow> \<langle>A\<rangle>set_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>IS_LEFT_UNIQUE A; single_valued A\<rbrakk> \<Longrightarrow> (op_graph_succ, op_graph_succ) \<in> \<langle>A\<rangle>graph_rel \<rightarrow> A \<rightarrow> \<langle>A\<rangle>set_rel
[PROOF STEP]
unfolding op_graph_succ_def[abs_def] graph_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>IS_LEFT_UNIQUE A; single_valued A\<rbrakk> \<Longrightarrow> (\<lambda>E u. E `` {u}, \<lambda>E u. E `` {u}) \<in> \<langle>A \<times>\<^sub>r A\<rangle>set_rel \<rightarrow> A \<rightarrow> \<langle>A\<rangle>set_rel
[PROOF STEP]
by parametricity


[STATEMENT]
lemma iso_fSup:
  fixes F :: "('a::order \<Rightarrow> 'b::complete_lattice) set"
  shows "(\<forall>f \<in> F. mono f) \<Longrightarrow> mono (\<Squnion>F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball F mono \<Longrightarrow> mono (\<Squnion> F)
[PROOF STEP]
by (simp add: mono_def SUP_subset_mono)


[STATEMENT]
lemma token_run_mergepoint:
  assumes "x < y"
  assumes "token_run x (y + n) = token_run y (y + n)"
  obtains m where "x \<le> (Suc m)" and "y \<le> (Suc m)"
    and "y = Suc m \<or> token_run x m \<noteq> token_run y m"
    and "token_run x (Suc m) = token_run y (Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. \<lbrakk>x \<le> Suc m; y \<le> Suc m; y = Suc m \<or> token_run x m \<noteq> token_run y m; token_run x (Suc m) = token_run y (Suc m)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x < y
token_run x (y + n) = token_run y (y + n)

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>x \<le> Suc m; y \<le> Suc m; y = Suc m \<or> token_run x m \<noteq> token_run y m; token_run x (Suc m) = token_run y (Suc m)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (induction n)
    ((metis add_0_iff le_Suc_eq le_add1 less_imp_Suc_add),
     (metis add_Suc_right le_add1 less_or_eq_imp_le order_trans))


[STATEMENT]
lemma TR_deMorgan: "neg\<cdot>(x orelse y) = (neg\<cdot>x andalso neg\<cdot>y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neg\<cdot>(x orelse y) = (neg\<cdot>x andalso neg\<cdot>y)
[PROOF STEP]
by (rule trE[where p=x], simp_all)


[STATEMENT]
lemma totally_bounded_subset: "totally_bounded S \<Longrightarrow> T \<subseteq> S \<Longrightarrow> totally_bounded T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>totally_bounded S; T \<subseteq> S\<rbrakk> \<Longrightarrow> totally_bounded T
[PROOF STEP]
by (fastforce simp add: totally_bounded_def)


[STATEMENT]
lemma aff_dim_halfspace_gt:
  fixes a :: "'a::euclidean_space"
  shows "aff_dim {x. a \<bullet> x > r} =
        (if a = 0 \<and> r \<ge> 0 then -1 else DIM('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim {x. r < a \<bullet> x} = (if a = (0::'a) \<and> 0 \<le> r then - 1 else int DIM('a))
[PROOF STEP]
by simp (metis aff_dim_open halfspace_eq_empty_gt open_halfspace_gt)


[STATEMENT]
lemma multiplicity_gauss_int_of_nat:
  "multiplicity (of_nat a) (of_nat b :: gauss_int) = multiplicity a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity (of_nat a) (of_nat b) = multiplicity a b
[PROOF STEP]
unfolding multiplicity_def of_nat_power [symmetric] of_nat_dvd_of_nat_gauss_int_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if finite {n. a ^ n dvd b} then Max {n. a ^ n dvd b} else 0) = (if finite {n. a ^ n dvd b} then Max {n. a ^ n dvd b} else 0)
[PROOF STEP]
..


[STATEMENT]
lemma in_eball_iff [simp]: "z \<in> eball z0 r \<longleftrightarrow> ereal (dist z0 z) < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> eball z0 r) = (ereal (dist z0 z) < r)
[PROOF STEP]
by (simp add: eball_def)


[STATEMENT]
lemma input_sizes_shallow_model: "input_sizes (shallow_model Y Z M N) = replicate (Suc N) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. input_sizes (shallow_model Y Z M N) = replicate (Suc N) M
[PROOF STEP]
apply (induction N)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. input_sizes (shallow_model Y Z M 0) = replicate (Suc 0) M
 2. \<And>N. input_sizes (shallow_model Y Z M N) = replicate (Suc N) M \<Longrightarrow> input_sizes (shallow_model Y Z M (Suc N)) = replicate (Suc (Suc N)) M
[PROOF STEP]
unfolding shallow_model_def input_sizes.simps
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. input_sizes (shallow_model' Z M 0) = replicate (Suc 0) M
 2. \<And>N. input_sizes (shallow_model' Z M N) = replicate (Suc N) M \<Longrightarrow> input_sizes (shallow_model' Z M (Suc N)) = replicate (Suc (Suc N)) M
[PROOF STEP]
by simp_all


[STATEMENT]
lemma above_diagonal_in_residues:
  fixes H :: "int^'n::mod_type^'n::mod_type"
  assumes H: "Hermite associates residues H"
  and inv_H: "invertible (map_matrix rat_of_int H)" and up_H: "upper_triangular H"
  and j_i: "j<i"
  shows "H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))
[PROOF STEP]
have "H $ i $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H $ i $ i \<noteq> 0
[PROOF STEP]
by (rule invertible_and_upper_diagonal_not0[OF inv_H up_H])
[PROOF STATE]
proof (state)
this:
H $ i $ i \<noteq> 0

goal (1 subgoal):
 1. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))
[PROOF STEP]
hence "\<not> is_zero_row i H"
[PROOF STATE]
proof (prove)
using this:
H $ i $ i \<noteq> 0

goal (1 subgoal):
 1. \<not> is_zero_row i H
[PROOF STEP]
unfolding is_zero_row_def is_zero_row_upt_k_def ncols_def
[PROOF STATE]
proof (prove)
using this:
H $ i $ i \<noteq> 0

goal (1 subgoal):
 1. \<not> (\<forall>j. mod_type_class.to_nat j < CARD('n) \<longrightarrow> H $ i $ j = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> is_zero_row i H

goal (1 subgoal):
 1. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H

goal (1 subgoal):
 1. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))
[PROOF STEP]
using H j_i
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H
Hermite associates residues H
j < i

goal (1 subgoal):
 1. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))
[PROOF STEP]
unfolding Hermite_def
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H
Complete_set_non_associates associates \<and> Complete_set_residues residues \<and> echelon_form H \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> H $ i $ (LEAST n. H $ i $ n \<noteq> 0) \<in> associates) \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> (\<forall>j<i. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))))
j < i

goal (1 subgoal):
 1. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))
[PROOF STEP]
unfolding diagonal_least_nonzero[OF H inv_H up_H]
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H
Complete_set_non_associates associates \<and> Complete_set_residues residues \<and> echelon_form H \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> H $ i $ i \<in> associates) \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> (\<forall>j<i. H $ j $ i \<in> residues (H $ i $ i)))
j < i

goal (1 subgoal):
 1. H $ j $ i \<in> residues (H $ i $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Field_natLess: "Field natLess = (UNIV::nat set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field natLess = UNIV
[PROOF STEP]
by(unfold Field_def natLess_def, auto)


[STATEMENT]
lemma Maclaurin_exp_le:
  fixes x :: real and n :: nat
  shows "\<exists>t. \<bar>t\<bar> \<le> \<bar>x\<bar> \<and> exp x = (\<Sum>m<n. (x ^ m) / fact m) + (exp t / fact n) * x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t. \<bar>t\<bar> \<le> \<bar>x\<bar> \<and> exp x = (\<Sum>m<n. x ^ m / fact m) + exp t / fact n * x ^ n
[PROOF STEP]
using Maclaurin_all_le_objl [where diff = "\<lambda>n. exp" and f = exp and x = x and n = n]
[PROOF STATE]
proof (prove)
using this:
exp = exp \<and> (\<forall>m x. (exp has_real_derivative exp x) (at x)) \<longrightarrow> (\<exists>t. \<bar>t\<bar> \<le> \<bar>x\<bar> \<and> exp x = (\<Sum>m<n. exp 0 / fact m * x ^ m) + exp t / fact n * x ^ n)

goal (1 subgoal):
 1. \<exists>t. \<bar>t\<bar> \<le> \<bar>x\<bar> \<and> exp x = (\<Sum>m<n. x ^ m / fact m) + exp t / fact n * x ^ n
[PROOF STEP]
by auto


[STATEMENT]
lemma lemma_LIMSEQ_powrat_diff_inverse2:
  assumes "1 \<le> a"
  and "(\<lambda>n. a pow\<^sub>\<rat> (s n - 1/of_nat(Suc n)))\<longlonglongrightarrow> y"
  shows "(\<lambda>n. a pow\<^sub>\<rat> (s n)) \<longlonglongrightarrow> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> s n) \<longlonglongrightarrow> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> s n) \<longlonglongrightarrow> y
[PROOF STEP]
have "(\<lambda>x. a pow\<^sub>\<rat> (1 / rat_of_nat (Suc x))) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a pow\<^sub>\<rat> (1 / rat_of_nat (Suc x))) \<longlonglongrightarrow> 1
[PROOF STEP]
using assms(1) LIMSEQ_powrat_inverse_of_nat
[PROOF STATE]
proof (prove)
using this:
1 \<le> a
0 < ?a \<Longrightarrow> (\<lambda>n. ?a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>x. a pow\<^sub>\<rat> (1 / rat_of_nat (Suc x))) \<longlonglongrightarrow> 1
[PROOF STEP]
by (auto intro!: LIMSEQ_Suc simp only: divide_inverse mult_1_left)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a pow\<^sub>\<rat> (1 / rat_of_nat (Suc x))) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> s n) \<longlonglongrightarrow> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. a pow\<^sub>\<rat> (1 / rat_of_nat (Suc x))) \<longlonglongrightarrow> 1
[PROOF STEP]
have "(\<lambda>x. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc x)) *
                  a pow\<^sub>\<rat> (s x - inverse(rat_of_nat (Suc x))))
              \<longlonglongrightarrow> 1 * y"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a pow\<^sub>\<rat> (1 / rat_of_nat (Suc x))) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>x. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc x)) * a pow\<^sub>\<rat> (s x - inverse (rat_of_nat (Suc x)))) \<longlonglongrightarrow> 1 * y
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a pow\<^sub>\<rat> (1 / rat_of_nat (Suc x))) \<longlonglongrightarrow> 1
(\<lambda>n. a pow\<^sub>\<rat> (s n - 1 / rat_of_nat (Suc n))) \<longlonglongrightarrow> y

goal (1 subgoal):
 1. (\<lambda>x. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc x)) * a pow\<^sub>\<rat> (s x - inverse (rat_of_nat (Suc x)))) \<longlonglongrightarrow> 1 * y
[PROOF STEP]
by (auto intro!: tendsto_mult simp only: inverse_eq_divide)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc x)) * a pow\<^sub>\<rat> (s x - inverse (rat_of_nat (Suc x)))) \<longlonglongrightarrow> 1 * y

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> s n) \<longlonglongrightarrow> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc x)) * a pow\<^sub>\<rat> (s x - inverse (rat_of_nat (Suc x)))) \<longlonglongrightarrow> 1 * y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc x)) * a pow\<^sub>\<rat> (s x - inverse (rat_of_nat (Suc x)))) \<longlonglongrightarrow> 1 * y

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> s n) \<longlonglongrightarrow> y
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc x)) * a pow\<^sub>\<rat> (s x - inverse (rat_of_nat (Suc x)))) \<longlonglongrightarrow> 1 * y
1 \<le> a

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> s n) \<longlonglongrightarrow> y
[PROOF STEP]
by (auto simp add: powrat_add [symmetric]  )
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> s n) \<longlonglongrightarrow> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Im_complex_div_ge_0: "Im (a / b) \<ge> 0 \<longleftrightarrow> Im (a * cnj b) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> Im (a / b)) = (0 \<le> Im (a * cnj b))
[PROOF STEP]
by (metis Im_complex_div_eq_0 Im_complex_div_gt_0 le_less)


[STATEMENT]
lemma mods_with_vec_2:
  assumes "v <\<^sub>v w"
    and "0 \<notin> set b"
    and "length b = length w"
    and "(b \<bullet> v) mod a = (b \<bullet> w) mod a"
  shows "(b \<bullet> (w -\<^sub>v v)) mod a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<bullet> (w -\<^sub>v v) mod a = 0
[PROOF STEP]
by (metis (no_types, lifting) assms diff_zero dotprod_commute
      length_map length_upt less_eq_def order_vec.less_imp_le
      mods_with_vec vdiff_def)


[STATEMENT]
lemma rtrancl_mem_Sigma:
 "\<lbrakk> a \<noteq> b; (a, b) \<in> (A \<times> A)^* \<rbrakk> \<Longrightarrow> b \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> b; (a, b) \<in> (A \<times> A)\<^sup>*\<rbrakk> \<Longrightarrow> b \<in> A
[PROOF STEP]
apply (frule rtranclD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> b; (a, b) \<in> (A \<times> A)\<^sup>*; a = b \<or> a \<noteq> b \<and> (a, b) \<in> (A \<times> A)\<^sup>+\<rbrakk> \<Longrightarrow> b \<in> A
[PROOF STEP]
apply (cut_tac r="A \<times> A" and A=A in trancl_subset_Sigma)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<noteq> b; (a, b) \<in> (A \<times> A)\<^sup>*; a = b \<or> a \<noteq> b \<and> (a, b) \<in> (A \<times> A)\<^sup>+\<rbrakk> \<Longrightarrow> A \<times> A \<subseteq> A \<times> A
 2. \<lbrakk>a \<noteq> b; (a, b) \<in> (A \<times> A)\<^sup>*; a = b \<or> a \<noteq> b \<and> (a, b) \<in> (A \<times> A)\<^sup>+; (A \<times> A)\<^sup>+ \<subseteq> A \<times> A\<rbrakk> \<Longrightarrow> b \<in> A
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vector_sub_project_orthogonal:
  fixes b x :: "'a::euclidean_space"
  shows "b \<bullet> (x - ((b \<bullet> x) / (b \<bullet> b)) *\<^sub>R b) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<bullet> (x - (b \<bullet> x / (b \<bullet> b)) *\<^sub>R b) = 0
[PROOF STEP]
unfolding inner_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<bullet> x - b \<bullet> x / (b \<bullet> b) * (b \<bullet> b) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma coplanar_5_bis :
  assumes "rk {A, B, C} = 3" and "rk {B, C, \<alpha>} = 2" and "rk {A, B, \<gamma>} = 2"
  shows "rk {A, B, C, \<alpha>, \<gamma>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<gamma>} = 3
[PROOF STEP]
by (smt assms coplanar_5 insert_commute)


[STATEMENT]
lemma quotient_of_number [simp]:
  "quotient_of 0 = (0, 1)"
  "quotient_of 1 = (1, 1)"
  "quotient_of (numeral k) = (numeral k, 1)"
  "quotient_of (- 1) = (- 1, 1)"
  "quotient_of (- numeral k) = (- numeral k, 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (quotient_of 0 = (0, 1) &&& quotient_of 1 = (1, 1)) &&& quotient_of (numeral k) = (numeral k, 1) &&& quotient_of (- 1) = (- 1, 1) &&& quotient_of (- numeral k) = (- numeral k, 1)
[PROOF STEP]
by (simp_all add: rat_number_expand quotient_of_Fract)


[STATEMENT]
lemma elem_in_group_sizes_min_of_size:
  assumes "a \<in> group_sizes"
  shows "groups_of_size a \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> groups_of_size a
[PROOF STEP]
using assms group_card_non_zero_groups_of_size_min group_size_implies_group_existance
[PROOF STATE]
proof (prove)
using this:
a \<in> group_sizes
\<lbrakk>?g \<in> \<G>; card ?g = ?a\<rbrakk> \<Longrightarrow> 1 \<le> groups_of_size ?a
?x \<in> group_sizes \<Longrightarrow> \<exists>G. G \<in> \<G> \<and> card G = ?x

goal (1 subgoal):
 1. 1 \<le> groups_of_size a
[PROOF STEP]
by blast


[STATEMENT]
lemma Rep_move_matrix[simp]:
  "Rep_matrix (move_matrix A y x) j i =
  (if (((int j)-y) < 0) | (((int i)-x) < 0) then 0 else Rep_matrix A (nat((int j)-y)) (nat((int i)-x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (move_matrix A y x) j i = (if int j - y < 0 \<or> int i - x < 0 then 0::'a else Rep_matrix A (nat (int j - y)) (nat (int i - x)))
[PROOF STEP]
apply (simp add: move_matrix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int j < y \<longrightarrow> Rep_matrix (Abs_matrix (\<lambda>j i. if int j < y \<or> int i < x then 0::'a else Rep_matrix A (nat (int j - y)) (nat (int i - x)))) j i = (0::'a)) \<and> (int i < x \<longrightarrow> Rep_matrix (Abs_matrix (\<lambda>j i. if int j < y \<or> int i < x then 0::'a else Rep_matrix A (nat (int j - y)) (nat (int i - x)))) j i = (0::'a)) \<and> (\<not> int j < y \<and> \<not> int i < x \<longrightarrow> Rep_matrix (Abs_matrix (\<lambda>j i. if int j < y \<or> int i < x then 0::'a else Rep_matrix A (nat (int j - y)) (nat (int i - x)))) j i = Rep_matrix A (nat (int j - y)) (nat (int i - x)))
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. int j < y \<Longrightarrow> Rep_matrix (Abs_matrix (\<lambda>j i. if int j < y \<or> int i < x then 0::'a else Rep_matrix A (nat (int j - y)) (nat (int i - x)))) j i = (0::'a)
 2. int i < x \<Longrightarrow> Rep_matrix (Abs_matrix (\<lambda>j i. if int j < y \<or> int i < x then 0::'a else Rep_matrix A (nat (int j - y)) (nat (int i - x)))) j i = (0::'a)
 3. \<lbrakk>\<not> int j < y; \<not> int i < x\<rbrakk> \<Longrightarrow> Rep_matrix (Abs_matrix (\<lambda>j i. if int j < y \<or> int i < x then 0::'a else Rep_matrix A (nat (int j - y)) (nat (int i - x)))) j i = Rep_matrix A (nat (int j - y)) (nat (int i - x))
[PROOF STEP]
by (subst RepAbs_matrix,
  rule exI[of _ "(nrows A)+(nat \<bar>y\<bar>)"], auto, rule nrows, arith,
  rule exI[of _ "(ncols A)+(nat \<bar>x\<bar>)"], auto, rule ncols, arith)+


[STATEMENT]
lemma conv_abscissa_higher_deriv_le:
  "conv_abscissa ((fds_deriv ^^ n) f) \<le> conv_abscissa (f :: 'a :: dirichlet_series fds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_abscissa ((fds_deriv ^^ n) f) \<le> conv_abscissa f
[PROOF STEP]
by (induction n) (auto intro: order.trans[OF conv_abscissa_deriv_le])


[STATEMENT]
lemma lcm_code_integer [code]: "lcm a b = \<bar>a\<bar> * \<bar>b\<bar> div gcd a b"
  for a b :: integer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm a b = \<bar>a\<bar> * \<bar>b\<bar> div gcd a b
[PROOF STEP]
by transfer (fact lcm_altdef_int)


[STATEMENT]
lemma card_sumset_le:
  assumes "finite A" shows "card (sumset A {a}) \<le> card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (sumset A {a}) \<le> card A
[PROOF STEP]
by (simp add: assms card_mono card_sumset_singleton_eq)


[STATEMENT]
lemma fps_cos_add: "fps_cos (a + b) = fps_cos a * fps_cos b - fps_sin a * fps_sin b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_cos (a + b) = fps_cos a * fps_cos b - fps_sin a * fps_sin b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_cos (a + b) = fps_cos a * fps_cos b - fps_sin a * fps_sin b
[PROOF STEP]
have "fps_deriv
     (fps_deriv (fps_cos a * fps_cos b - fps_sin a * fps_sin b)) =
    - (fps_const (a + b) * fps_const (a + b) *
       (fps_cos a * fps_cos b - fps_sin a * fps_sin b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_deriv (fps_cos a * fps_cos b - fps_sin a * fps_sin b)) = - (fps_const (a + b) * fps_const (a + b) * (fps_cos a * fps_cos b - fps_sin a * fps_sin b))
[PROOF STEP]
by (simp flip: fps_const_neg fps_const_add fps_const_mult
        add: fps_sin_deriv fps_cos_deriv algebra_simps)
[PROOF STATE]
proof (state)
this:
fps_deriv (fps_deriv (fps_cos a * fps_cos b - fps_sin a * fps_sin b)) = - (fps_const (a + b) * fps_const (a + b) * (fps_cos a * fps_cos b - fps_sin a * fps_sin b))

goal (1 subgoal):
 1. fps_cos (a + b) = fps_cos a * fps_cos b - fps_sin a * fps_sin b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fps_deriv (fps_deriv (fps_cos a * fps_cos b - fps_sin a * fps_sin b)) = - (fps_const (a + b) * fps_const (a + b) * (fps_cos a * fps_cos b - fps_sin a * fps_sin b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fps_deriv (fps_deriv (fps_cos a * fps_cos b - fps_sin a * fps_sin b)) = - (fps_const (a + b) * fps_const (a + b) * (fps_cos a * fps_cos b - fps_sin a * fps_sin b))

goal (1 subgoal):
 1. fps_cos (a + b) = fps_cos a * fps_cos b - fps_sin a * fps_sin b
[PROOF STEP]
by (auto intro: eq_fps_cos)
[PROOF STATE]
proof (state)
this:
fps_cos (a + b) = fps_cos a * fps_cos b - fps_sin a * fps_sin b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSDERIV_approx:
  "NSDERIV f x :> D \<Longrightarrow> h \<in> Infinitesimal \<Longrightarrow> h \<noteq> 0 \<Longrightarrow>
    ( *f* f) (star_of x + h) - star_of (f x) \<approx> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>NSDERIV f x :> D; h \<in> Infinitesimal; h \<noteq> 0\<rbrakk> \<Longrightarrow> (*f* f) (star_of x + h) - star_of (f x) \<approx> 0
[PROOF STEP]
by (meson DiffI Infinitesimal_ratio approx_star_of_HFinite mem_infmal_iff nsderiv_def singletonD)


[STATEMENT]
theorem bernoulli_altdef:
  "bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (-1)^k * real (m choose k) * real k^n / real (Suc m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "(\<Sum>m\<le>n. \<Sum>k\<le>m. (-1)^k * real (m choose k) * real k^n / real (Suc m)) =
          (\<Sum>m\<le>n. (\<Sum>k\<le>m. (-1)^k * real (m choose k) * real k^n) / real (Suc m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m)) = (\<Sum>m\<le>n. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m))
[PROOF STEP]
by (subst sum_divide_distrib) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m)) = (\<Sum>m\<le>n. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m))

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m)) = (\<Sum>m\<le>n. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m))

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "\<dots> = fact n * (\<Sum>m\<le>n. (- 1) ^ m  / real (Suc m) * (fps_exp 1 - 1) ^ m $ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<le>n. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m)) = fact n * (\<Sum>m\<le>n. (- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n)
[PROOF STEP]
proof (subst sum_distrib_left, intro sum.cong refl)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
assume m: "m \<in> {..n}"
[PROOF STATE]
proof (state)
this:
m \<in> {..n}

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
have "(\<Sum>k\<le>m. (-1)^k * real (m choose k) * real k^n) =
            (-1)^m * (\<Sum>k\<le>m. (-1)^(m - k) * real (m choose k) * real k^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) = (- 1) ^ m * (\<Sum>k\<le>m. (- 1) ^ (m - k) * real (m choose k) * real k ^ n)
[PROOF STEP]
by (subst sum_distrib_left, intro sum.cong refl) (auto simp: minus_one_power_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) = (- 1) ^ m * (\<Sum>k\<le>m. (- 1) ^ (m - k) * real (m choose k) * real k ^ n)

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) = (- 1) ^ m * (\<Sum>k\<le>m. (- 1) ^ (m - k) * real (m choose k) * real k ^ n)

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
have "\<dots> = (-1) ^ m * (real (Stirling n m) * fact m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ m * (\<Sum>k\<le>m. (- 1) ^ (m - k) * real (m choose k) * real k ^ n) = (- 1) ^ m * (real (Stirling n m) * fact m)
[PROOF STEP]
by (subst Stirling_closed_form) simp_all
[PROOF STATE]
proof (state)
this:
(- 1) ^ m * (\<Sum>k\<le>m. (- 1) ^ (m - k) * real (m choose k) * real k ^ n) = (- 1) ^ m * (real (Stirling n m) * fact m)

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- 1) ^ m * (\<Sum>k\<le>m. (- 1) ^ (m - k) * real (m choose k) * real k ^ n) = (- 1) ^ m * (real (Stirling n m) * fact m)

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
have "real (Stirling n m) = Stirling_fps m $ n * fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Stirling n m) = Stirling_fps m $ n * fact n
[PROOF STEP]
by (subst Stirling_fps_nth) simp_all
[PROOF STATE]
proof (state)
this:
real (Stirling n m) = Stirling_fps m $ n * fact n

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (Stirling n m) = Stirling_fps m $ n * fact n

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
have "\<dots> * fact m = (fps_exp 1 - 1) ^ m $ n * fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stirling_fps m $ n * fact n * fact m = (fps_exp 1 - 1) ^ m $ n * fact n
[PROOF STEP]
by (simp add: Stirling_fps_def)
[PROOF STATE]
proof (state)
this:
Stirling_fps m $ n * fact n * fact m = (fps_exp 1 - 1) ^ m $ n * fact n

goal (1 subgoal):
 1. \<And>x. x \<in> {..n} \<Longrightarrow> (\<Sum>k\<le>x. (- 1) ^ k * real (x choose k) * real k ^ n) / real (Suc x) = fact n * ((- 1) ^ x / real (Suc x) * (fps_exp 1 - 1) ^ x $ n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) = (- 1) ^ m * ((fps_exp 1 - 1) ^ m $ n * fact n)
[PROOF STEP]
show "(\<Sum>k\<le>m. (-1)^k * real (m choose k) * real k^n) / real (Suc m) =
                     fact n * ((- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) = (- 1) ^ m * ((fps_exp 1 - 1) ^ m $ n * fact n)

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m) = fact n * ((- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m) = fact n * ((- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>n. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m)) = fact n * (\<Sum>m\<le>n. (- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n)

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>n. (\<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n) / real (Suc m)) = fact n * (\<Sum>m\<le>n. (- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n)

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "(\<Sum>m\<le>n. (- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n) =
                fps_compose (Abs_fps (\<lambda>m. (-1) ^ m / real (Suc m))) (fps_exp 1 - 1) $ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<le>n. (- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n) = (Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m)) oo fps_exp 1 - 1) $ n
[PROOF STEP]
by (simp add: fps_compose_def atLeast0AtMost fps_sum_nth)
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>n. (- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n) = (Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m)) oo fps_exp 1 - 1) $ n

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m\<le>n. (- 1) ^ m / real (Suc m) * (fps_exp 1 - 1) ^ m $ n) = (Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m)) oo fps_exp 1 - 1) $ n

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "fps_ln 1 = fps_X * Abs_fps (\<lambda>m. (-1) ^ m / real (Suc m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_ln 1 = fps_X * Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m))
[PROOF STEP]
unfolding fps_ln_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_const (1 / 1) * Abs_fps (\<lambda>n. if n = 0 then 0 else (- 1) ^ (n - 1) / real n) = fps_X * Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m))
[PROOF STEP]
by (auto simp: fps_eq_iff)
[PROOF STATE]
proof (state)
this:
fps_ln 1 = fps_X * Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m))

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
hence "Abs_fps (\<lambda>m. (-1) ^ m / real (Suc m)) = fps_ln 1 / fps_X"
[PROOF STATE]
proof (prove)
using this:
fps_ln 1 = fps_X * Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m))

goal (1 subgoal):
 1. Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m)) = fps_ln 1 / fps_X
[PROOF STEP]
by (metis fps_X_neq_zero nonzero_mult_div_cancel_left)
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m)) = fps_ln 1 / fps_X

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>m. (- 1) ^ m / real (Suc m)) = fps_ln 1 / fps_X

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "fps_compose \<dots> (fps_exp 1 - 1) =
               fps_compose (fps_ln 1) (fps_exp 1 - 1) / (fps_exp 1 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_ln 1 / fps_X oo fps_exp 1 - 1 = (fps_ln 1 oo fps_exp 1 - 1) / (fps_exp 1 - 1)
[PROOF STEP]
by (subst fps_compose_divide_distrib) auto
[PROOF STATE]
proof (state)
this:
fps_ln 1 / fps_X oo fps_exp 1 - 1 = (fps_ln 1 oo fps_exp 1 - 1) / (fps_exp 1 - 1)

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_ln 1 / fps_X oo fps_exp 1 - 1 = (fps_ln 1 oo fps_exp 1 - 1) / (fps_exp 1 - 1)

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "fps_compose (fps_ln 1) (fps_exp 1 - 1 :: real fps) = fps_X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_ln 1 oo fps_exp 1 - 1 = fps_X
[PROOF STEP]
by (simp add: fps_ln_fps_exp_inv fps_inv_fps_exp_compose)
[PROOF STATE]
proof (state)
this:
fps_ln 1 oo fps_exp 1 - 1 = fps_X

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_ln 1 oo fps_exp 1 - 1 = fps_X

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "(fps_X / (fps_exp 1 - 1)) = bernoulli_fps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_X / (fps_exp (1::'a) - 1) = bernoulli_fps
[PROOF STEP]
by (simp add: bernoulli_fps_def)
[PROOF STATE]
proof (state)
this:
fps_X / (fps_exp (1::?'a1) - 1) = bernoulli_fps

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_X / (fps_exp (1::?'a1) - 1) = bernoulli_fps

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
have "fact n * \<dots> $ n = bernoulli n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n * bernoulli_fps $ n = bernoulli n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact n * bernoulli_fps $ n = bernoulli n

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m)) = bernoulli n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m)) = bernoulli n

goal (1 subgoal):
 1. bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
bernoulli n = (\<Sum>m\<le>n. \<Sum>k\<le>m. (- 1) ^ k * real (m choose k) * real k ^ n / real (Suc m))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Carmichael_1 [simp]: "Carmichael 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Carmichael 1 = 1
[PROOF STEP]
by (simp add: Carmichael_def)


[STATEMENT]
lemma hnorm_scaleHR: "\<And>a (x::'a::real_normed_vector star). hnorm (scaleHR a x) = \<bar>a\<bar> * hnorm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x. hnorm (scaleHR a x) = \<bar>a\<bar> * hnorm x
[PROOF STEP]
by transfer (rule norm_scaleR)


[STATEMENT]
lemma vderiv_cosI[poly_derivatives]:
  assumes "D (f::real \<Rightarrow> real) = f' on T" and "g = (\<lambda>t. - (f' t) * sin (f t))"
  shows "D (\<lambda>t. cos (f t)) = g on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1.  D (\<lambda>t. cos (f t)) = g on T
[PROOF STEP]
apply(rule vderiv_on_composeI[OF _ assms(1), of "\<lambda>t. cos t"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1.  D cos = ?f' on f ` T
 2. g = (\<lambda>t. f' t *\<^sub>R ?f' (f t))
[PROOF STEP]
unfolding has_vderiv_on_def has_vector_derivative_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>f ` T. D cos \<mapsto> (\<lambda>xa. xa *\<^sub>R ?f' x) at x within f ` T
 2. g = (\<lambda>t. f' t *\<^sub>R ?f' (f t))
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: assms)


[STATEMENT]
lemma mpoly_of_poly_mult [simp]:
  fixes p q :: "'a :: comm_semiring_1 poly"
  shows "mpoly_of_poly i (p * q) = mpoly_of_poly i p * mpoly_of_poly i q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpoly_of_poly i (p * q) = mpoly_of_poly i p * mpoly_of_poly i q
[PROOF STEP]
by (induction p) (auto simp: algebra_simps smult_conv_mult_Const)


[STATEMENT]
lemma (in CRR_market) zero_pf_neg_uvp:
  assumes "stock_portfolio Mkt pf"
  and "pf stk (Suc n) w = 0"
  and "pf risk_free_asset (Suc n) w \<noteq> 0"
  and "val_process Mkt pf n w \<le> 0"
shows "cls_val_process Mkt pf (Suc n) w < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
have "cls_val_process Mkt pf (Suc n) w =
    S (Suc n) w * pf stk (Suc n) w +
    disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w = S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stock_portfolio Mkt pf
pf stk (Suc n) w = 0
pf risk_free_asset (Suc n) w \<noteq> 0
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w = S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w
[PROOF STEP]
by (simp add:stock_pf_uvp_expand)
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc n) w = S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc n) w = S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
have "... = disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w = disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stock_portfolio Mkt pf
pf stk (Suc n) w = 0
pf risk_free_asset (Suc n) w \<noteq> 0
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w = disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w = disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S (Suc n) w * pf stk (Suc n) w + disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w = disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
have "... = (1+r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w = (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w = (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
disc_rfr_proc r (Suc n) w * pf risk_free_asset (Suc n) w = (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
have "... < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have "0 < 1+r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + r
[PROOF STEP]
using acceptable_rate
[PROOF STATE]
proof (prove)
using this:
- 1 < r

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

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < 1 + r

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have "0 < disc_rfr_proc r n w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < disc_rfr_proc r n w
[PROOF STEP]
using acceptable_rate
[PROOF STATE]
proof (prove)
using this:
- 1 < r

goal (1 subgoal):
 1. 0 < disc_rfr_proc r n w
[PROOF STEP]
by (simp add: disc_rfr_proc_positive)
[PROOF STATE]
proof (state)
this:
0 < disc_rfr_proc r n w

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < 1 + r
0 < disc_rfr_proc r n w
[PROOF STEP]
have "0 < (1+r) * disc_rfr_proc r n w"
[PROOF STATE]
proof (prove)
using this:
0 < 1 + r
0 < disc_rfr_proc r n w

goal (1 subgoal):
 1. 0 < (1 + r) * disc_rfr_proc r n w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < (1 + r) * disc_rfr_proc r n w

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have 1: "0< pf risk_free_asset (Suc n) w \<longrightarrow> 0 <(1+r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < pf risk_free_asset (Suc n) w \<longrightarrow> 0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
proof (intro impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < pf risk_free_asset (Suc n) w \<Longrightarrow> 0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
assume "0 < pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (state)
this:
0 < pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. 0 < pf risk_free_asset (Suc n) w \<Longrightarrow> 0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
thus "0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
using this:
0 < pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. 0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
using \<open>0 < (1+r) * disc_rfr_proc r n w\<close>
[PROOF STATE]
proof (prove)
using this:
0 < pf risk_free_asset (Suc n) w
0 < (1 + r) * disc_rfr_proc r n w

goal (1 subgoal):
 1. 0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < pf risk_free_asset (Suc n) w \<longrightarrow> 0 < (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have 2: "pf risk_free_asset (Suc n) w < 0 \<longrightarrow> (1+r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pf risk_free_asset (Suc n) w < 0 \<longrightarrow> (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
proof (intro impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pf risk_free_asset (Suc n) w < 0 \<Longrightarrow> (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
assume "pf risk_free_asset (Suc n) w < 0"
[PROOF STATE]
proof (state)
this:
pf risk_free_asset (Suc n) w < 0

goal (1 subgoal):
 1. pf risk_free_asset (Suc n) w < 0 \<Longrightarrow> (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
thus "(1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0"
[PROOF STATE]
proof (prove)
using this:
pf risk_free_asset (Suc n) w < 0

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
using \<open>0 < (1+r) * disc_rfr_proc r n w\<close>
[PROOF STATE]
proof (prove)
using this:
pf risk_free_asset (Suc n) w < 0
0 < (1 + r) * disc_rfr_proc r n w

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
by (simp add:mult_pos_neg)
[PROOF STATE]
proof (state)
this:
(1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pf risk_free_asset (Suc n) w < 0 \<longrightarrow> (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have "0 \<ge> val_process Mkt pf n w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val_process Mkt pf n w \<le> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stock_portfolio Mkt pf
pf stk (Suc n) w = 0
pf risk_free_asset (Suc n) w \<noteq> 0
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. val_process Mkt pf n w \<le> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have "val_process Mkt pf n w = geom_proc n w * pf stk (Suc n) w +
      disc_rfr_proc r n w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val_process Mkt pf n w = geom_proc n w * pf stk (Suc n) w + disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stock_portfolio Mkt pf
pf stk (Suc n) w = 0
pf risk_free_asset (Suc n) w \<noteq> 0
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. val_process Mkt pf n w = geom_proc n w * pf stk (Suc n) w + disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
by (simp add:stock_pf_vp_expand)
[PROOF STATE]
proof (state)
this:
val_process Mkt pf n w = geom_proc n w * pf stk (Suc n) w + disc_rfr_proc r n w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
val_process Mkt pf n w = geom_proc n w * pf stk (Suc n) w + disc_rfr_proc r n w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have "... = disc_rfr_proc r n w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. geom_proc n w * pf stk (Suc n) w + disc_rfr_proc r n w * pf risk_free_asset (Suc n) w = disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stock_portfolio Mkt pf
pf stk (Suc n) w = 0
pf risk_free_asset (Suc n) w \<noteq> 0
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. geom_proc n w * pf stk (Suc n) w + disc_rfr_proc r n w * pf risk_free_asset (Suc n) w = disc_rfr_proc r n w * pf risk_free_asset (Suc n) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
geom_proc n w * pf stk (Suc n) w + disc_rfr_proc r n w * pf risk_free_asset (Suc n) w = disc_rfr_proc r n w * pf risk_free_asset (Suc n) w

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
disc_rfr_proc r n w * pf risk_free_asset (Suc n) w \<le> 0
[PROOF STEP]
have "0\<ge> disc_rfr_proc r n w * pf risk_free_asset (Suc n) w"
[PROOF STATE]
proof (prove)
using this:
disc_rfr_proc r n w * pf risk_free_asset (Suc n) w \<le> 0

goal (1 subgoal):
 1. disc_rfr_proc r n w * pf risk_free_asset (Suc n) w \<le> 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
disc_rfr_proc r n w * pf risk_free_asset (Suc n) w \<le> 0

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
have "0< pf risk_free_asset (Suc n) w \<or> pf risk_free_asset (Suc n) w < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < pf risk_free_asset (Suc n) w \<or> pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stock_portfolio Mkt pf
pf stk (Suc n) w = 0
pf risk_free_asset (Suc n) w \<noteq> 0
val_process Mkt pf n w \<le> 0

goal (1 subgoal):
 1. 0 < pf risk_free_asset (Suc n) w \<or> pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < pf risk_free_asset (Suc n) w \<or> pf risk_free_asset (Suc n) w < 0

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < pf risk_free_asset (Suc n) w \<or> pf risk_free_asset (Suc n) w < 0

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
using "2" \<open>0 < disc_rfr_proc r n w\<close> \<open>disc_rfr_proc r n w * pf risk_free_asset (Suc n) w \<le> 0\<close>
        mult_pos_pos
[PROOF STATE]
proof (prove)
using this:
0 < pf risk_free_asset (Suc n) w \<or> pf risk_free_asset (Suc n) w < 0
pf risk_free_asset (Suc n) w < 0 \<longrightarrow> (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
0 < disc_rfr_proc r n w
disc_rfr_proc r n w * pf risk_free_asset (Suc n) w \<le> 0
\<lbrakk>(0::?'a) < ?a; (0::?'a) < ?b\<rbrakk> \<Longrightarrow> (0::?'a) < ?a * ?b

goal (1 subgoal):
 1. (1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 + r) * disc_rfr_proc r n w * pf risk_free_asset (Suc n) w < 0

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cls_val_process Mkt pf (Suc n) w < 0

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc n) w < 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc n) w < 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_pairs_list_product: "all_pairs xs = List.product xs xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_pairs xs = List.product xs xs
[PROOF STEP]
by(simp add: all_pairs_def List_product_concat_map)


[STATEMENT]
lemma grid_union_eq: "(\<Union> p \<in> grid b ds. grid p ds') = grid b (ds' \<union> ds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>p\<in>grid b ds. grid p ds') = grid b (ds' \<union> ds)
[PROOF STEP]
using grid_split and grid_transitive[where ds''="ds' \<union> ds" and ds=ds' and ds'=ds, OF _ _ Un_upper2 Un_upper1]
[PROOF STATE]
proof (prove)
using this:
?p \<in> grid ?b (?ds' \<union> ?ds) \<Longrightarrow> \<exists>x\<in>grid ?b ?ds. ?p \<in> grid x ?ds'
\<lbrakk>?a \<in> grid ?b ds'; ?b \<in> grid ?c ds\<rbrakk> \<Longrightarrow> ?a \<in> grid ?c (ds' \<union> ds)

goal (1 subgoal):
 1. (\<Union>p\<in>grid b ds. grid p ds') = grid b (ds' \<union> ds)
[PROOF STEP]
by auto