[STATEMENT]
lemma fds_nth_power_eq_0:
  assumes "n < 2 ^ k" "fds_nth f 1 = 0"
  shows   "fds_nth (f ^ k) n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f ^ k) n = (0::'a)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
n < 2 ^ k

goal (1 subgoal):
 1. fds_nth (f ^ k) n = (0::'a)
[PROOF STEP]
proof (induction k arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. n < 2 ^ 0 \<Longrightarrow> fds_nth (f ^ 0) n = (0::'a)
 2. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n < 2 ^ 0

goal (2 subgoals):
 1. \<And>n. n < 2 ^ 0 \<Longrightarrow> fds_nth (f ^ 0) n = (0::'a)
 2. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
n < 2 ^ 0

goal (1 subgoal):
 1. fds_nth (f ^ 0) n = (0::'a)
[PROOF STEP]
by (simp add: one_fds_def)
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ 0) n = (0::'a)

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
case (Suc k n)
[PROOF STATE]
proof (state)
this:
?n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) ?n = (0::'a)
n < 2 ^ Suc k

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
have "fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n
[PROOF STEP]
by (subst power_Suc2) (simp add: fds_nth_mult dirichlet_prod_commutes)
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n = (0::'a)
[PROOF STEP]
unfolding dirichlet_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. fds_nth (f ^ k) d * fds_nth f (n div d)) = (0::'a)
[PROOF STEP]
proof (intro sum.neutral ballI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {d. d dvd n} \<Longrightarrow> fds_nth (f ^ k) x * fds_nth f (n div x) = (0::'a)
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {d. d dvd n} \<Longrightarrow> fds_nth (f ^ k) x * fds_nth f (n div x) = (0::'a)
[PROOF STEP]
assume d: "d \<in> {d. d dvd n}"
[PROOF STATE]
proof (state)
this:
d \<in> {d. d dvd n}

goal (1 subgoal):
 1. \<And>x. x \<in> {d. d dvd n} \<Longrightarrow> fds_nth (f ^ k) x * fds_nth f (n div x) = (0::'a)
[PROOF STEP]
show "fds_nth (f ^ k) d * fds_nth f (n div d) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
proof (cases "d < 2 ^ k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
 2. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
d < 2 ^ k

goal (2 subgoals):
 1. d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
 2. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d < 2 ^ k

goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
using Suc.IH[of d]
[PROOF STATE]
proof (prove)
using this:
d < 2 ^ k
d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d = (0::'a)

goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> d < 2 ^ k

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
hence "(n div d) * 2 ^ k \<le> (n div d) * d"
[PROOF STATE]
proof (prove)
using this:
\<not> d < 2 ^ k

goal (1 subgoal):
 1. n div d * 2 ^ k \<le> n div d * d
[PROOF STEP]
by (intro mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
n div d * 2 ^ k \<le> n div d * d

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n div d * 2 ^ k \<le> n div d * d

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
from d
[PROOF STATE]
proof (chain)
picking this:
d \<in> {d. d dvd n}
[PROOF STEP]
have "(n div d) * d = n"
[PROOF STATE]
proof (prove)
using this:
d \<in> {d. d dvd n}

goal (1 subgoal):
 1. n div d * d = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n div d * d = n

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n div d * d = n

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
?n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) ?n = (0::'a)
n < 2 ^ Suc k
[PROOF STEP]
have "n < 2 * 2 ^ k"
[PROOF STATE]
proof (prove)
using this:
?n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) ?n = (0::'a)
n < 2 ^ Suc k

goal (1 subgoal):
 1. n < 2 * 2 ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < 2 * 2 ^ k

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n div d * 2 ^ k < 2 * 2 ^ k
[PROOF STEP]
have "n div d \<le> 1"
[PROOF STATE]
proof (prove)
using this:
n div d * 2 ^ k < 2 * 2 ^ k

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

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
fds_nth f 1 = (0::'a)
n div d \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_nth f 1 = (0::'a)
n div d \<le> 1

goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
by (cases "n div d") simp_all
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n = (0::'a)

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fds_nth (f ^ Suc k) n = (0::'a)

goal (1 subgoal):
 1. fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ Suc k) n = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_subinf: "residuated f \<Longrightarrow> conjugate f (x \<sqinter> y) \<le> conjugate f x \<sqinter> conjugate f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated f \<Longrightarrow> conjugate f (x \<sqinter> y) \<le> conjugate f x \<sqinter> conjugate f y
[PROOF STEP]
by (auto simp: conj_iso)


[STATEMENT]
lemma set_subseqs_eq: "set (subseqs ys) = {xs. subseq xs ys}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (subseqs ys) = {xs. subseq xs ys}
[PROOF STEP]
by auto


[STATEMENT]
lemma case_sum_rule:
  "\<lbrakk> \<And>x. v=Inl x \<Longrightarrow> <P> fl x <Q>;
     \<And>x. v=Inr x \<Longrightarrow> <P> fr x <Q> \<rbrakk>
  \<Longrightarrow> <P> case_sum fl fr v <Q>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. v = Inl x \<Longrightarrow> <P> fl x <Q>; \<And>x. v = Inr x \<Longrightarrow> <P> fr x <Q>\<rbrakk> \<Longrightarrow> <P> case v of Inl x \<Rightarrow> fl x | Inr x \<Rightarrow> fr x <Q>
[PROOF STEP]
by (auto split: sum.split)


[STATEMENT]
lemma converse_br_sv_iff[simp]:
  "single_valued (converse (br \<alpha> I)) \<longleftrightarrow> inj_on \<alpha> (Collect I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued ((br \<alpha> I)\<inverse>) = inj_on \<alpha> (Collect I)
[PROOF STEP]
by (auto intro!: inj_onI single_valuedI dest: single_valuedD inj_onD
    simp: br_def) []


[STATEMENT]
lemma path_components_of_maximal:
   "\<lbrakk>C \<in> path_components_of X; path_connectedin X S; ~disjnt C S\<rbrakk> \<Longrightarrow> S \<subseteq> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C \<in> path_components_of X; path_connectedin X S; \<not> disjnt C S\<rbrakk> \<Longrightarrow> S \<subseteq> C
[PROOF STEP]
apply (auto simp: path_components_of_def path_component_of_equiv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> xa \<in> topspace X
 2. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> path_component_of X x = path_component_of X xa
[PROOF STEP]
using path_component_of_maximal path_connectedin_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path_connectedin ?X ?s; ?x \<in> ?s\<rbrakk> \<Longrightarrow> ?s \<subseteq> path_component_of_set ?X ?x
path_connectedin ?X ?S \<equiv> ?S \<subseteq> topspace ?X \<and> path_connected_space (subtopology ?X ?S)

goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> xa \<in> topspace X
 2. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> path_component_of X x = path_component_of X xa
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> path_component_of X x = path_component_of X xa
[PROOF STEP]
by (meson disjnt_subset2 path_component_of_disjoint path_component_of_equiv path_component_of_maximal)


[STATEMENT]
lemma simple_integral_PInf:
  "simple_function M f \<Longrightarrow> integral\<^sup>S M f \<noteq> \<infinity> \<Longrightarrow> emeasure M (f -` {\<infinity>} \<inter> space M) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>simple_function M f; integral\<^sup>S M f \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> emeasure M (f -` {\<infinity>} \<inter> space M) = 0
[PROOF STEP]
by (rule nn_integral_PInf) (auto simp: nn_integral_eq_simple_integral borel_measurable_simple_function)


[STATEMENT]
lemma plus_in_intervalE:
  fixes xy :: "'a :: linordered_ab_group_add"
  assumes "xy \<in>\<^sub>i X + Y"
  obtains x y where "xy = x + y" "x \<in>\<^sub>i X" "y \<in>\<^sub>i Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>xy = x + y; x \<in>\<^sub>i X; y \<in>\<^sub>i Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xy \<in>\<^sub>i X + Y

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>xy = x + y; x \<in>\<^sub>i X; y \<in>\<^sub>i Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_of_plus set_plus_def
[PROOF STATE]
proof (prove)
using this:
xy \<in> {c. \<exists>a\<in>set_of X. \<exists>b\<in>set_of Y. c = a + b}

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>xy = x + y; x \<in>\<^sub>i X; y \<in>\<^sub>i Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural 0 = 0
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma floor_less_numeral [simp]: "\<lfloor>x\<rfloor> < numeral v \<longleftrightarrow> x < numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < numeral v) = (x < numeral v)
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma DirProds_one':
  "i\<in>I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i = \<one>\<^bsub>G i\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i = \<one>\<^bsub>G i\<^esub>
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> I \<Longrightarrow> \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> i = \<one>\<^bsub>G i\<^esub>
[PROOF STEP]
by simp


[STATEMENT]
lemma Fr_ClBr: "Br_1 \<B> \<Longrightarrow> \<forall>A. Fr(A) = (Cl(A) \<and> Br(A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Br_1 \<B> \<Longrightarrow> \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
by (metis BF_rel Br_fr_def CF_rel Cl_fr_def eq_ext' join_def meet_def)


[STATEMENT]
theorem kac_formula_nonergodic:
  assumes A_meas [measurable]: "A \<in> sets M"
  shows "(\<integral>\<^sup>+y. return_time_function A y \<partial>M) = emeasure M (\<Union>n. (T^^n)--`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
define f where "f = (\<lambda>(x::'a). 1::ennreal)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>x. 1)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
have "\<And>x. induced_function A f x = return_time_function A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. induced_function A f x = of_nat (return_time_function A x)
[PROOF STEP]
unfolding induced_function_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<Sum>i<return_time_function A x. 1) = of_nat (return_time_function A x)
[PROOF STEP]
by (simp add:)
[PROOF STATE]
proof (state)
this:
induced_function A f ?x3 = of_nat (return_time_function A ?x3)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
induced_function A f ?x3 = of_nat (return_time_function A ?x3)
[PROOF STEP]
have "(\<integral>\<^sup>+y. return_time_function A y \<partial>M) = (\<integral>\<^sup>+y. induced_function A f y \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
induced_function A f ?x3 = of_nat (return_time_function A ?x3)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = integral\<^sup>N M (induced_function A f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = integral\<^sup>N M (induced_function A f)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = integral\<^sup>N M (induced_function A f)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
have "... = (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
by (rule induced_function_nn_integral) (auto simp add: f_def)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
have "... = emeasure M (\<Union>n. (T^^n)--`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
using f_def
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>x. 1)

goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = emeasure M (\<Union>n. (T ^^ n) --` A)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  I_ZmX_carrier:
  shows "I_ZmX \<in> carrier_mat 4 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I_ZmX \<in> carrier_mat 4 4
[PROOF STEP]
using tensor_mat_carrier ZmX_carrier
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
ZmX \<in> carrier_mat 2 2

goal (1 subgoal):
 1. I_ZmX \<in> carrier_mat 4 4
[PROOF STEP]
unfolding I_ZmX_def
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
ZmX \<in> carrier_mat 2 2

goal (1 subgoal):
 1. 1\<^sub>m 2 \<Otimes> ZmX \<in> carrier_mat 4 4
[PROOF STEP]
by auto


[STATEMENT]
lemma memb_sorted_correct :
  "sorted xs \<Longrightarrow> memb_sorted xs x \<longleftrightarrow> x \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted xs \<Longrightarrow> memb_sorted xs x = (x \<in> set xs)
[PROOF STEP]
by (induct xs) (auto simp add: Ball_def)


[STATEMENT]
lemma (in Corps) mprod_mprodR:"\<lbrakk>\<forall>j \<le> n. e j \<in> Zset; \<forall>j \<le> n. 0 \<le> (e j);
 \<forall>j \<le> n. f j \<in> ((carrier K) - {\<zero>})\<rbrakk> \<Longrightarrow>
              mprod_exp K e f n = mprod_expR K (nat o e) f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K - {\<zero>}\<rbrakk> \<Longrightarrow> mprod_exp K e f n = mprod_expR K (nat \<circ> e) f n
[PROOF STEP]
apply (cut_tac field_is_ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K - {\<zero>}; Ring K\<rbrakk> \<Longrightarrow> mprod_exp K e f n = mprod_expR K (nat \<circ> e) f n
[PROOF STEP]
apply (simp add:mprod_exp_def mprod_expR_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> e\<Pi>\<^bsub>K,n\<^esub> (\<lambda>j. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup>) = e\<Pi>\<^bsub>K,n\<^esub> (\<lambda>j. f j^\<^bsup>K nat (e j)\<^esup>)
[PROOF STEP]
apply (rule Ring.nprod_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> \<in> carrier K
 2. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j^\<^bsup>K nat (e j)\<^esup> \<in> carrier K
 3. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (rule allI, rule impI, simp add:npowf_mem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j^\<^bsup>K nat (e j)\<^esup> \<in> carrier K
 2. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (rule allI, rule impI, rule Ring.npClose, assumption+, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K; j \<le> n\<rbrakk> \<Longrightarrow> f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (simp add:npowf_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma to_Zp_ominus:
  assumes "a \<in> \<O>\<^sub>p"
  shows "to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> (to_Zp a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
have "\<ominus>a \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus> a \<in> \<O>\<^sub>p
[PROOF STEP]
by (simp add: val_ring_subring assms subringE(5))
[PROOF STATE]
proof (state)
this:
\<ominus> a \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<ominus> a \<in> \<O>\<^sub>p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<ominus> a \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
by (metis (no_types, lifting) Zp.domain_axioms Zp.nonzero_one_closed assms
        cring.cring_simprules(3) domain.axioms(1) frac_uminus image_iff inc_to_Zp local.inc_def)
[PROOF STATE]
proof (state)
this:
to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_mset_primes_dvd_imp_subset:
  assumes "prod_mset A dvd prod_mset B" "\<And>p. p \<in># A \<Longrightarrow> prime p" "\<And>p. p \<in># B \<Longrightarrow> prime p"
  shows   "A \<subseteq># B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq># B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># A dvd \<Prod>\<^sub># B
?p1 \<in># A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. A \<subseteq># B
[PROOF STEP]
proof (induction A arbitrary: B)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>B. \<lbrakk>\<Prod>\<^sub># {#} dvd \<Prod>\<^sub># B; \<And>p. p \<in># {#} \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> {#} \<subseteq># B
 2. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<Prod>\<^sub># {#} dvd \<Prod>\<^sub># B
?p1 \<in># {#} \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (2 subgoals):
 1. \<And>B. \<lbrakk>\<Prod>\<^sub># {#} dvd \<Prod>\<^sub># B; \<And>p. p \<in># {#} \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> {#} \<subseteq># B
 2. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># {#} dvd \<Prod>\<^sub># B
?p1 \<in># {#} \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. {#} \<subseteq># B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{#} \<subseteq># B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
case (add p A B)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># ?B1; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># ?B1 \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># ?B1
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
hence p: "prime p"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># ?B1; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># ?B1 \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># ?B1
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

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

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
define B' where "B' = B - {#p#}"
[PROOF STATE]
proof (state)
this:
B' = B - {#p#}

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
from add.prems
[PROOF STATE]
proof (chain)
picking this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
[PROOF STEP]
have "p dvd prod_mset B"
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. p dvd \<Prod>\<^sub># B
[PROOF STEP]
by (simp add: dvd_mult_left)
[PROOF STATE]
proof (state)
this:
p dvd \<Prod>\<^sub># B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
with add.prems
[PROOF STATE]
proof (chain)
picking this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
p dvd \<Prod>\<^sub># B
[PROOF STEP]
have "p \<in># B"
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
p dvd \<Prod>\<^sub># B

goal (1 subgoal):
 1. p \<in># B
[PROOF STEP]
by (subst (asm) (2) prime_dvd_prod_mset_primes_iff) simp_all
[PROOF STATE]
proof (state)
this:
p \<in># B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
hence B: "B = B' + {#p#}"
[PROOF STATE]
proof (prove)
using this:
p \<in># B

goal (1 subgoal):
 1. B = B' + {#p#}
[PROOF STEP]
by (simp add: B'_def)
[PROOF STATE]
proof (state)
this:
B = B' + {#p#}

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
from add.prems p
[PROOF STATE]
proof (chain)
picking this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
prime p
[PROOF STEP]
have "A \<subseteq># B'"
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
prime p

goal (1 subgoal):
 1. A \<subseteq># B'
[PROOF STEP]
by (intro add.IH) (simp_all add: B)
[PROOF STATE]
proof (state)
this:
A \<subseteq># B'

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
A \<subseteq># B'

goal (1 subgoal):
 1. add_mset p A \<subseteq># B
[PROOF STEP]
by (simp add: B)
[PROOF STATE]
proof (state)
this:
add_mset p A \<subseteq># B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_mono_on_mono_on_conv: "
  strict_mono_on f (A::'a::linorder set) = (mono_on f A \<and> inj_on f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SetInterval2.strict_mono_on f A = (SetInterval2.mono_on f A \<and> inj_on f A)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. SetInterval2.strict_mono_on f A \<Longrightarrow> SetInterval2.mono_on f A \<and> inj_on f A
 2. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (frule strict_mono_on_imp_mono_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>SetInterval2.strict_mono_on f A; SetInterval2.mono_on f A\<rbrakk> \<Longrightarrow> SetInterval2.mono_on f A \<and> inj_on f A
 2. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (frule strict_mono_on_imp_inj_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>SetInterval2.strict_mono_on f A; SetInterval2.mono_on f A; inj_on f A\<rbrakk> \<Longrightarrow> SetInterval2.mono_on f A \<and> inj_on f A
 2. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>SetInterval2.mono_on f A; inj_on f A\<rbrakk> \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (unfold inj_on_def mono_on_def strict_mono_on_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a \<le> b \<longrightarrow> f a \<le> f b; \<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y; a \<in> A; b \<in> A; a < b\<rbrakk> \<Longrightarrow> f a < f b
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma edges_less_eq_linorder: "is_linorder_rel edges_less_eq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_linorder_rel edges_less_eq
[PROOF STEP]
unfolding edges_less_eq_def is_linorder_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. fst (snd x) \<le> fst (snd y) \<or> fst (snd y) \<le> fst (snd x)) \<and> (\<forall>x y z. fst (snd x) \<le> fst (snd y) \<longrightarrow> fst (snd y) \<le> fst (snd z) \<longrightarrow> fst (snd x) \<le> fst (snd z))
[PROOF STEP]
by (metis linear order_trans)


[STATEMENT]
lemma unity_root_cong:
  assumes "[m = n] (mod int k)"
  shows   "unity_root k m = unity_root k n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
[m = n] (mod int k)
[PROOF STEP]
have "m mod int k = n mod int k"
[PROOF STATE]
proof (prove)
using this:
[m = n] (mod int k)

goal (1 subgoal):
 1. m mod int k = n mod int k
[PROOF STEP]
by (auto simp: cong_def)
[PROOF STATE]
proof (state)
this:
m mod int k = n mod int k

goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
hence "unity_root k (m mod int k) = unity_root k (n mod int k)"
[PROOF STATE]
proof (prove)
using this:
m mod int k = n mod int k

goal (1 subgoal):
 1. unity_root k (m mod int k) = unity_root k (n mod int k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unity_root k (m mod int k) = unity_root k (n mod int k)

goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
unity_root k (m mod int k) = unity_root k (n mod int k)

goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
by (simp add: unity_root_mod)
[PROOF STATE]
proof (state)
this:
unity_root k m = unity_root k n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_rows_le_dim_columns:
  fixes A :: "real^'n^'m"
  shows "dim(rows A) \<le> dim(columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (rows A) \<le> dim (columns A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (rows A) \<le> dim (columns A)
[PROOF STEP]
have "dim (span (rows A)) \<le> dim (span (columns A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
obtain B where "independent B" "span(rows A) \<subseteq> span B"
              and B: "B \<subseteq> span(rows A)""card B = dim (span(rows A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>independent B; span (rows A) \<subseteq> span B; B \<subseteq> span (rows A); card B = dim (span (rows A))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using basis_exists [of "span(rows A)"]
[PROOF STATE]
proof (prove)
using this:
(\<And>B. \<lbrakk>B \<subseteq> span (rows A); independent B; span (rows A) \<subseteq> span B; card B = dim (span (rows A))\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>independent B; span (rows A) \<subseteq> span B; B \<subseteq> span (rows A); card B = dim (span (rows A))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
independent B
span (rows A) \<subseteq> span B
B \<subseteq> span (rows A)
card B = dim (span (rows A))

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
with span_subspace
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> span ?A; subspace ?B\<rbrakk> \<Longrightarrow> span ?A = ?B
independent B
span (rows A) \<subseteq> span B
B \<subseteq> span (rows A)
card B = dim (span (rows A))
[PROOF STEP]
have eq: "span B = span(rows A)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> span ?A; subspace ?B\<rbrakk> \<Longrightarrow> span ?A = ?B
independent B
span (rows A) \<subseteq> span B
B \<subseteq> span (rows A)
card B = dim (span (rows A))

goal (1 subgoal):
 1. span B = span (rows A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
span B = span (rows A)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
span B = span (rows A)
[PROOF STEP]
have inj: "inj_on ((*v) A) (span B)"
[PROOF STATE]
proof (prove)
using this:
span B = span (rows A)

goal (1 subgoal):
 1. inj_on ((*v) A) (span B)
[PROOF STEP]
by (simp add: inj_on_def matrix_vector_mul_injective_on_rowspace)
[PROOF STATE]
proof (state)
this:
inj_on ((*v) A) (span B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on ((*v) A) (span B)
[PROOF STEP]
have ind: "independent ((*v) A ` B)"
[PROOF STATE]
proof (prove)
using this:
inj_on ((*v) A) (span B)

goal (1 subgoal):
 1. independent ((*v) A ` B)
[PROOF STEP]
by (rule linear_independent_injective_image [OF Finite_Cartesian_Product.matrix_vector_mul_linear \<open>independent B\<close>])
[PROOF STATE]
proof (state)
this:
independent ((*v) A ` B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
have "dim (span (rows A)) \<le> card ((*v) A ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (span (rows A)) \<le> card ((*v) A ` B)
[PROOF STEP]
unfolding B(2)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B \<le> card ((*v) A ` B)
[PROOF STEP]
using inj
[PROOF STATE]
proof (prove)
using this:
inj_on ((*v) A) (span B)

goal (1 subgoal):
 1. card B \<le> card ((*v) A ` B)
[PROOF STEP]
by (auto simp: card_image inj_on_subset span_superset)
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> card ((*v) A ` B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> card ((*v) A ` B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
have "\<dots> \<le> dim (span (columns A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((*v) A ` B) \<le> dim (span (columns A))
[PROOF STEP]
using _ ind
[PROOF STATE]
proof (prove)
using this:
PROP ?psi \<Longrightarrow> PROP ?psi
independent ((*v) A ` B)

goal (1 subgoal):
 1. card ((*v) A ` B) \<le> dim (span (columns A))
[PROOF STEP]
by (rule independent_card_le_dim) (auto intro!: matrix_vector_mult_in_columnspace)
[PROOF STATE]
proof (state)
this:
card ((*v) A ` B) \<le> dim (span (columns A))

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim (span (rows A)) \<le> dim (span (columns A))

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> dim (span (columns A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> dim (span (columns A))

goal (1 subgoal):
 1. dim (rows A) \<le> dim (columns A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim (span (rows A)) \<le> dim (span (columns A))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma select_append:
  assumes "\<forall>y\<in>set ys. \<forall>z\<in>set zs. y \<le> z"
  shows   "k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys"
    and   "k \<in> {length ys..<length ys + length zs} \<Longrightarrow>
             select k (ys @ zs) = select (k - length ys) zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys) &&& (k \<in> {length ys..<length ys + length zs} \<Longrightarrow> select k (ys @ zs) = select (k - length ys) zs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>set ys. \<forall>z\<in>set zs. y \<le> z

goal (1 subgoal):
 1. (k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys) &&& (k \<in> {length ys..<length ys + length zs} \<Longrightarrow> select k (ys @ zs) = select (k - length ys) zs)
[PROOF STEP]
by (simp_all add: select_def sort_append nth_append)


[STATEMENT]
lemma approx_loc_conv_all_nth:
  "approx_loc G hp loc LT =
  (length loc = length LT \<and> (\<forall>n < length loc. approx_val G hp (loc!n) (LT!n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. approx_loc G hp loc LT = (length loc = length LT \<and> (\<forall>n<length loc. approx_val G hp (loc ! n) (LT ! n)))
[PROOF STEP]
by (simp add: approx_loc_def list_all2_conv_all_nth)


[STATEMENT]
lemma univalent_linorder_matrix_1:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  assumes "matrix_stone_relation_algebra.univalent f"
      and "f (i,j) \<noteq> bot"
      and "f (i,k) \<noteq> bot"
    shows "j = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j = k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j = k
[PROOF STEP]
have "(f\<^sup>t \<odot> f) (j,k) = (\<Squnion>\<^sub>l (f\<^sup>t) (j,l) * f (l,k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f\<^sup>t \<odot> f) (j, k) = sup_monoid.sum (\<lambda>l. (f\<^sup>t) (j, l) * f (l, k)) {l. True}
[PROOF STEP]
by (simp add: times_matrix_def)
[PROOF STATE]
proof (state)
this:
(f\<^sup>t \<odot> f) (j, k) = sup_monoid.sum (\<lambda>l. (f\<^sup>t) (j, l) * f (l, k)) {l. True}

goal (1 subgoal):
 1. j = k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f\<^sup>t \<odot> f) (j, k) = sup_monoid.sum (\<lambda>l. (f\<^sup>t) (j, l) * f (l, k)) {l. True}

goal (1 subgoal):
 1. j = k
[PROOF STEP]
have "... = (\<Squnion>\<^sub>l (f (l,j))\<^sup>T * f (l,k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>l. (f\<^sup>t) (j, l) * f (l, k)) {l. True} = sup_monoid.sum (\<lambda>l. f (l, j)\<^sup>T * f (l, k)) {l. True}
[PROOF STEP]
by (simp add: conv_matrix_def)
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>l. (f\<^sup>t) (j, l) * f (l, k)) {l. True} = sup_monoid.sum (\<lambda>l. f (l, j)\<^sup>T * f (l, k)) {l. True}

goal (1 subgoal):
 1. j = k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>l. (f\<^sup>t) (j, l) * f (l, k)) {l. True} = sup_monoid.sum (\<lambda>l. f (l, j)\<^sup>T * f (l, k)) {l. True}

goal (1 subgoal):
 1. j = k
[PROOF STEP]
have "... = (\<Squnion>\<^sub>l f (l,j) * f (l,k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>l. f (l, j)\<^sup>T * f (l, k)) {l. True} = sup_monoid.sum (\<lambda>l. f (l, j) * f (l, k)) {l. True}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>l. f (l, j)\<^sup>T * f (l, k)) {l. True} = sup_monoid.sum (\<lambda>l. f (l, j) * f (l, k)) {l. True}

goal (1 subgoal):
 1. j = k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>l. f (l, j)\<^sup>T * f (l, k)) {l. True} = sup_monoid.sum (\<lambda>l. f (l, j) * f (l, k)) {l. True}

goal (1 subgoal):
 1. j = k
[PROOF STEP]
have "... \<ge> f (i,j) * f (i,k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (i, j) * f (i, k) \<le> sup_monoid.sum (\<lambda>l. f (l, j) * f (l, k)) {l. True}
[PROOF STEP]
using comp_inf.ub_sum
[PROOF STATE]
proof (prove)
using this:
?f ?i \<le> sup_monoid.sum ?f {k. True}

goal (1 subgoal):
 1. f (i, j) * f (i, k) \<le> sup_monoid.sum (\<lambda>l. f (l, j) * f (l, k)) {l. True}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f (i, j) * f (i, k) \<le> sup_monoid.sum (\<lambda>l. f (l, j) * f (l, k)) {l. True}

goal (1 subgoal):
 1. j = k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (i, j) * f (i, k) \<le> (f\<^sup>t \<odot> f) (j, k)
[PROOF STEP]
have "(f\<^sup>t \<odot> f) (j,k) \<noteq> bot"
[PROOF STATE]
proof (prove)
using this:
f (i, j) * f (i, k) \<le> (f\<^sup>t \<odot> f) (j, k)

goal (1 subgoal):
 1. (f\<^sup>t \<odot> f) (j, k) \<noteq> bot
[PROOF STEP]
using assms(2,3) bot.extremum_uniqueI times_dense
[PROOF STATE]
proof (prove)
using this:
f (i, j) * f (i, k) \<le> (f\<^sup>t \<odot> f) (j, k)
f (i, j) \<noteq> bot
f (i, k) \<noteq> bot
?a \<le> bot \<Longrightarrow> ?a = bot
\<lbrakk>?x \<noteq> bot; ?y \<noteq> bot\<rbrakk> \<Longrightarrow> ?x * ?y \<noteq> bot

goal (1 subgoal):
 1. (f\<^sup>t \<odot> f) (j, k) \<noteq> bot
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(f\<^sup>t \<odot> f) (j, k) \<noteq> bot

goal (1 subgoal):
 1. j = k
[PROOF STEP]
hence "mone (j,k) \<noteq> (bot::'b)"
[PROOF STATE]
proof (prove)
using this:
(f\<^sup>t \<odot> f) (j, k) \<noteq> bot

goal (1 subgoal):
 1. mone (j, k) \<noteq> bot
[PROOF STEP]
by (metis assms(1) bot.extremum_uniqueI less_eq_matrix_def)
[PROOF STATE]
proof (state)
this:
mone (j, k) \<noteq> bot

goal (1 subgoal):
 1. j = k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
mone (j, k) \<noteq> bot

goal (1 subgoal):
 1. j = k
[PROOF STEP]
by (metis (mono_tags, lifting) case_prod_conv one_matrix_def)
[PROOF STATE]
proof (state)
this:
j = k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_err_trans [rule_format]:
  "order r A \<Longrightarrow> e1 \<in> err A \<Longrightarrow> e2 \<in> err A \<Longrightarrow> e3 \<in> err  A \<Longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e2 \<longrightarrow> e2 \<sqsubseteq>\<^bsub>le r\<^esub> e3 \<longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; e1 \<in> err A; e2 \<in> err A; e3 \<in> err A\<rbrakk> \<Longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e2 \<longrightarrow> e2 \<sqsubseteq>\<^bsub>le r\<^esub> e3 \<longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e3
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; e1 \<in> err A; e2 \<in> err A; e3 \<in> err A\<rbrakk> \<Longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e2 \<longrightarrow> e2 \<sqsubseteq>\<^bsub>le r\<^esub> e3 \<longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e3
[PROOF STEP]
apply (unfold unfold_lesub_err le_def err_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; e1 \<in> insert Err {OK x |x. x \<in> A}; e2 \<in> insert Err {OK x |x. x \<in> A}; e3 \<in> insert Err {OK x |x. x \<in> A}\<rbrakk> \<Longrightarrow> (case e2 of Err \<Rightarrow> True | OK y \<Rightarrow> case e1 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y) \<longrightarrow> (case e3 of Err \<Rightarrow> True | OK y \<Rightarrow> case e2 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y) \<longrightarrow> (case e3 of Err \<Rightarrow> True | OK y \<Rightarrow> case e1 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y)
[PROOF STEP]
apply (simp split: err.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; e1 = Err \<or> (\<exists>x. e1 = OK x \<and> x \<in> A); e2 = Err \<or> (\<exists>x. e2 = OK x \<and> x \<in> A); e3 = Err \<or> (\<exists>x. e3 = OK x \<and> x \<in> A)\<rbrakk> \<Longrightarrow> \<forall>x2 x2a. e1 = OK x2a \<longrightarrow> e3 = OK x2 \<longrightarrow> (\<forall>x2b. e2 = OK x2b \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2b \<longrightarrow> x2b \<sqsubseteq>\<^bsub>r\<^esub> x2 \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2)
[PROOF STEP]
apply (blast intro: order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma FDOM_eff_subset_FDOM_valid_states:
  fixes p e s
  assumes "(p, e) \<in> PROB" "(s \<in> valid_states PROB)"
  shows "(fmdom' e \<subseteq> fmdom' s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
have "fmdom' e \<subseteq> action_dom p e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' e \<subseteq> action_dom p e
[PROOF STEP]
unfolding action_dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' p \<union> fmdom' e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
fmdom' e \<subseteq> action_dom p e

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fmdom' e \<subseteq> action_dom p e

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
have "\<dots> \<subseteq> prob_dom PROB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. action_dom p e \<subseteq> prob_dom PROB
[PROOF STEP]
unfolding action_dom_def prob_dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' p \<union> fmdom' e \<subseteq> (\<Union>(s1, s2)\<in>PROB. fmdom' s1 \<union> fmdom' s2)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
(p, e) \<in> PROB

goal (1 subgoal):
 1. fmdom' p \<union> fmdom' e \<subseteq> (\<Union>(s1, s2)\<in>PROB. fmdom' s1 \<union> fmdom' s2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
action_dom p e \<subseteq> prob_dom PROB

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fmdom' e \<subseteq> prob_dom PROB
[PROOF STEP]
have "fmdom' e \<subseteq> fmdom' s"
[PROOF STATE]
proof (prove)
using this:
fmdom' e \<subseteq> prob_dom PROB

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fmdom' e \<subseteq> prob_dom PROB
(p, e) \<in> PROB
s \<in> valid_states PROB

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
by (auto simp: valid_states_def)
[PROOF STATE]
proof (state)
this:
fmdom' e \<subseteq> fmdom' s

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
fmdom' e \<subseteq> fmdom' s

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
show "fmdom' e \<subseteq> fmdom' s"
[PROOF STATE]
proof (prove)
using this:
fmdom' e \<subseteq> fmdom' s

goal (1 subgoal):
 1. fmdom' e \<subseteq> fmdom' s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fmdom' e \<subseteq> fmdom' s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_power_mult_nat:
  fixes p :: nat
  assumes p: "prime p" and xy: "x * y = p ^ k"
  shows "\<exists>i j. x = p ^ i \<and> y = p^ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
using xy
[PROOF STATE]
proof (prove)
using this:
x * y = p ^ k

goal (1 subgoal):
 1. \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
proof(induct k arbitrary: x y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. x * y = p ^ 0 \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
 2. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
x * y = p ^ 0

goal (2 subgoals):
 1. \<And>x y. x * y = p ^ 0 \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
 2. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x * y = p ^ 0

goal (1 subgoal):
 1. \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = Suc 0 \<and> y = Suc 0 \<Longrightarrow> \<exists>i. Suc 0 = p ^ i
[PROOF STEP]
by (rule exI[where x="0"], simp)
[PROOF STATE]
proof (state)
this:
\<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
case (Suc k x y)
[PROOF STATE]
proof (state)
this:
?x * ?y = p ^ k \<Longrightarrow> \<exists>i j. ?x = p ^ i \<and> ?y = p ^ j
x * y = p ^ Suc k

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
from Suc.prems
[PROOF STATE]
proof (chain)
picking this:
x * y = p ^ Suc k
[PROOF STEP]
have pxy: "p dvd x*y"
[PROOF STATE]
proof (prove)
using this:
x * y = p ^ Suc k

goal (1 subgoal):
 1. p dvd x * y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p dvd x * y

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
from prime_dvd_multD [OF p pxy]
[PROOF STATE]
proof (chain)
picking this:
p dvd x \<or> p dvd y
[PROOF STEP]
have pxyc: "p dvd x \<or> p dvd y"
[PROOF STATE]
proof (prove)
using this:
p dvd x \<or> p dvd y

goal (1 subgoal):
 1. p dvd x \<or> p dvd y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p dvd x \<or> p dvd y

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
prime p
[PROOF STEP]
have p0: "p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
by - (rule ccontr, simp)
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
assume px: "p dvd x"
[PROOF STATE]
proof (state)
this:
p dvd x

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p dvd x
[PROOF STEP]
obtain d where d: "x = p*d"
[PROOF STATE]
proof (prove)
using this:
p dvd x

goal (1 subgoal):
 1. (\<And>d. x = p * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. x = p * k

goal (1 subgoal):
 1. (\<And>d. x = p * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = p * d

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
from Suc.prems d
[PROOF STATE]
proof (chain)
picking this:
x * y = p ^ Suc k
x = p * d
[PROOF STEP]
have "p*d*y = p^Suc k"
[PROOF STATE]
proof (prove)
using this:
x * y = p ^ Suc k
x = p * d

goal (1 subgoal):
 1. p * d * y = p ^ Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p * d * y = p ^ Suc k

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
hence th: "d*y = p^k"
[PROOF STATE]
proof (prove)
using this:
p * d * y = p ^ Suc k

goal (1 subgoal):
 1. d * y = p ^ k
[PROOF STEP]
using p0
[PROOF STATE]
proof (prove)
using this:
p * d * y = p ^ Suc k
p \<noteq> 0

goal (1 subgoal):
 1. d * y = p ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d * y = p ^ k

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
from Suc.hyps[OF th]
[PROOF STATE]
proof (chain)
picking this:
\<exists>i j. d = p ^ i \<and> y = p ^ j
[PROOF STEP]
obtain i j where ij: "d = p^i" "y = p^j"
[PROOF STATE]
proof (prove)
using this:
\<exists>i j. d = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>d = p ^ i; y = p ^ j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d = p ^ i
y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
with d
[PROOF STATE]
proof (chain)
picking this:
x = p * d
d = p ^ i
y = p ^ j
[PROOF STEP]
have "x = p^Suc i"
[PROOF STATE]
proof (prove)
using this:
x = p * d
d = p ^ i
y = p ^ j

goal (1 subgoal):
 1. x = p ^ Suc i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = p ^ Suc i

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
with ij(2)
[PROOF STATE]
proof (chain)
picking this:
y = p ^ j
x = p ^ Suc i
[PROOF STEP]
have ?case
[PROOF STATE]
proof (prove)
using this:
y = p ^ j
x = p ^ Suc i

goal (1 subgoal):
 1. \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
p dvd x \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p dvd x \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
p dvd x \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
assume px: "p dvd y"
[PROOF STATE]
proof (state)
this:
p dvd y

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p dvd y
[PROOF STEP]
obtain d where d: "y = p*d"
[PROOF STATE]
proof (prove)
using this:
p dvd y

goal (1 subgoal):
 1. (\<And>d. y = p * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. y = p * k

goal (1 subgoal):
 1. (\<And>d. y = p * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = p * d

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
from Suc.prems d
[PROOF STATE]
proof (chain)
picking this:
x * y = p ^ Suc k
y = p * d
[PROOF STEP]
have "p*d*x = p^Suc k"
[PROOF STATE]
proof (prove)
using this:
x * y = p ^ Suc k
y = p * d

goal (1 subgoal):
 1. p * d * x = p ^ Suc k
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
p * d * x = p ^ Suc k

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
hence th: "d*x = p^k"
[PROOF STATE]
proof (prove)
using this:
p * d * x = p ^ Suc k

goal (1 subgoal):
 1. d * x = p ^ k
[PROOF STEP]
using p0
[PROOF STATE]
proof (prove)
using this:
p * d * x = p ^ Suc k
p \<noteq> 0

goal (1 subgoal):
 1. d * x = p ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d * x = p ^ k

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
from Suc.hyps[OF th]
[PROOF STATE]
proof (chain)
picking this:
\<exists>i j. d = p ^ i \<and> x = p ^ j
[PROOF STEP]
obtain i j where ij: "d = p^i" "x = p^j"
[PROOF STATE]
proof (prove)
using this:
\<exists>i j. d = p ^ i \<and> x = p ^ j

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>d = p ^ i; x = p ^ j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d = p ^ i
x = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
with d
[PROOF STATE]
proof (chain)
picking this:
y = p * d
d = p ^ i
x = p ^ j
[PROOF STEP]
have "y = p^Suc i"
[PROOF STATE]
proof (prove)
using this:
y = p * d
d = p ^ i
x = p ^ j

goal (1 subgoal):
 1. y = p ^ Suc i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = p ^ Suc i

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
with ij(2)
[PROOF STATE]
proof (chain)
picking this:
x = p ^ j
y = p ^ Suc i
[PROOF STEP]
have ?case
[PROOF STATE]
proof (prove)
using this:
x = p ^ j
y = p ^ Suc i

goal (1 subgoal):
 1. \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
p dvd y \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<And>k x y. \<lbrakk>\<And>x y. x * y = p ^ k \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j; x * y = p ^ Suc k\<rbrakk> \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p dvd x \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
p dvd y \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p dvd x \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
p dvd y \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j

goal (1 subgoal):
 1. \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
using pxyc
[PROOF STATE]
proof (prove)
using this:
p dvd x \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
p dvd y \<Longrightarrow> \<exists>i j. x = p ^ i \<and> y = p ^ j
p dvd x \<or> p dvd y

goal (1 subgoal):
 1. \<exists>i j. x = p ^ i \<and> y = p ^ j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>i j. x = p ^ i \<and> y = p ^ j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordertype_infinite_ge_\<omega>:
  assumes "infinite A" "small A"
  shows "ordertype A VWF \<ge> \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
have "inj_on (ordermap A VWF) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (ordermap A VWF) A
[PROOF STEP]
by (meson ordermap_bij \<open>small A\<close> bij_betw_def total_on_VWF wf_VWF)
[PROOF STATE]
proof (state)
this:
inj_on (ordermap A VWF) A

goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on (ordermap A VWF) A
[PROOF STEP]
have "infinite (ordermap A VWF ` A)"
[PROOF STATE]
proof (prove)
using this:
inj_on (ordermap A VWF) A

goal (1 subgoal):
 1. infinite (ordermap A VWF ` A)
[PROOF STEP]
using \<open>infinite A\<close> finite_image_iff
[PROOF STATE]
proof (prove)
using this:
inj_on (ordermap A VWF) A
infinite A
inj_on ?f ?A \<Longrightarrow> finite (?f ` ?A) = finite ?A

goal (1 subgoal):
 1. infinite (ordermap A VWF ` A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
infinite (ordermap A VWF ` A)

goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite (ordermap A VWF ` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (ordermap A VWF ` A)

goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
using Ord_ordertype \<open>small A\<close> infinite_Ord_omega
[PROOF STATE]
proof (prove)
using this:
infinite (ordermap A VWF ` A)
Ord (ordertype ?A VWF)
small A
\<lbrakk>Ord ?\<alpha>; infinite (elts ?\<alpha>)\<rbrakk> \<Longrightarrow> \<omega> \<le> ?\<alpha>

goal (1 subgoal):
 1. \<omega> \<le> ordertype A VWF
[PROOF STEP]
by (auto simp: ordertype_def)
[PROOF STATE]
proof (state)
this:
\<omega> \<le> ordertype A VWF

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_summable_on_bounded_linear:
  assumes \<open>bounded_linear f\<close>
  assumes \<open>g abs_summable_on S\<close>
  shows \<open>(f o g) abs_summable_on S\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> g abs_summable_on S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<circ> g abs_summable_on S
[PROOF STEP]
have bound: \<open>norm (f (g x)) \<le> onorm f * norm (g x)\<close> for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f (g x)) \<le> onorm f * norm (g x)
[PROOF STEP]
apply (rule onorm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f
[PROOF STEP]
by (simp add: assms(1))
[PROOF STATE]
proof (state)
this:
norm (f (g ?x)) \<le> onorm f * norm (g ?x)

goal (1 subgoal):
 1. f \<circ> g abs_summable_on S
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
g abs_summable_on S
[PROOF STEP]
have \<open>(\<lambda>x. onorm f *\<^sub>R g x) abs_summable_on S\<close>
[PROOF STATE]
proof (prove)
using this:
g abs_summable_on S

goal (1 subgoal):
 1. (\<lambda>x. onorm f *\<^sub>R g x) abs_summable_on S
[PROOF STEP]
by (auto intro!: summable_on_cmult_right)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. onorm f *\<^sub>R g x) abs_summable_on S

goal (1 subgoal):
 1. f \<circ> g abs_summable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. onorm f *\<^sub>R g x) abs_summable_on S
[PROOF STEP]
have \<open>(\<lambda>x. f (g x)) abs_summable_on S\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. onorm f *\<^sub>R g x) abs_summable_on S

goal (1 subgoal):
 1. (\<lambda>x. f (g x)) abs_summable_on S
[PROOF STEP]
apply (rule abs_summable_on_comparison_test)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> norm (f (g x)) \<le> norm (onorm f *\<^sub>R g x)
[PROOF STEP]
using bound
[PROOF STATE]
proof (prove)
using this:
norm (f (g ?x)) \<le> onorm f * norm (g ?x)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> norm (f (g x)) \<le> norm (onorm f *\<^sub>R g x)
[PROOF STEP]
by (auto simp: assms(1) onorm_pos_le)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x)) abs_summable_on S

goal (1 subgoal):
 1. f \<circ> g abs_summable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (g x)) abs_summable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (g x)) abs_summable_on S

goal (1 subgoal):
 1. f \<circ> g abs_summable_on S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<circ> g abs_summable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma refl_on_allrel: "refl_on A (A \<times> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on A (A \<times> A)
[PROOF STEP]
unfolding refl_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> A \<subseteq> A \<times> A \<and> (\<forall>x\<in>A. (x, x) \<in> A \<times> A)
[PROOF STEP]
by simp


[STATEMENT]
lemma test_inf_left_dist_sup:
  assumes "test x"
      and "test y"
      and "test z"
    shows "x \<sqinter> (y \<squnion> z) = (x \<sqinter> y) \<squnion> (x \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z
[PROOF STEP]
have "x \<sqinter> (y \<squnion> z) = (y \<squnion> z) \<sqinter> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<squnion> z) = (y \<squnion> z) \<sqinter> x
[PROOF STEP]
using assms test_sup_closed test_inf_commutative
[PROOF STATE]
proof (prove)
using this:
test x
test y
test z
\<lbrakk>test ?x; test ?y\<rbrakk> \<Longrightarrow> test (?x \<squnion> ?y)
\<lbrakk>test ?x; test ?y\<rbrakk> \<Longrightarrow> ?x \<sqinter> ?y = ?y \<sqinter> ?x

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

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

goal (1 subgoal):
 1. x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z
[PROOF STEP]
have "... = (y \<sqinter> x) \<squnion> (z \<sqinter> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<squnion> z) \<sqinter> x = y \<sqinter> x \<squnion> z \<sqinter> x
[PROOF STEP]
using il_inf_right_dist_sup
[PROOF STATE]
proof (prove)
using this:
(?x \<squnion> ?y) \<sqinter> ?z = ?x \<sqinter> ?z \<squnion> ?y \<sqinter> ?z

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

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

goal (1 subgoal):
 1. x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z
[PROOF STEP]
have "... = (x \<sqinter> y) \<squnion> (x \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> x \<squnion> z \<sqinter> x = x \<sqinter> y \<squnion> x \<sqinter> z
[PROOF STEP]
using assms test_sup_closed test_inf_commutative
[PROOF STATE]
proof (prove)
using this:
test x
test y
test z
\<lbrakk>test ?x; test ?y\<rbrakk> \<Longrightarrow> test (?x \<squnion> ?y)
\<lbrakk>test ?x; test ?y\<rbrakk> \<Longrightarrow> ?x \<sqinter> ?y = ?y \<sqinter> ?x

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

goal (1 subgoal):
 1. x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma viette2'_monic:
  fixes b c \<xi> :: real
  assumes "b\<^sup>2 - 4*c = 0" and "\<xi>\<^sup>2 + b*\<xi> + c = 0"
  shows "\<xi>*\<xi> = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<xi> * \<xi> = c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b\<^sup>2 - 4 * c = 0
\<xi>\<^sup>2 + b * \<xi> + c = 0

goal (1 subgoal):
 1. \<xi> * \<xi> = c
[PROOF STEP]
by algebra


[STATEMENT]
lemma bs_union_correct: "bs_\<alpha> (bs_union s1 s2) = bs_\<alpha> s1 \<union> bs_\<alpha> s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bs_\<alpha> (bs_union s1 s2) = bs_\<alpha> s1 \<union> bs_\<alpha> s2
[PROOF STEP]
unfolding bs_\<alpha>_def bs_union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. bit (s1 OR s2) n} = {n. bit s1 n} \<union> {n. bit s2 n}
[PROOF STEP]
by transfer (simp add: bit_eq_iff, auto simp add: bit_simps)


[STATEMENT]
lemma akra_bazzi_p_strict_mono:
  assumes "x < y"
  shows "(\<Sum>i<k. as!i * bs!i powr y) < (\<Sum>i<k. as!i * bs!i powr x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. as ! i * bs ! i powr y) < (\<Sum>i<k. as ! i * bs ! i powr x)
[PROOF STEP]
proof (intro sum_strict_mono_ex1 ballI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
 3. \<exists>a\<in>{..<k}. as ! a * bs ! a powr y < as ! a * bs ! a powr x
[PROOF STEP]
from ex_a_pos
[PROOF STATE]
proof (chain)
picking this:
\<exists>a\<in>set as. 0 < a
[PROOF STEP]
obtain a where "a \<in> set as" "a > 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>a\<in>set as. 0 < a

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> set as; 0 < a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> set as
0 < a

goal (3 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
 3. \<exists>a\<in>{..<k}. as ! a * bs ! a powr y < as ! a * bs ! a powr x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> set as
0 < a
[PROOF STEP]
obtain i where "i < k" "as!i > 0"
[PROOF STATE]
proof (prove)
using this:
a \<in> set as
0 < a

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < k; 0 < as ! i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: in_set_conv_nth length_as)
[PROOF STATE]
proof (state)
this:
i < k
0 < as ! i

goal (3 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
 3. \<exists>a\<in>{..<k}. as ! a * bs ! a powr y < as ! a * bs ! a powr x
[PROOF STEP]
with b_bounds \<open>x < y\<close>
[PROOF STATE]
proof (chain)
picking this:
?b \<in> set bs \<Longrightarrow> ?b \<in> {0<..<1}
x < y
i < k
0 < as ! i
[PROOF STEP]
have "as!i * bs!i powr y < as!i * bs!i powr x"
[PROOF STATE]
proof (prove)
using this:
?b \<in> set bs \<Longrightarrow> ?b \<in> {0<..<1}
x < y
i < k
0 < as ! i

goal (1 subgoal):
 1. as ! i * bs ! i powr y < as ! i * bs ! i powr x
[PROOF STEP]
by (intro mult_strict_left_mono powr_less_mono') auto
[PROOF STATE]
proof (state)
this:
as ! i * bs ! i powr y < as ! i * bs ! i powr x

goal (3 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
 3. \<exists>a\<in>{..<k}. as ! a * bs ! a powr y < as ! a * bs ! a powr x
[PROOF STEP]
with \<open>i < k\<close>
[PROOF STATE]
proof (chain)
picking this:
i < k
as ! i * bs ! i powr y < as ! i * bs ! i powr x
[PROOF STEP]
show "\<exists>i\<in>{..<k}. as!i * bs!i powr y < as!i * bs!i powr x"
[PROOF STATE]
proof (prove)
using this:
i < k
as ! i * bs ! i powr y < as ! i * bs ! i powr x

goal (1 subgoal):
 1. \<exists>i\<in>{..<k}. as ! i * bs ! i powr y < as ! i * bs ! i powr x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>i\<in>{..<k}. as ! i * bs ! i powr y < as ! i * bs ! i powr x

goal (2 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
[PROOF STEP]
assume "i \<in> {..<k}"
[PROOF STATE]
proof (state)
this:
i \<in> {..<k}

goal (2 subgoals):
 1. finite {..<k}
 2. \<And>xa. xa \<in> {..<k} \<Longrightarrow> as ! xa * bs ! xa powr y \<le> as ! xa * bs ! xa powr x
[PROOF STEP]
with a_ge_0 b_bounds[of "bs!i"] \<open>x < y\<close>
[PROOF STATE]
proof (chain)
picking this:
?a \<in> set as \<Longrightarrow> 0 \<le> ?a
bs ! i \<in> set bs \<Longrightarrow> bs ! i \<in> {0<..<1}
x < y
i \<in> {..<k}
[PROOF STEP]
show "as!i * bs!i powr y \<le> as!i * bs!i powr x"
[PROOF STATE]
proof (prove)
using this:
?a \<in> set as \<Longrightarrow> 0 \<le> ?a
bs ! i \<in> set bs \<Longrightarrow> bs ! i \<in> {0<..<1}
x < y
i \<in> {..<k}

goal (1 subgoal):
 1. as ! i * bs ! i powr y \<le> as ! i * bs ! i powr x
[PROOF STEP]
by (intro mult_left_mono powr_mono') simp_all
[PROOF STATE]
proof (state)
this:
as ! i * bs ! i powr y \<le> as ! i * bs ! i powr x

goal (1 subgoal):
 1. finite {..<k}
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma Log_powreal:
  assumes "0 < x"
  and "1 < b"
  and "b \<noteq> 1"
shows "Log b (x pow\<^sub>\<real> y) = y * Log b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
have "b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y
[PROOF STEP]
using assms powreal_mult [symmetric]
[PROOF STATE]
proof (prove)
using this:
0 < x
1 < b
b \<noteq> 1
?a pow\<^sub>\<real> (?x * ?y) = (?a pow\<^sub>\<real> ?x) pow\<^sub>\<real> ?y

goal (1 subgoal):
 1. b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y

goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y

goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
have "0 < x pow\<^sub>\<real> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x pow\<^sub>\<real> y
[PROOF STEP]
by (simp add: assms(1) powreal_gt_zero)
[PROOF STATE]
proof (state)
this:
0 < x pow\<^sub>\<real> y

goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y
0 < x pow\<^sub>\<real> y
[PROOF STEP]
have "b pow\<^sub>\<real> (y * Log b x) = b pow\<^sub>\<real> Log b (x pow\<^sub>\<real> y)"
[PROOF STATE]
proof (prove)
using this:
b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y
0 < x pow\<^sub>\<real> y

goal (1 subgoal):
 1. b pow\<^sub>\<real> (y * Log b x) = b pow\<^sub>\<real> Log b (x pow\<^sub>\<real> y)
[PROOF STEP]
using powreal_Log_cancel assms powreal_Log_cancel
[PROOF STATE]
proof (prove)
using this:
b pow\<^sub>\<real> (Log b x * y) = x pow\<^sub>\<real> y
0 < x pow\<^sub>\<real> y
\<lbrakk>0 < ?a; ?a \<noteq> 1; 0 < ?x\<rbrakk> \<Longrightarrow> ?a pow\<^sub>\<real> Log ?a ?x = ?x
0 < x
1 < b
b \<noteq> 1
\<lbrakk>0 < ?a; ?a \<noteq> 1; 0 < ?x\<rbrakk> \<Longrightarrow> ?a pow\<^sub>\<real> Log ?a ?x = ?x

goal (1 subgoal):
 1. b pow\<^sub>\<real> (y * Log b x) = b pow\<^sub>\<real> Log b (x pow\<^sub>\<real> y)
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
b pow\<^sub>\<real> (y * Log b x) = b pow\<^sub>\<real> Log b (x pow\<^sub>\<real> y)

goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b pow\<^sub>\<real> (y * Log b x) = b pow\<^sub>\<real> Log b (x pow\<^sub>\<real> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b pow\<^sub>\<real> (y * Log b x) = b pow\<^sub>\<real> Log b (x pow\<^sub>\<real> y)

goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
using assms(2) powreal_inject_exp1
[PROOF STATE]
proof (prove)
using this:
b pow\<^sub>\<real> (y * Log b x) = b pow\<^sub>\<real> Log b (x pow\<^sub>\<real> y)
1 < b
1 < ?a \<Longrightarrow> (?a pow\<^sub>\<real> ?r = ?a pow\<^sub>\<real> ?s) = (?s = ?r)

goal (1 subgoal):
 1. Log b (x pow\<^sub>\<real> y) = y * Log b x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Log b (x pow\<^sub>\<real> y) = y * Log b x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma twice_field_differentiable_at_cadd [simp]:
  "(\<lambda>x. x + a) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x + a) twice_field_differentiable_at x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. x + a) twice_field_differentiable_at x
[PROOF STEP]
have "\<forall>x\<in>UNIV. (\<lambda>x. x + a) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. (\<lambda>x. x + a) field_differentiable at x
[PROOF STEP]
by (simp add: field_differentiable_add)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>UNIV. (\<lambda>x. x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. x + a) twice_field_differentiable_at x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>UNIV. (\<lambda>x. x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. x + a) twice_field_differentiable_at x
[PROOF STEP]
have "deriv ((\<lambda>x. x + a)) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. x + a) field_differentiable at x
[PROOF STEP]
by (simp add: ext)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. x + a) twice_field_differentiable_at x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>UNIV. (\<lambda>x. x + a) field_differentiable at x
deriv (\<lambda>x. x + a) field_differentiable at x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. (\<lambda>x. x + a) field_differentiable at x
deriv (\<lambda>x. x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. x + a) twice_field_differentiable_at x
[PROOF STEP]
unfolding twice_field_differentiable_at_def field_differentiable_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. (\<lambda>x. x + a) field_differentiable at x
deriv (\<lambda>x. x + a) field_differentiable at x

goal (1 subgoal):
 1. \<exists>S. (\<forall>x\<in>S. (\<lambda>x. x + a) field_differentiable at x within S) \<and> x \<in> interior S \<and> deriv (\<lambda>x. x + a) field_differentiable at x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x + a) twice_field_differentiable_at x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_list_nonneg: "(\<And> x. (x :: 'a :: ordered_semiring_1) \<in> set xs \<Longrightarrow> x \<ge> 0) \<Longrightarrow> prod_list xs \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> (0::'a) \<le> x) \<Longrightarrow> (0::'a) \<le> prod_list xs
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma less_eq_funE [elim?]:
  assumes "f \<lesssim> g"
  obtains n c where "c > 0" and "\<And>m. m > n \<Longrightarrow> f m \<le> c * g m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c n. \<lbrakk>0 < c; \<And>m. n < m \<Longrightarrow> f m \<le> c * g m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<lesssim> g

goal (1 subgoal):
 1. (\<And>c n. \<lbrakk>0 < c; \<And>m. n < m \<Longrightarrow> f m \<le> c * g m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding less_eq_fun_def
[PROOF STATE]
proof (prove)
using this:
\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * g m

goal (1 subgoal):
 1. (\<And>c n. \<lbrakk>0 < c; \<And>m. n < m \<Longrightarrow> f m \<le> c * g m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma take_bit_incr_eq:
  \<open>take_bit n (k + 1) = 1 + take_bit n k\<close> if \<open>take_bit n k \<noteq> 2 ^ n - 1\<close>
  for k :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
take_bit n k \<noteq> 2 ^ n - 1
[PROOF STEP]
have \<open>2 ^ n \<noteq> k mod 2 ^ n + 1\<close>
[PROOF STATE]
proof (prove)
using this:
take_bit n k \<noteq> 2 ^ n - 1

goal (1 subgoal):
 1. 2 ^ n \<noteq> k mod 2 ^ n + 1
[PROOF STEP]
by (simp add: take_bit_eq_mod)
[PROOF STATE]
proof (state)
this:
2 ^ n \<noteq> k mod 2 ^ n + 1

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 ^ n \<noteq> k mod 2 ^ n + 1

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
have \<open>k mod 2 ^ n < 2 ^ n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k mod 2 ^ n < 2 ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k mod 2 ^ n < 2 ^ n

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 ^ n \<noteq> k mod 2 ^ n + 1
k mod 2 ^ n < 2 ^ n
[PROOF STEP]
have *: \<open>k mod 2 ^ n + 1 < 2 ^ n\<close>
[PROOF STATE]
proof (prove)
using this:
2 ^ n \<noteq> k mod 2 ^ n + 1
k mod 2 ^ n < 2 ^ n

goal (1 subgoal):
 1. k mod 2 ^ n + 1 < 2 ^ n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
k mod 2 ^ n + 1 < 2 ^ n

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
have \<open>(k + 1) mod 2 ^ n = (k mod 2 ^ n + 1) mod 2 ^ n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k + 1) mod 2 ^ n = (k mod 2 ^ n + 1) mod 2 ^ n
[PROOF STEP]
by (simp add: mod_simps)
[PROOF STATE]
proof (state)
this:
(k + 1) mod 2 ^ n = (k mod 2 ^ n + 1) mod 2 ^ n

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(k + 1) mod 2 ^ n = (k mod 2 ^ n + 1) mod 2 ^ n

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
have \<open>\<dots> = k mod 2 ^ n + 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k mod 2 ^ n + 1) mod 2 ^ n = k mod 2 ^ n + 1
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
k mod 2 ^ n + 1 < 2 ^ n

goal (1 subgoal):
 1. (k mod 2 ^ n + 1) mod 2 ^ n = k mod 2 ^ n + 1
[PROOF STEP]
by (simp add: zmod_trivial_iff)
[PROOF STATE]
proof (state)
this:
(k mod 2 ^ n + 1) mod 2 ^ n = k mod 2 ^ n + 1

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(k + 1) mod 2 ^ n = k mod 2 ^ n + 1
[PROOF STEP]
have \<open>(k + 1) mod 2 ^ n = k mod 2 ^ n + 1\<close>
[PROOF STATE]
proof (prove)
using this:
(k + 1) mod 2 ^ n = k mod 2 ^ n + 1

goal (1 subgoal):
 1. (k + 1) mod 2 ^ n = k mod 2 ^ n + 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(k + 1) mod 2 ^ n = k mod 2 ^ n + 1

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(k + 1) mod 2 ^ n = k mod 2 ^ n + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(k + 1) mod 2 ^ n = k mod 2 ^ n + 1

goal (1 subgoal):
 1. take_bit n (k + 1) = 1 + take_bit n k
[PROOF STEP]
by (simp add: take_bit_eq_mod)
[PROOF STATE]
proof (state)
this:
take_bit n (k + 1) = 1 + take_bit n k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_integral_conv_fps_zeroth_integral:
  assumes "fls_subdegree a \<ge> 0"
  shows   "fls_integral a = fps_to_fls (fps_integral0 (fls_regpart a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral a = fps_to_fls (fps_integral0 (fls_regpart a))
[PROOF STEP]
proof (rule fls_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. fls_integral a $$ x = fps_to_fls (fps_integral0 (fls_regpart a)) $$ x
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. fls_integral a $$ x = fps_to_fls (fps_integral0 (fls_regpart a)) $$ x
[PROOF STEP]
show "fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
proof (cases "n>0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
 2. \<not> 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < n

goal (2 subgoals):
 1. 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
 2. \<not> 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> fls_subdegree a
\<not> 0 < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree a
\<not> 0 < n

goal (1 subgoal):
 1. fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
hence "int ((nat n) - 1) = n - 1"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. int (nat n - 1) = n - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (nat n - 1) = n - 1

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
0 < n
int (nat n - 1) = n - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n
int (nat n - 1) = n - 1

goal (1 subgoal):
 1. fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n
[PROOF STEP]
by (simp add: fps_integral_def)
[PROOF STATE]
proof (state)
this:
fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fls_integral a $$ n = fps_to_fls (fps_integral0 (fls_regpart a)) $$ n

goal:
No subgoals!
[PROOF STEP]
qed