[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]
theorem wls_freshAbs_substAbs_ident[simp]:
assumes "wls (asSort xs) X" and "wlsAbs (us,s) A" and "freshAbs xs x A"
shows "(A $[X / x]_xs) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[X / x]_xs = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls (asSort xs) X
wlsAbs (us, s) A
freshAbs xs x A

goal (1 subgoal):
 1. A $[X / x]_xs = A
[PROOF STEP]
by simp


[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 word_sless_eq:
  \<open>x <s y \<longleftrightarrow> x <=s y \<and> x \<noteq> y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x <s y) = (x \<le>s y \<and> x \<noteq> y)
[PROOF STEP]
by (fact signed.less_le)


[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 size_fset_from_list[simp]: "distinct l \<Longrightarrow> size (fset_from_list l) = length l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct l \<Longrightarrow> size (fset_from_list l) = length l
[PROOF STEP]
by (induction l) auto


[STATEMENT]
lemma power2_eq_square: "x \<in> carrier R \<Longrightarrow> x [^] (2::nat) = x \<otimes> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier R \<Longrightarrow> x [^] 2 = x \<otimes> x
[PROOF STEP]
by (simp add: numeral_eq_Suc)


[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 f_aggregate_drop_mult: "
  f_aggregate (xs \<up> (n * k)) k ag = f_aggregate xs k ag \<up> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f_aggregate (xs \<up> (n * k)) k ag = f_aggregate xs k ag \<up> n
[PROOF STEP]
by (simp add: list_eq_iff div_diff_mult_self1 f_aggregate_nth add_mult_distrib add.commute[of "n * k"])


[STATEMENT]
theorem F'map_id: "F'map id id id = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F'map id id id = id
[PROOF STEP]
by (rule F.map_id0)


[STATEMENT]
lemma mset_msort_bu: "mset (msort_bu xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (msort_bu xs) = mset xs
[PROOF STEP]
by(simp add: msort_bu_def mset_merge_all multiset.map_comp comp_def)


[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 Acc_SourcesNOT: "(X \<notin> Acc i C) = (C \<notin> Sources i X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<notin> Acc i C) = (C \<notin> Sources i X)
[PROOF STEP]
by (metis Acc_Sources)

\<comment> \<open>component S is not a source for any component on the abstraction level i\<close>


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


[STATEMENT]
lemma (in disc_equity_market) remaining_qty_adapted:
  assumes "borel_adapt_stoch_proc F (prices Mkt asset)"
  and "trading_strategy pf"
and "support_adapt Mkt pf"
shows "borel_adapt_stoch_proc F (remaining_qty Mkt v pf asset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel_adapt_stoch_proc F (remaining_qty Mkt v pf asset)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
borel_adapt_stoch_proc F (prices Mkt asset)
trading_strategy pf
support_adapt Mkt pf

goal (1 subgoal):
 1. borel_adapt_stoch_proc F (remaining_qty Mkt v pf asset)
[PROOF STEP]
unfolding adapt_stoch_proc_def
[PROOF STATE]
proof (prove)
using this:
\<forall>t. prices Mkt asset t \<in> borel_measurable (F t)
trading_strategy pf
support_adapt Mkt pf

goal (1 subgoal):
 1. \<forall>t. remaining_qty Mkt v pf asset t \<in> borel_measurable (F t)
[PROOF STEP]
using assms remaining_qty_adapt
[PROOF STATE]
proof (prove)
using this:
\<forall>t. prices Mkt asset t \<in> borel_measurable (F t)
trading_strategy pf
support_adapt Mkt pf
borel_adapt_stoch_proc F (prices Mkt asset)
trading_strategy pf
support_adapt Mkt pf
\<lbrakk>borel_adapt_stoch_proc F (prices Mkt ?asset); trading_strategy ?pf; support_adapt Mkt ?pf\<rbrakk> \<Longrightarrow> remaining_qty Mkt ?v ?pf ?asset ?n \<in> borel_measurable (F ?n)

goal (1 subgoal):
 1. \<forall>t. remaining_qty Mkt v pf asset t \<in> borel_measurable (F t)
[PROOF STEP]
by blast


[STATEMENT]
lemma sim_trc_commute:
  assumes M: "kripke M"
      and s: "sim M M' f"
      and t: "t \<in> worlds M"
  shows "f ` ((\<Union>a. relations M a)\<^sup>* `` {t})
       = (\<Union>a. relations M' a)\<^sup>* `` {f t}" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (\<Union> (range (relations M)))\<^sup>* `` {t} = (\<Union> (range (relations M')))\<^sup>* `` {f t}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` (\<Union> (range (relations M)))\<^sup>* `` {t} \<subseteq> (\<Union> (range (relations M')))\<^sup>* `` {f t}
 2. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
from M s
[PROOF STATE]
proof (chain)
picking this:
kripke M
sim M M' f
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
using this:
kripke M
sim M M' f

goal (1 subgoal):
 1. f ` (\<Union> (range (relations M)))\<^sup>* `` {t} \<subseteq> (\<Union> (range (relations M')))\<^sup>* `` {f t}
[PROOF STEP]
by (auto intro: sim_f_trc)
[PROOF STATE]
proof (state)
this:
f ` (\<Union> (range (relations M)))\<^sup>* `` {t} \<subseteq> (\<Union> (range (relations M')))\<^sup>* `` {f t}

goal (1 subgoal):
 1. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
from M s t
[PROOF STATE]
proof (chain)
picking this:
kripke M
sim M M' f
t \<in> worlds M
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
using this:
kripke M
sim M M' f
t \<in> worlds M

goal (1 subgoal):
 1. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
by (auto elim: sim_r_trc)
[PROOF STATE]
proof (state)
this:
(\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zlcms_pos: "\<forall>i \<in> set is. i\<noteq>0 \<Longrightarrow> zlcms is > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>set is. i \<noteq> 0 \<Longrightarrow> 0 < zlcms is
[PROOF STEP]
by(induct "is")(auto simp:lcm_pos_int)


[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]
theorem secure_implies_c_secure:
  assumes S: "secure (c_process step out s\<^sub>0) I (c_dom D)"
  shows "c_secure step out s\<^sub>0 I D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_secure step out s\<^sub>0 I D
[PROOF STEP]
proof (simp add: c_secure_def, (rule allI)+)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
fix x xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
have "out (foldl step (foldl step s\<^sub>0 []) xs) x =
    out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
secure (c_process step out s\<^sub>0) I (c_dom D)

goal (1 subgoal):
 1. out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x
[PROOF STEP]
by (rule secure_implies_c_secure_aux)
[PROOF STATE]
proof (state)
this:
out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x

goal (1 subgoal):
 1. \<And>x xs. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
thus "out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x"
[PROOF STATE]
proof (prove)
using this:
out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x

goal (1 subgoal):
 1. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_zero [simp]: "dim {0} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim {0::'b} = 0
[PROOF STEP]
using dim_span_eq_card_independent independent_empty
[PROOF STATE]
proof (prove)
using this:
local.independent ?B \<Longrightarrow> local.dim (local.span ?B) = card ?B
local.independent {}

goal (1 subgoal):
 1. local.dim {0::'b} = 0
[PROOF STEP]
by fastforce


[STATEMENT]
lemma topological_space_quotient: "class.topological_space (openin (map_topology f euclidean))"
  if "surj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.topological_space (openin (map_topology f euclidean))
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. openin (map_topology f euclidean) UNIV
 2. \<And>S T. \<lbrakk>openin (map_topology f euclidean) S; openin (map_topology f euclidean) T\<rbrakk> \<Longrightarrow> openin (map_topology f euclidean) (S \<inter> T)
 3. \<And>K. \<forall>S\<in>K. openin (map_topology f euclidean) S \<Longrightarrow> openin (map_topology f euclidean) (\<Union> K)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (map_topology f euclidean) UNIV
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
surj f

goal (1 subgoal):
 1. openin (map_topology f euclidean) UNIV
[PROOF STEP]
by (auto simp: openin_map_topology)


[STATEMENT]
lemma length_butlast [simp]: "length (butlast xs) = length xs - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (butlast xs) = length xs - 1
[PROOF STEP]
by (induct xs rule: rev_induct) auto


[STATEMENT]
lemma ile0_eq: "n \<le> (0::enat) \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n \<le> 0) = (n = 0)
[PROOF STEP]
by (rule le_zero_eq)


[STATEMENT]
lemma fls_residue_shift_nth:
  fixes f :: "'a::semiring_1 fls"
  shows "f$$n = fls_residue (fls_X_intpow (-n-1) * f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f $$ n = fls_residue (fls_X_intpow (- n - 1) * f)
[PROOF STEP]
by    (simp add: fls_shifted_times_transfer)


[STATEMENT]
lemma mult_2: assumes "invariant_2 x" "invariant_2 y"
  shows "real_of_2 (mult_2 x y) = real_of_2 x * real_of_2 y"
  "invariant_2 (mult_2 x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_2 (mult_2 x y) = real_of_2 x * real_of_2 y &&& invariant_2 (mult_2 x y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invariant_2 x
invariant_2 y

goal (1 subgoal):
 1. real_of_2 (mult_2 x y) = real_of_2 x * real_of_2 y &&& invariant_2 (mult_2 x y)
[PROOF STEP]
by (atomize(full), (cases x; cases y; auto simp: mult_rat_1 mult_1 hom_distribs))


[STATEMENT]
lemma create_opt_sol_sat_eq_mat:
  assumes "dim_vec c = dim_row A\<^sup>T"
    and "dim_vec b = dim_col A\<^sup>T"
  assumes "create_optimal_solutions A b c = Sat X"
    and "(x, y) = split_i_j_x (dim_vec c) (dim_vec c + dim_vec b) X"
  shows "[y \<^sub>v* A]=c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
have *: "\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)
[PROOF STEP]
using create_opt_sol_satisfies[of A b c X] sat_mono[of "(mat_leqb_eqc A b c)" _ X]
      assms(2) assms
[PROOF STATE]
proof (prove)
using this:
create_optimal_solutions A b c = Inr X \<Longrightarrow> \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (x_times_c_geq_y_times_b c b # mat_leqb_eqc A b c @ from_index_geq0_vector (dim_vec c) (0\<^sub>v (dim_vec b)))
\<lbrakk>set (mat_leqb_eqc A b c) \<subseteq> set ?B; \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set ?B\<rbrakk> \<Longrightarrow> \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)
dim_vec b = dim_col A\<^sup>T
dim_vec c = dim_row A\<^sup>T
dim_vec b = dim_col A\<^sup>T
create_optimal_solutions A b c = Inr X
(x, y) = split_n_m_x (dim_vec c) (dim_vec b) X

goal (1 subgoal):
 1. \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)
[PROOF STEP]
by (metis UnCI list.set_intros(2) set_append)
[PROOF STATE]
proof (state)
this:
\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
have "dim_row A\<^sup>T = dim_vec c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A\<^sup>T = dim_vec c
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
dim_vec c = dim_row A\<^sup>T

goal (1 subgoal):
 1. dim_row A\<^sup>T = dim_vec c
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
dim_row A\<^sup>T = dim_vec c

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_row A\<^sup>T = dim_vec c

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
have "dim_col A\<^sup>T = dim_vec b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col A\<^sup>T = dim_vec b
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
dim_col A\<^sup>T = dim_vec b

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_row A\<^sup>T = dim_vec c
dim_col A\<^sup>T = dim_vec b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim_row A\<^sup>T = dim_vec c
dim_col A\<^sup>T = dim_vec b

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dim_row A\<^sup>T = dim_vec c
dim_col A\<^sup>T = dim_vec b
dim_vec c = dim_row A\<^sup>T
dim_vec b = dim_col A\<^sup>T
create_optimal_solutions A b c = Inr X
(x, y) = split_n_m_x (dim_vec c) (dim_vec b) X

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
by (metis mat_leqb_eqc_split_correct2[of c A b X x y, OF assms(1) assms(2) *]
        \<open>dim_vec b = dim_col A\<^sup>T\<close> \<open>dim_vec c = dim_row A\<^sup>T\<close>)
[PROOF STATE]
proof (state)
this:
[y\<^sub>v*A]=c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma a_m_0[simp]:"(-\<infinity>) * 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> * 0 = 0
[PROOF STEP]
by (simp add:mult_ant_def inf_ant_def Zero_ant_def, simp add:ant_def,
    cut_tac ant_inf_in_Ainteg, cut_tac ant_0_in_Ainteg,
       simp add:Abs_Ainteg_inverse, simp add:zag_t_def)


[STATEMENT]
lemma iMODb_0_iMOD_subset_conv: "
  ([r', mod m', 0] \<subseteq> [r, mod m]) =
  (r' mod m = r mod m \<and> r \<le> r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r', mod m', 0 ] \<subseteq> [ r, mod m ]) = (r' mod m = r mod m \<and> r \<le> r')
[PROOF STEP]
by (simp add: iMODb_0 iIN_0 singleton_subset_conv iMOD_iff)


[STATEMENT]
lemma birkhoff_sum_1 [simp]:
  "birkhoff_sum f 0 x = 0"
  "birkhoff_sum f 1 x = f x"
  "birkhoff_sum f (Suc 0) x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f 0 x = (0::'b) &&& birkhoff_sum f 1 x = f x &&& birkhoff_sum f (Suc 0) x = f x
[PROOF STEP]
unfolding birkhoff_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<0. f ((T ^^ i) x)) = (0::'b) &&& (\<Sum>i<1. f ((T ^^ i) x)) = f x &&& (\<Sum>i<Suc 0. f ((T ^^ i) x)) = f x
[PROOF STEP]
by auto


[STATEMENT]
lemma exp_eq_0_iff[simp]: "eexp x = 0 \<longleftrightarrow> x = -\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eexp x = 0) = (x = - \<infinity>)
[PROOF STEP]
using eexp_inj[of x "-\<infinity>"]
[PROOF STATE]
proof (prove)
using this:
(eexp x = eexp (- \<infinity>)) = (x = - \<infinity>)

goal (1 subgoal):
 1. (eexp x = 0) = (x = - \<infinity>)
[PROOF STEP]
unfolding eexp_minus_infty
[PROOF STATE]
proof (prove)
using this:
(eexp x = 0) = (x = - \<infinity>)

goal (1 subgoal):
 1. (eexp x = 0) = (x = - \<infinity>)
[PROOF STEP]
.