[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 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


[STATEMENT]
lemma Rats_abs_nat_div_natE:
  assumes "x \<in> \<rat>"
  obtains m n :: nat where "n \<noteq> 0" and "\<bar>x\<bar> = real m / real n" and "coprime m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from \<open>x \<in> \<rat>\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<rat>
[PROOF STEP]
obtain i :: int and n :: nat where "n \<noteq> 0" and "x = real_of_int i / real n"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<rat>

goal (1 subgoal):
 1. (\<And>n i. \<lbrakk>n \<noteq> 0; x = real_of_int i / real n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: Rats_eq_int_div_nat)
[PROOF STATE]
proof (state)
this:
n \<noteq> 0
x = real_of_int i / real n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
x = real_of_int i / real n
[PROOF STEP]
have "\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
x = real_of_int i / real n

goal (1 subgoal):
 1. \<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n
[PROOF STEP]
obtain m :: nat where x_rat: "\<bar>x\<bar> = real m / real n"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> = real (nat \<bar>i\<bar>) / real n

goal (1 subgoal):
 1. (\<And>m. \<bar>x\<bar> = real m / real n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real m / real n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?gcd = "gcd m n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from \<open>n \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have gcd: "?gcd \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. gcd m n \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd m n \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?k = "m div ?gcd"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?l = "n div ?gcd"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?gcd' = "gcd ?k ?l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "?gcd dvd m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m n dvd m
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
gcd m n dvd m

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd m n dvd m
[PROOF STEP]
have gcd_k: "?gcd * ?k = m"
[PROOF STATE]
proof (prove)
using this:
gcd m n dvd m

goal (1 subgoal):
 1. gcd m n * (m div gcd m n) = m
[PROOF STEP]
by (rule dvd_mult_div_cancel)
[PROOF STATE]
proof (state)
this:
gcd m n * (m div gcd m n) = m

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "?gcd dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m n dvd n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
gcd m n dvd n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd m n dvd n
[PROOF STEP]
have gcd_l: "?gcd * ?l = n"
[PROOF STATE]
proof (prove)
using this:
gcd m n dvd n

goal (1 subgoal):
 1. gcd m n * (n div gcd m n) = n
[PROOF STEP]
by (rule dvd_mult_div_cancel)
[PROOF STATE]
proof (state)
this:
gcd m n * (n div gcd m n) = n

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from \<open>n \<noteq> 0\<close> and gcd_l
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
gcd m n * (n div gcd m n) = n
[PROOF STEP]
have "?gcd * ?l \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
gcd m n * (n div gcd m n) = n

goal (1 subgoal):
 1. gcd m n * (n div gcd m n) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd m n * (n div gcd m n) \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd m n * (n div gcd m n) \<noteq> 0
[PROOF STEP]
have "?l \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
gcd m n * (n div gcd m n) \<noteq> 0

goal (1 subgoal):
 1. n div gcd m n \<noteq> 0
[PROOF STEP]
by (blast dest!: mult_not_zero)
[PROOF STATE]
proof (state)
this:
n div gcd m n \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n div gcd m n \<noteq> 0

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<bar>x\<bar> = real ?k / real ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
from gcd
[PROOF STATE]
proof (chain)
picking this:
gcd m n \<noteq> 0
[PROOF STEP]
have "real ?k / real ?l = real (?gcd * ?k) / real (?gcd * ?l)"
[PROOF STATE]
proof (prove)
using this:
gcd m n \<noteq> 0

goal (1 subgoal):
 1. real (m div gcd m n) / real (n div gcd m n) = real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n))
[PROOF STEP]
by (simp add: real_of_nat_div)
[PROOF STATE]
proof (state)
this:
real (m div gcd m n) / real (n div gcd m n) = real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n))

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (m div gcd m n) / real (n div gcd m n) = real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n))

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
from gcd_k and gcd_l
[PROOF STATE]
proof (chain)
picking this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n
[PROOF STEP]
have "\<dots> = real m / real n"
[PROOF STATE]
proof (prove)
using this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n

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

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (gcd m n * (m div gcd m n)) / real (gcd m n * (n div gcd m n)) = real m / real n

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
from x_rat
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> = real m / real n
[PROOF STEP]
have "\<dots> = \<bar>x\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> = real m / real n

goal (1 subgoal):
 1. real m / real n = \<bar>x\<bar>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
real m / real n = \<bar>x\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (m div gcd m n) / real (n div gcd m n) = \<bar>x\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (m div gcd m n) / real (n div gcd m n) = \<bar>x\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "?gcd' = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
have "?gcd * ?gcd' = gcd (?gcd * ?k) (?gcd * ?l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))
[PROOF STEP]
by (rule gcd_mult_distrib_nat)
[PROOF STATE]
proof (state)
this:
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))

goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
with gcd_k gcd_l
[PROOF STATE]
proof (chain)
picking this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))
[PROOF STEP]
have "?gcd * ?gcd' = ?gcd"
[PROOF STATE]
proof (prove)
using this:
gcd m n * (m div gcd m n) = m
gcd m n * (n div gcd m n) = n
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd (gcd m n * (m div gcd m n)) (gcd m n * (n div gcd m n))

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

goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
with gcd
[PROOF STATE]
proof (chain)
picking this:
gcd m n \<noteq> 0
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd m n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gcd m n \<noteq> 0
gcd m n * gcd (m div gcd m n) (n div gcd m n) = gcd m n

goal (1 subgoal):
 1. gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd (m div gcd m n) (n div gcd m n) = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
gcd (m div gcd m n) (n div gcd m n) = 1

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd (m div gcd m n) (n div gcd m n) = 1
[PROOF STEP]
have "coprime ?k ?l"
[PROOF STATE]
proof (prove)
using this:
gcd (m div gcd m n) (n div gcd m n) = 1

goal (1 subgoal):
 1. coprime (m div gcd m n) (n div gcd m n)
[PROOF STEP]
by (simp only: coprime_iff_gcd_eq_1)
[PROOF STATE]
proof (state)
this:
coprime (m div gcd m n) (n div gcd m n)

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>n \<noteq> 0; \<bar>x\<bar> = real m / real n; coprime m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n div gcd m n \<noteq> 0
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
coprime (m div gcd m n) (n div gcd m n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n div gcd m n \<noteq> 0
\<bar>x\<bar> = real (m div gcd m n) / real (n div gcd m n)
coprime (m div gcd m n) (n div gcd m n)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_dvd1_trivial_unit_factor:
  "(f :: 'a::comm_semiring_1 fps) dvd 1 \<Longrightarrow> unit_factor f = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f dvd 1 \<Longrightarrow> unit_factor f = f
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. 1 = f * k \<Longrightarrow> unit_factor f = f
[PROOF STEP]
by (rule fps_dvd1_left_trivial_unit_factor) simp


[STATEMENT]
lemma rationalizable_binary_on_expansion_on:
  assumes "f_range_on A f"
  assumes "rationalizable_binary_on A f"
  shows "expansion_on A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expansion_on A f
[PROOF STEP]
using  %invisible assms
[PROOF STATE]
proof (prove)
using this:
f_range_on A f
rationalizable_binary_on A f

goal (1 subgoal):
 1. expansion_on A f
[PROOF STEP]
unfolding rationalizable_binary_on_def f_range_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>B\<subseteq>A. f B \<subseteq> B
\<forall>B\<subseteq>A. f B = {y \<in> B. \<forall>x\<in>B. y \<in> f {x, y}}

goal (1 subgoal):
 1. expansion_on A f
[PROOF STEP]
by - (rule expansion_onI; auto)


[STATEMENT]
lemma rotate_pow_self: "rotate (l*\<^bold>|u\<^bold>|) (u\<^sup>@k) = u\<^sup>@k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
proof(induct l, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k \<Longrightarrow> rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
case (Suc l)
[PROOF STATE]
proof (state)
this:
rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k

goal (1 subgoal):
 1. \<And>l. rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k \<Longrightarrow> rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k

goal (1 subgoal):
 1. rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
proof(cases "k = 0", simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k; k \<noteq> 0\<rbrakk> \<Longrightarrow> rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
assume "k \<noteq> 0"
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>rotate (l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k; k \<noteq> 0\<rbrakk> \<Longrightarrow> rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
unfolding rotate_rotate[of "\<^bold>|u\<^bold>|" "l * \<^bold>|u\<^bold>|" "u\<^sup>@k", unfolded mult_Suc[symmetric] Suc.hyps, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate \<^bold>|u\<^bold>| (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
using rotate_append[of u "u\<^sup>@(k-1)", folded pop_pow_one[OF \<open>k \<noteq> 0\<close>, of u] pop_pow_one'[OF \<open>k \<noteq> 0\<close>, of u]]
[PROOF STATE]
proof (prove)
using this:
rotate \<^bold>|u\<^bold>| (u \<^sup>@ k) = u \<^sup>@ k

goal (1 subgoal):
 1. rotate \<^bold>|u\<^bold>| (u \<^sup>@ k) = u \<^sup>@ k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rotate (Suc l * \<^bold>|u\<^bold>|) (u \<^sup>@ k) = u \<^sup>@ k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma roifex_set_var_subtree:
  assumes "ro_ifex b" and "b = IF v t e"
  shows "val_ifex b (ass(v:=True)) = val_ifex t ass"
        "val_ifex b (ass(v:=False)) = val_ifex e ass"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val_ifex b (ass(v := True)) = val_ifex t ass &&& val_ifex b (ass(v := False)) = val_ifex e ass
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ro_ifex b
b = IF v t e

goal (1 subgoal):
 1. val_ifex b (ass(v := True)) = val_ifex t ass &&& val_ifex b (ass(v := False)) = val_ifex e ass
[PROOF STEP]
by (auto intro!: ifex_var_noinfluence dest: roifex_var_not_in_subtree)


[STATEMENT]
lemma is_iso_imp_same_card:
  assumes "H \<cong> G "
  shows "order H = order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order H = order G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order H = order G
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
H \<cong> G
[PROOF STEP]
obtain h where "bij_betw h (carrier H) (carrier G)"
[PROOF STATE]
proof (prove)
using this:
H \<cong> G

goal (1 subgoal):
 1. (\<And>h. bij_betw h (carrier H) (carrier G) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding is_iso_def iso_def
[PROOF STATE]
proof (prove)
using this:
{h \<in> hom H G. bij_betw h (carrier H) (carrier G)} \<noteq> {}

goal (1 subgoal):
 1. (\<And>h. bij_betw h (carrier H) (carrier G) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw h (carrier H) (carrier G)

goal (1 subgoal):
 1. order H = order G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw h (carrier H) (carrier G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw h (carrier H) (carrier G)

goal (1 subgoal):
 1. order H = order G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
bij_betw h (carrier H) (carrier G)

goal (1 subgoal):
 1. card (carrier H) = card (carrier G)
[PROOF STEP]
by (rule bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
order H = order G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isometry_on_diff [simp]:
  "isometry_on A (\<lambda>x. (t::'a::real_normed_vector) - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry_on A ((-) t)
[PROOF STEP]
unfolding isometry_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. dist (t - x) (t - y) = dist x y
[PROOF STEP]
by (auto, metis add_uminus_conv_diff dist_add_cancel dist_minus)


[STATEMENT]
lemma sum_list_ge_mono: fixes as :: "('a :: ordered_semiring_0) list"
  assumes "length as = length bs"
  and "\<And> i. i < length bs \<Longrightarrow> as ! i \<ge> bs ! i"
  shows "sum_list as \<ge> sum_list bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list bs \<le> sum_list as
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length as = length bs
?i < length bs \<Longrightarrow> bs ! ?i \<le> as ! ?i

goal (1 subgoal):
 1. sum_list bs \<le> sum_list as
[PROOF STEP]
proof (induct as arbitrary: bs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>bs. \<lbrakk>length [] = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> [] ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list []
 2. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
case (Nil bs)
[PROOF STATE]
proof (state)
this:
length [] = length bs
?i < length bs \<Longrightarrow> bs ! ?i \<le> [] ! ?i

goal (2 subgoals):
 1. \<And>bs. \<lbrakk>length [] = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> [] ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list []
 2. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
from Nil(1)
[PROOF STATE]
proof (chain)
picking this:
length [] = length bs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length [] = length bs

goal (1 subgoal):
 1. sum_list bs \<le> sum_list []
[PROOF STEP]
by (simp add: ge_refl)
[PROOF STATE]
proof (state)
this:
sum_list bs \<le> sum_list []

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
case (Cons a as bbs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length as = length ?bs; \<And>i. i < length ?bs \<Longrightarrow> ?bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list ?bs \<le> sum_list as
length (a # as) = length bbs
?i < length bbs \<Longrightarrow> bbs ! ?i \<le> (a # as) ! ?i

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
from Cons(2)
[PROOF STATE]
proof (chain)
picking this:
length (a # as) = length bbs
[PROOF STEP]
obtain b bs where bbs: "bbs = b # bs" and len: "length as = length bs"
[PROOF STATE]
proof (prove)
using this:
length (a # as) = length bbs

goal (1 subgoal):
 1. (\<And>b bs. \<lbrakk>bbs = b # bs; length as = length bs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases bbs, auto)
[PROOF STATE]
proof (state)
this:
bbs = b # bs
length as = length bs

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
note ge = Cons(3)[unfolded bbs]
[PROOF STATE]
proof (state)
this:
?i < length (b # bs) \<Longrightarrow> (b # bs) ! ?i \<le> (a # as) ! ?i

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?i < length (b # bs) \<Longrightarrow> (b # bs) ! ?i \<le> (a # as) ! ?i

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
assume "i < length bs"
[PROOF STATE]
proof (state)
this:
i < length bs

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
hence "Suc i < length (b # bs)"
[PROOF STATE]
proof (prove)
using this:
i < length bs

goal (1 subgoal):
 1. Suc i < length (b # bs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc i < length (b # bs)

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
from ge[OF this]
[PROOF STATE]
proof (chain)
picking this:
(b # bs) ! Suc i \<le> (a # as) ! Suc i
[PROOF STEP]
have "as ! i \<ge> bs ! i"
[PROOF STATE]
proof (prove)
using this:
(b # bs) ! Suc i \<le> (a # as) ! Suc i

goal (1 subgoal):
 1. bs ! i \<le> as ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bs ! i \<le> as ! i

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < length bs \<Longrightarrow> bs ! ?i2 \<le> as ! ?i2

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
from Cons(1)[OF len this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i < length bs \<Longrightarrow> i < length bs) \<Longrightarrow> sum_list bs \<le> sum_list as
[PROOF STEP]
have IH: "sum_list as \<ge> sum_list bs"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < length bs \<Longrightarrow> i < length bs) \<Longrightarrow> sum_list bs \<le> sum_list as

goal (1 subgoal):
 1. sum_list bs \<le> sum_list as
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_list bs \<le> sum_list as

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
from ge[of 0]
[PROOF STATE]
proof (chain)
picking this:
0 < length (b # bs) \<Longrightarrow> (b # bs) ! 0 \<le> (a # as) ! 0
[PROOF STEP]
have ab: "a \<ge> b"
[PROOF STATE]
proof (prove)
using this:
0 < length (b # bs) \<Longrightarrow> (b # bs) ! 0 \<le> (a # as) ! 0

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

goal (1 subgoal):
 1. \<And>a as bs. \<lbrakk>\<And>bs. \<lbrakk>length as = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> as ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list as; length (a # as) = length bs; \<And>i. i < length bs \<Longrightarrow> bs ! i \<le> (a # as) ! i\<rbrakk> \<Longrightarrow> sum_list bs \<le> sum_list (a # as)
[PROOF STEP]
from ge_trans[OF plus_left_mono[OF ab] plus_right_mono[OF IH]]
[PROOF STATE]
proof (chain)
picking this:
b + sum_list bs \<le> a + sum_list as
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
b + sum_list bs \<le> a + sum_list as

goal (1 subgoal):
 1. sum_list bbs \<le> sum_list (a # as)
[PROOF STEP]
unfolding bbs
[PROOF STATE]
proof (prove)
using this:
b + sum_list bs \<le> a + sum_list as

goal (1 subgoal):
 1. sum_list (b # bs) \<le> sum_list (a # as)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list bbs \<le> sum_list (a # as)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_less_card_finite [simp]: "0 < CARD('a::finite)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < CARD('a)
[PROOF STEP]
unfolding neq0_conv [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a) \<noteq> 0
[PROOF STEP]
by simp


[STATEMENT]
lemma to_int_mod_ring_of_int_M: "to_int_mod_ring (of_int x :: 'a mod_ring) = M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (of_int x) = M x
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (of_int x) = x mod m
[PROOF STEP]
unfolding m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (of_int x) = x mod int CARD('a)
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma sum_singleton: "(\<Sum>x\<in>{a}. f x) = f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {a} = f a
[PROOF STEP]
by simp


[STATEMENT]
lemma nlists_map [simp]: "(map f xs \<in> nlists (size xs) A) = (f ` set xs \<subseteq> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f xs \<in> nlists (length xs) A) = (f ` set xs \<subseteq> A)
[PROOF STEP]
unfolding nlists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f xs \<in> {xsa. length xsa = length xs \<and> set xsa \<subseteq> A}) = (f ` set xs \<subseteq> A)
[PROOF STEP]
by (auto)


[STATEMENT]
lemma shortest_path_split: "shortest_path x y \<le> shortest_path x z + shortest_path z y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
proof (cases "vert_connected x y \<and> vert_connected x z")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vert_connected x y \<and> vert_connected x z \<Longrightarrow> shortest_path x y \<le> shortest_path x z + shortest_path z y
 2. \<not> (vert_connected x y \<and> vert_connected x z) \<Longrightarrow> shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
vert_connected x y \<and> vert_connected x z

goal (2 subgoals):
 1. vert_connected x y \<and> vert_connected x z \<Longrightarrow> shortest_path x y \<le> shortest_path x z + shortest_path z y
 2. \<not> (vert_connected x y \<and> vert_connected x z) \<Longrightarrow> shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
assume " \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y"
[PROOF STATE]
proof (state)
this:
\<not> shortest_path x y \<le> shortest_path x z + shortest_path z y

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
have c: "shortest_path x y > shortest_path x z + shortest_path z y"
[PROOF STATE]
proof (prove)
using this:
\<not> shortest_path x y \<le> shortest_path x z + shortest_path z y

goal (1 subgoal):
 1. shortest_path x z + shortest_path z y < shortest_path x y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
shortest_path x z + shortest_path z y < shortest_path x y

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
have "vert_connected z y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vert_connected z y
[PROOF STEP]
using True vert_connected_trans vert_connected_rev
[PROOF STATE]
proof (prove)
using this:
vert_connected x y \<and> vert_connected x z
\<lbrakk>vert_connected ?u ?v; vert_connected ?v ?z\<rbrakk> \<Longrightarrow> vert_connected ?u ?z
vert_connected ?u ?v = vert_connected ?v ?u

goal (1 subgoal):
 1. vert_connected z y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vert_connected z y

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vert_connected z y
[PROOF STEP]
obtain p1 p2 where "connecting_path x z p1" and "connecting_path z y p2" and
      s1: "shortest_path x z = walk_length p1" and s2: "shortest_path z y = walk_length p2"
[PROOF STATE]
proof (prove)
using this:
vert_connected z y

goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>connecting_path x z p1; connecting_path z y p2; shortest_path x z = enat (walk_length p1); shortest_path z y = enat (walk_length p2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using True shortest_path_obtains2 connecting_paths_def elem_connecting_paths
[PROOF STATE]
proof (prove)
using this:
vert_connected z y
vert_connected x y \<and> vert_connected x z
\<lbrakk>vert_connected ?u ?v; \<And>p. \<lbrakk>p \<in> connecting_paths ?u ?v; enat (walk_length p) = shortest_path ?u ?v\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
connecting_paths ?u ?v \<equiv> {xs. connecting_path ?u ?v xs}
?p \<in> connecting_paths ?u ?v \<Longrightarrow> connecting_path ?u ?v ?p

goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>connecting_path x z p1; connecting_path z y p2; shortest_path x z = enat (walk_length p1); shortest_path z y = enat (walk_length p2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
connecting_path x z p1
connecting_path z y p2
shortest_path x z = enat (walk_length p1)
shortest_path z y = enat (walk_length p2)

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
connecting_path x z p1
connecting_path z y p2
shortest_path x z = enat (walk_length p1)
shortest_path z y = enat (walk_length p2)
[PROOF STEP]
obtain p3 where cp: "connecting_path x y p3" and "walk_length p1 + walk_length p2 \<ge> walk_length p3"
[PROOF STATE]
proof (prove)
using this:
connecting_path x z p1
connecting_path z y p2
shortest_path x z = enat (walk_length p1)
shortest_path z y = enat (walk_length p2)

goal (1 subgoal):
 1. (\<And>p3. \<lbrakk>connecting_path x y p3; walk_length p3 \<le> walk_length p1 + walk_length p2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using connecting_path_split_length
[PROOF STATE]
proof (prove)
using this:
connecting_path x z p1
connecting_path z y p2
shortest_path x z = enat (walk_length p1)
shortest_path z y = enat (walk_length p2)
\<lbrakk>connecting_path ?u ?v ?xs; connecting_path ?v ?z ?ys; \<And>p. \<lbrakk>connecting_path ?u ?z p; walk_length p \<le> walk_length ?xs + walk_length ?ys\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>p3. \<lbrakk>connecting_path x y p3; walk_length p3 \<le> walk_length p1 + walk_length p2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
connecting_path x y p3
walk_length p3 \<le> walk_length p1 + walk_length p2

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
connecting_path x y p3
walk_length p3 \<le> walk_length p1 + walk_length p2
[PROOF STEP]
have "shortest_path x z + shortest_path z y \<ge> walk_length p3"
[PROOF STATE]
proof (prove)
using this:
connecting_path x y p3
walk_length p3 \<le> walk_length p1 + walk_length p2

goal (1 subgoal):
 1. enat (walk_length p3) \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
using s1 s2
[PROOF STATE]
proof (prove)
using this:
connecting_path x y p3
walk_length p3 \<le> walk_length p1 + walk_length p2
shortest_path x z = enat (walk_length p1)
shortest_path z y = enat (walk_length p2)

goal (1 subgoal):
 1. enat (walk_length p3) \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enat (walk_length p3) \<le> shortest_path x z + shortest_path z y

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
enat (walk_length p3) \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
have lt: "shortest_path x y > walk_length p3"
[PROOF STATE]
proof (prove)
using this:
enat (walk_length p3) \<le> shortest_path x z + shortest_path z y

goal (1 subgoal):
 1. enat (walk_length p3) < shortest_path x y
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
enat (walk_length p3) \<le> shortest_path x z + shortest_path z y
shortest_path x z + shortest_path z y < shortest_path x y

goal (1 subgoal):
 1. enat (walk_length p3) < shortest_path x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
enat (walk_length p3) < shortest_path x y

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
have "p3 \<in> connecting_paths x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p3 \<in> connecting_paths x y
[PROOF STEP]
using cp connecting_paths_def
[PROOF STATE]
proof (prove)
using this:
connecting_path x y p3
connecting_paths ?u ?v \<equiv> {xs. connecting_path ?u ?v xs}

goal (1 subgoal):
 1. p3 \<in> connecting_paths x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p3 \<in> connecting_paths x y

goal (1 subgoal):
 1. \<not> shortest_path x y \<le> shortest_path x z + shortest_path z y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p3 \<in> connecting_paths x y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p3 \<in> connecting_paths x y

goal (1 subgoal):
 1. False
[PROOF STEP]
using shortest_path_def shortest_path_obtains2
[PROOF STATE]
proof (prove)
using this:
p3 \<in> connecting_paths x y
shortest_path ?u ?v \<equiv> INF p\<in>connecting_paths ?u ?v. enat (walk_length p)
\<lbrakk>vert_connected ?u ?v; \<And>p. \<lbrakk>p \<in> connecting_paths ?u ?v; enat (walk_length p) = shortest_path ?u ?v\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis True enat_ord_simps(1) enat_ord_simps(2) le_Suc_ex lt not_add_less1 shortest_path_lte)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
shortest_path x y \<le> shortest_path x z + shortest_path z y

goal (1 subgoal):
 1. \<not> (vert_connected x y \<and> vert_connected x z) \<Longrightarrow> shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (vert_connected x y \<and> vert_connected x z) \<Longrightarrow> shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (vert_connected x y \<and> vert_connected x z)

goal (1 subgoal):
 1. \<not> (vert_connected x y \<and> vert_connected x z) \<Longrightarrow> shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (vert_connected x y \<and> vert_connected x z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (vert_connected x y \<and> vert_connected x z)

goal (1 subgoal):
 1. shortest_path x y \<le> shortest_path x z + shortest_path z y
[PROOF STEP]
by (metis enat_ord_code(3) plus_enat_simps(2) plus_enat_simps(3) shortest_path_inf vert_connected_trans)
[PROOF STATE]
proof (state)
this:
shortest_path x y \<le> shortest_path x z + shortest_path z y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_root_eq_root:
  "n>0 \<Longrightarrow> y \<ge> 0 \<Longrightarrow> root n x * y = root n (x * (y ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; 0 \<le> y\<rbrakk> \<Longrightarrow> root n x * y = root n (x * y ^ n)
[PROOF STEP]
by(simp add: real_root_mult real_root_pos2)


[STATEMENT]
lemma UINF_impl: "(\<Sqinter> P\<in>A \<bullet> F(P) \<Rightarrow> G(P)) = ((\<Squnion> P\<in>A \<bullet> F(P)) \<Rightarrow> (\<Sqinter> P\<in>A \<bullet> G(P)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> P \<in> A \<bullet> F P \<Rightarrow> G P) = ((\<Squnion> P \<in> A \<bullet> F P) \<Rightarrow> (\<Sqinter> P \<in> A \<bullet> G P))
[PROOF STEP]
by (pred_auto)


[STATEMENT]
lemma valid_path_poly_rectpath: "valid_path (poly p o rectpath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (poly p \<circ> rectpath a b)
[PROOF STEP]
unfolding rectpath_def Let_def path_compose_join
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path ((poly p \<circ> linepath a (Complex (Re b) (Im a))) +++ (poly p \<circ> linepath (Complex (Re b) (Im a)) b) +++ (poly p \<circ> linepath b (Complex (Re a) (Im b))) +++ (poly p \<circ> linepath (Complex (Re a) (Im b)) a))
[PROOF STEP]
by (simp add: pathfinish_compose pathstart_compose valid_path_poly_linepath)


[STATEMENT]
lemma solution_eq_preflect_solution:
  assumes "t0 \<in> T"
  shows "(x solves_ode f) T X \<longleftrightarrow> ((\<lambda>t. x (preflect t0 t)) solves_ode (\<lambda>t x. - f (preflect t0 t) x)) (preflect t0 ` T) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x solves_ode f) T X = ((\<lambda>t. x (preflect t0 t)) solves_ode (\<lambda>t x. - f (preflect t0 t) x)) (preflect t0 ` T) X
[PROOF STEP]
using solution_preflect[OF \<open>t0 \<in> T\<close>] preflect_solution[OF \<open>t0 \<in> T\<close>]
[PROOF STATE]
proof (prove)
using this:
(?x solves_ode ?f) T ?X \<Longrightarrow> ((\<lambda>t. ?x (preflect t0 t)) solves_ode (\<lambda>t x. - ?f (preflect t0 t) x)) (preflect t0 ` T) ?X
((\<lambda>t. ?x (preflect t0 t)) solves_ode (\<lambda>t x. - ?f (preflect t0 t) x)) (preflect t0 ` T) ?X \<Longrightarrow> (?x solves_ode ?f) T ?X

goal (1 subgoal):
 1. (x solves_ode f) T X = ((\<lambda>t. x (preflect t0 t)) solves_ode (\<lambda>t x. - f (preflect t0 t) x)) (preflect t0 ` T) X
[PROOF STEP]
by blast


[STATEMENT]
lemma Infinitesimal_approx_hrabs: "x \<approx> y \<Longrightarrow> x \<in> Infinitesimal \<Longrightarrow> \<bar>x\<bar> \<approx> \<bar>y\<bar>"
  for x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<approx> y; x \<in> Infinitesimal\<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<approx> \<bar>y\<bar>
[PROOF STEP]
using approx_hnorm
[PROOF STATE]
proof (prove)
using this:
?x \<approx> ?y \<Longrightarrow> hnorm ?x \<approx> hnorm ?y

goal (1 subgoal):
 1. \<lbrakk>x \<approx> y; x \<in> Infinitesimal\<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<approx> \<bar>y\<bar>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in Corps)  Amin_le_addTr:"valuation K v \<Longrightarrow>
(\<forall>j \<le> n. f j \<in> carrier K) \<longrightarrow> Amin n (v \<circ> f) \<le> (v (nsum K f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valuation K v \<Longrightarrow> (\<forall>j\<le>n. f j \<in> carrier K) \<longrightarrow> Amin n (v \<circ> f) \<le> v (\<Sigma>\<^sub>e K f n)
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. valuation K v \<Longrightarrow> (\<forall>j\<le>0. f j \<in> carrier K) \<longrightarrow> Amin 0 (v \<circ> f) \<le> v (\<Sigma>\<^sub>e K f 0)
 2. \<And>n. \<lbrakk>valuation K v; (\<forall>j\<le>n. f j \<in> carrier K) \<longrightarrow> Amin n (v \<circ> f) \<le> v (\<Sigma>\<^sub>e K f n)\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> carrier K) \<longrightarrow> Amin (Suc n) (v \<circ> f) \<le> v (\<Sigma>\<^sub>e K f Suc n)
[PROOF STEP]
apply (rule impI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>valuation K v; (\<forall>j\<le>n. f j \<in> carrier K) \<longrightarrow> Amin n (v \<circ> f) \<le> v (\<Sigma>\<^sub>e K f n)\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> carrier K) \<longrightarrow> Amin (Suc n) (v \<circ> f) \<le> v (\<Sigma>\<^sub>e K f Suc n)
[PROOF STEP]
apply (rule impI,
       simp,
       frule_tac x = "\<Sigma>\<^sub>e K f n" and y = "f (Suc n)" in amin_le_plus[of v],
       cut_tac field_is_ring, frule Ring.ring_is_ag[of "K"],
       cut_tac n = n in aGroup.nsum_mem[of K _ f], assumption,
       rule allI, simp add:funcset_mem, assumption, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>valuation K v; Amin n (\<lambda>a. v (f a)) \<le> v (\<Sigma>\<^sub>e K f n); \<forall>j\<le>Suc n. f j \<in> carrier K; amin (v (\<Sigma>\<^sub>e K f n)) (v (f (Suc n))) \<le> v (\<Sigma>\<^sub>e K f n \<plusminus> f (Suc n))\<rbrakk> \<Longrightarrow> amin (Amin n (\<lambda>a. v (f a))) (v (f (Suc n))) \<le> v (\<Sigma>\<^sub>e K f n \<plusminus> f (Suc n))
[PROOF STEP]
apply (frule_tac z = "Amin n (\<lambda>u. v (f u))" and z' = "v (\<Sigma>\<^sub>e K f n)" and
        w = "v (f (Suc n))" in amin_aminTr,
        rule_tac i = "amin (Amin n (\<lambda>u. v (f u))) (v (f (Suc n)))" and
        j = "amin (v (\<Sigma>\<^sub>e K f n)) (v (f (Suc n)))" and
        k = "v (\<Sigma>\<^sub>e K f n \<plusminus> (f (Suc n)))" in ale_trans, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma insert_order: "\<lbrakk>k > 0; sorted_less (leaves t); root_order k t\<rbrakk> \<Longrightarrow> root_order k (insert k x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; sorted_less (leaves t); root_order k t\<rbrakk> \<Longrightarrow> root_order k (local.insert k x t)
[PROOF STEP]
using ins_root_order
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?k; sorted_less (leaves ?t); root_order ?k ?t\<rbrakk> \<Longrightarrow> root_order_up\<^sub>i ?k (ins ?k ?x ?t)

goal (1 subgoal):
 1. \<lbrakk>0 < k; sorted_less (leaves t); root_order k t\<rbrakk> \<Longrightarrow> root_order k (local.insert k x t)
[PROOF STEP]
by (simp add: tree\<^sub>i_order)