[STATEMENT]
lemma Cauchy_real_Suc_diff:
  fixes X :: "nat \<Rightarrow> real" and x :: real
  assumes bounded: "\<And>n. \<bar>f (Suc n) - f n\<bar> \<le> (c / x ^ n)"
  and x: "1 < x"
  shows "Cauchy f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy f
[PROOF STEP]
proof(cases "c > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < c \<Longrightarrow> Cauchy f
 2. \<not> 0 < c \<Longrightarrow> Cauchy f
[PROOF STEP]
case c: True
[PROOF STATE]
proof (state)
this:
0 < c

goal (2 subgoals):
 1. 0 < c \<Longrightarrow> Cauchy f
 2. \<not> 0 < c \<Longrightarrow> Cauchy f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy f
[PROOF STEP]
proof(rule metric_CauchyI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
fix \<epsilon> :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
assume "0 < \<epsilon>"
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
from bounded[of 0] x
[PROOF STATE]
proof (chain)
picking this:
\<bar>f (Suc 0) - f 0\<bar> \<le> c / x ^ 0
1 < x
[PROOF STEP]
have c_nonneg: "0 \<le> c"
[PROOF STATE]
proof (prove)
using this:
\<bar>f (Suc 0) - f 0\<bar> \<le> c / x ^ 0
1 < x

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

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
1 < x
[PROOF STEP]
have "0 < ln x"
[PROOF STATE]
proof (prove)
using this:
1 < x

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

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
from reals_Archimedean3[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. \<exists>n. y < real n * ln x
[PROOF STEP]
obtain M :: nat
      where "ln (c * x) - ln (\<epsilon> * (x - 1)) < real M * ln x"
[PROOF STATE]
proof (prove)
using this:
\<forall>y. \<exists>n. y < real n * ln x

goal (1 subgoal):
 1. (\<And>M. ln (c * x) - ln (\<epsilon> * (x - 1)) < real M * ln x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ln (c * x) - ln (\<epsilon> * (x - 1)) < real M * ln x

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
hence "exp (ln (c * x) - ln (\<epsilon> * (x - 1))) < exp (real M * ln x)"
[PROOF STATE]
proof (prove)
using this:
ln (c * x) - ln (\<epsilon> * (x - 1)) < real M * ln x

goal (1 subgoal):
 1. exp (ln (c * x) - ln (\<epsilon> * (x - 1))) < exp (real M * ln x)
[PROOF STEP]
by(rule exp_less_mono)
[PROOF STATE]
proof (state)
this:
exp (ln (c * x) - ln (\<epsilon> * (x - 1))) < exp (real M * ln x)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
hence M: "c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>"
[PROOF STATE]
proof (prove)
using this:
exp (ln (c * x) - ln (\<epsilon> * (x - 1))) < exp (real M * ln x)

goal (1 subgoal):
 1. c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>
[PROOF STEP]
using \<open>0 < \<epsilon>\<close> x c
[PROOF STATE]
proof (prove)
using this:
exp (ln (c * x) - ln (\<epsilon> * (x - 1))) < exp (real M * ln x)
0 < \<epsilon>
1 < x
0 < c

goal (1 subgoal):
 1. c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>
[PROOF STEP]
by (simp add: exp_diff exp_of_nat_mult field_simps del: ln_mult)
[PROOF STATE]
proof (state)
this:
c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
fix n m :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
assume "n \<ge> M" "m \<ge> M"
[PROOF STATE]
proof (state)
this:
M \<le> n
M \<le> m

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M \<le> n
M \<le> m
[PROOF STEP]
have "\<bar>f m - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x)"
[PROOF STATE]
proof (prove)
using this:
M \<le> n
M \<le> m

goal (1 subgoal):
 1. \<bar>f m - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x)
[PROOF STEP]
proof(induction n m rule: linorder_wlog)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<le> b; M \<le> a; M \<le> b\<rbrakk> \<Longrightarrow> \<bar>f b - f a\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b a) / (1 - 1 / x)
 2. \<And>a b. \<lbrakk>\<lbrakk>M \<le> b; M \<le> a\<rbrakk> \<Longrightarrow> \<bar>f a - f b\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max a b) / (1 - 1 / x); M \<le> a; M \<le> b\<rbrakk> \<Longrightarrow> \<bar>f b - f a\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b a) / (1 - 1 / x)
[PROOF STEP]
case sym
[PROOF STATE]
proof (state)
this:
\<lbrakk>M \<le> b_; M \<le> a_\<rbrakk> \<Longrightarrow> \<bar>f a_ - f b_\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max a_ b_) / (1 - 1 / x)
M \<le> a_
M \<le> b_

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<le> b; M \<le> a; M \<le> b\<rbrakk> \<Longrightarrow> \<bar>f b - f a\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b a) / (1 - 1 / x)
 2. \<And>a b. \<lbrakk>\<lbrakk>M \<le> b; M \<le> a\<rbrakk> \<Longrightarrow> \<bar>f a - f b\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max a b) / (1 - 1 / x); M \<le> a; M \<le> b\<rbrakk> \<Longrightarrow> \<bar>f b - f a\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b a) / (1 - 1 / x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>M \<le> b_; M \<le> a_\<rbrakk> \<Longrightarrow> \<bar>f a_ - f b_\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max a_ b_) / (1 - 1 / x)
M \<le> a_
M \<le> b_

goal (1 subgoal):
 1. \<bar>f b_ - f a_\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b_ a_) / (1 - 1 / x)
[PROOF STEP]
by(simp add: abs_minus_commute max.commute min.commute)
[PROOF STATE]
proof (state)
this:
\<bar>f b_ - f a_\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b_ a_) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; M \<le> a; M \<le> b\<rbrakk> \<Longrightarrow> \<bar>f b - f a\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b a) / (1 - 1 / x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; M \<le> a; M \<le> b\<rbrakk> \<Longrightarrow> \<bar>f b - f a\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b a) / (1 - 1 / x)
[PROOF STEP]
case (le m n)
[PROOF STATE]
proof (state)
this:
m \<le> n
M \<le> m
M \<le> n

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; M \<le> a; M \<le> b\<rbrakk> \<Longrightarrow> \<bar>f b - f a\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max b a) / (1 - 1 / x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<le> n
M \<le> m
M \<le> n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m \<le> n
M \<le> m
M \<le> n

goal (1 subgoal):
 1. \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
proof(induction k\<equiv>"n - m" arbitrary: n m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n m. \<lbrakk>0 = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
 2. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 = n - m
m \<le> n
M \<le> m
M \<le> n

goal (2 subgoals):
 1. \<And>n m. \<lbrakk>0 = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
 2. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 = n - m
m \<le> n
M \<le> m
M \<le> n

goal (1 subgoal):
 1. \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
using x c_nonneg
[PROOF STATE]
proof (prove)
using this:
0 = n - m
m \<le> n
M \<le> m
M \<le> n
1 < x
0 \<le> c

goal (1 subgoal):
 1. \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
by(simp add: field_simps mult_left_mono)
[PROOF STATE]
proof (state)
this:
\<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
case (Suc k m n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>k = ?n - ?m; ?m \<le> ?n; M \<le> ?m; M \<le> ?n\<rbrakk> \<Longrightarrow> \<bar>f ?n - f ?m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max ?n ?m) / (1 - 1 / x)
Suc k = m - n
n \<le> m
M \<le> n
M \<le> m

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
from \<open>Suc k = _\<close>
[PROOF STATE]
proof (chain)
picking this:
Suc k = m - n
[PROOF STEP]
obtain m' where m: "m = Suc m'"
[PROOF STATE]
proof (prove)
using this:
Suc k = m - n

goal (1 subgoal):
 1. (\<And>m'. m = Suc m' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases m) simp_all
[PROOF STATE]
proof (state)
this:
m = Suc m'

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
with \<open>Suc k = _\<close> Suc.prems
[PROOF STATE]
proof (chain)
picking this:
Suc k = m - n
n \<le> m
M \<le> n
M \<le> m
m = Suc m'
[PROOF STEP]
have "k = m' - n" "n \<le> m'" "M \<le> n" "M \<le> m'"
[PROOF STATE]
proof (prove)
using this:
Suc k = m - n
n \<le> m
M \<le> n
M \<le> m
m = Suc m'

goal (1 subgoal):
 1. (k = m' - n &&& n \<le> m') &&& M \<le> n &&& M \<le> m'
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
k = m' - n
n \<le> m'
M \<le> n
M \<le> m'

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
hence "\<bar>f m' - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ (max m' n)) / (1 - 1 / x)"
[PROOF STATE]
proof (prove)
using this:
k = m' - n
n \<le> m'
M \<le> n
M \<le> m'

goal (1 subgoal):
 1. \<bar>f m' - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x)
[PROOF STEP]
by(rule Suc)
[PROOF STATE]
proof (state)
this:
\<bar>f m' - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>f m' - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
have "\<dots> = c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x) = c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x)
[PROOF STEP]
using \<open>n \<le> m'\<close>
[PROOF STATE]
proof (prove)
using this:
n \<le> m'

goal (1 subgoal):
 1. c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x) = c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x)
[PROOF STEP]
by(simp add: max_def)
[PROOF STATE]
proof (state)
this:
c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x) = c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x) = c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
from bounded
[PROOF STATE]
proof (chain)
picking this:
\<bar>f (Suc ?n) - f ?n\<bar> \<le> c / x ^ ?n
[PROOF STEP]
have "\<bar>f m - f m'\<bar> \<le> (c / x ^ m')"
[PROOF STATE]
proof (prove)
using this:
\<bar>f (Suc ?n) - f ?n\<bar> \<le> c / x ^ ?n

goal (1 subgoal):
 1. \<bar>f m - f m'\<bar> \<le> c / x ^ m'
[PROOF STEP]
by(simp add: m)
[PROOF STATE]
proof (state)
this:
\<bar>f m - f m'\<bar> \<le> c / x ^ m'

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<bar>f m' - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x)
c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x) = c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x)
\<bar>f m - f m'\<bar> \<le> c / x ^ m'
[PROOF STEP]
have "\<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + \<dots>"
[PROOF STATE]
proof (prove)
using this:
\<bar>f m' - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x)
c * ((1 / x) ^ M - (1 / x) ^ max m' n) / (1 - 1 / x) = c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x)
\<bar>f m - f m'\<bar> \<le> c / x ^ m'

goal (1 subgoal):
 1. \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + c / x ^ m'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + c / x ^ m'

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + c / x ^ m'

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
have "\<dots> \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + c / x ^ m' \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)
[PROOF STEP]
using m x
[PROOF STATE]
proof (prove)
using this:
m = Suc m'
1 < x

goal (1 subgoal):
 1. c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + c / x ^ m' \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)
[PROOF STEP]
by(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + c / x ^ m' \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c * ((1 / x) ^ M - (1 / x) ^ m') / (1 - 1 / x) + c / x ^ m' \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
have "\<bar>f m - f n\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>f m - f n\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>
[PROOF STEP]
using abs_triangle_ineq4[of "f m' - f n" "f m - f m'"]
[PROOF STATE]
proof (prove)
using this:
\<bar>f m' - f n - (f m - f m')\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>

goal (1 subgoal):
 1. \<bar>f m - f n\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>f m - f n\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>

goal (1 subgoal):
 1. \<And>k n m. \<lbrakk>\<And>n m. \<lbrakk>k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x); Suc k = n - m; m \<le> n; M \<le> m; M \<le> n\<rbrakk> \<Longrightarrow> \<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)
\<bar>f m - f n\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)
\<bar>f m - f n\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>

goal (1 subgoal):
 1. \<bar>f m - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x)
[PROOF STEP]
using \<open>n \<le> m\<close>
[PROOF STATE]
proof (prove)
using this:
\<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ m) / (1 - 1 / x)
\<bar>f m - f n\<bar> \<le> \<bar>f m' - f n\<bar> + \<bar>f m - f m'\<bar>
n \<le> m

goal (1 subgoal):
 1. \<bar>f m - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x)
[PROOF STEP]
by(simp add: max_def)
[PROOF STATE]
proof (state)
this:
\<bar>f m - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>f n - f m\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max n m) / (1 - 1 / x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>f m - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>f m - f n\<bar> \<le> c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
have "\<dots> < c * (1 / x) ^ M / (1 - 1 / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x) < c * (1 / x) ^ M / (1 - 1 / x)
[PROOF STEP]
using x c
[PROOF STATE]
proof (prove)
using this:
1 < x
0 < c

goal (1 subgoal):
 1. c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x) < c * (1 / x) ^ M / (1 - 1 / x)
[PROOF STEP]
by(auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x) < c * (1 / x) ^ M / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c * ((1 / x) ^ M - (1 / x) ^ max m n) / (1 - 1 / x) < c * (1 / x) ^ M / (1 - 1 / x)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
have "\<dots> < \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>

goal (1 subgoal):
 1. c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
c * (1 / x) ^ M / (1 - 1 / x) < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>f m - f n\<bar> < \<epsilon>
[PROOF STEP]
have "\<bar>f m - f n\<bar> < \<epsilon>"
[PROOF STATE]
proof (prove)
using this:
\<bar>f m - f n\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<bar>f m - f n\<bar> < \<epsilon>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>f m - f n\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>M \<le> ?n2; M \<le> ?m2\<rbrakk> \<Longrightarrow> \<bar>f ?m2 - f ?n2\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < e
[PROOF STEP]
thus "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < \<epsilon>"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>M \<le> ?n2; M \<le> ?m2\<rbrakk> \<Longrightarrow> \<bar>f ?m2 - f ?n2\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < \<epsilon>
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>M \<le> ?n2; M \<le> ?m2\<rbrakk> \<Longrightarrow> \<bar>f ?m2 - f ?n2\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. \<bar>f m - f n\<bar> < \<epsilon>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m) (f n) < \<epsilon>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Cauchy f

goal (1 subgoal):
 1. \<not> 0 < c \<Longrightarrow> Cauchy f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < c \<Longrightarrow> Cauchy f
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < c

goal (1 subgoal):
 1. \<not> 0 < c \<Longrightarrow> Cauchy f
[PROOF STEP]
with bounded[of 0]
[PROOF STATE]
proof (chain)
picking this:
\<bar>f (Suc 0) - f 0\<bar> \<le> c / x ^ 0
\<not> 0 < c
[PROOF STEP]
have [simp]: "c = 0"
[PROOF STATE]
proof (prove)
using this:
\<bar>f (Suc 0) - f 0\<bar> \<le> c / x ^ 0
\<not> 0 < c

goal (1 subgoal):
 1. c = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c = 0

goal (1 subgoal):
 1. \<not> 0 < c \<Longrightarrow> Cauchy f
[PROOF STEP]
have eq: "f m = f 0" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f m = f 0
[PROOF STEP]
proof(induction m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f 0 = f 0
 2. \<And>m. f m = f 0 \<Longrightarrow> f (Suc m) = f 0
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
f m = f 0

goal (2 subgoals):
 1. f 0 = f 0
 2. \<And>m. f m = f 0 \<Longrightarrow> f (Suc m) = f 0
[PROOF STEP]
from bounded[of m] Suc.IH
[PROOF STATE]
proof (chain)
picking this:
\<bar>f (Suc m) - f m\<bar> \<le> c / x ^ m
f m = f 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>f (Suc m) - f m\<bar> \<le> c / x ^ m
f m = f 0

goal (1 subgoal):
 1. f (Suc m) = f 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (Suc m) = f 0

goal (1 subgoal):
 1. f 0 = f 0
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
f ?m = f 0

goal (1 subgoal):
 1. \<not> 0 < c \<Longrightarrow> Cauchy f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cauchy f
[PROOF STEP]
by(rule metric_CauchyI)(subst (1 2) eq; simp)
[PROOF STATE]
proof (state)
this:
Cauchy f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_nonneg_divide [eventually_nonzero_simps]:
  assumes "eventually_nonneg F f" "eventually_nonneg F g"
  shows   "eventually_nonneg F (\<lambda>x. f x / g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x / g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
eventually_nonneg F f
eventually_nonneg F g

goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x / g x)
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. (0::'b) \<le> f x
\<forall>\<^sub>F x in F. (0::'b) \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (0::'b) \<le> f x / g x
[PROOF STEP]
by eventually_elim simp


[STATEMENT]
lemma set_zip:
  "set (zip xs ys) = {(xs!i, ys!i) | i. i < min (length xs) (length ys)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (zip xs ys) = {(xs ! i, ys ! i) |i. i < min (length xs) (length ys)}
[PROOF STEP]
by(simp add: set_conv_nth cong: rev_conj_cong)


[STATEMENT]
lemma suminf_pos_iff: "summable f \<Longrightarrow> (\<And>n. 0 \<le> f n) \<Longrightarrow> 0 < suminf f \<longleftrightarrow> (\<exists>i. 0 < f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>n. (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> ((0::'a) < suminf f) = (\<exists>i. (0::'a) < f i)
[PROOF STEP]
using sum_le_suminf[of "{}"] suminf_eq_zero_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>summable f; finite {}; \<And>n. n \<in> - {} \<Longrightarrow> (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> sum f {} \<le> suminf f
\<lbrakk>summable f; \<And>n. (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> (suminf f = (0::'a)) = (\<forall>n. f n = (0::'a))

goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>n. (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> ((0::'a) < suminf f) = (\<exists>i. (0::'a) < f i)
[PROOF STEP]
by (simp add: less_le)


[STATEMENT]
lemma resCap_alt: "resCap p = Min (cf`set p)"
  \<comment> \<open>Useful characterization for finiteness arguments\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resCap p = Min (cf ` set p)
[PROOF STEP]
unfolding resCap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {cf e |e. e \<in> set p} = Min (cf ` set p)
[PROOF STEP]
apply (rule arg_cong[where f=Min])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {cf e |e. e \<in> set p} = cf ` set p
[PROOF STEP]
by auto


[STATEMENT]
lemma d_delta_lnexp_cf4_nonpos: "diff_delta_lnexp_cf4 x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff_delta_lnexp_cf4 x \<le> 0
[PROOF STEP]
unfolding diff_delta_lnexp_cf4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x ^ 8) / (numer_cf4 (- x) * numer_cf4 x) \<le> 0
[PROOF STEP]
using numer_cf4_pos [of x] numer_cf4_pos [of "-x"]
[PROOF STATE]
proof (prove)
using this:
0 < numer_cf4 x
0 < numer_cf4 (- x)

goal (1 subgoal):
 1. - (x ^ 8) / (numer_cf4 (- x) * numer_cf4 x) \<le> 0
[PROOF STEP]
by (simp add: zero_le_divide_iff zero_le_mult_iff)


[STATEMENT]
lemma powr_left_real_eq_iff:
  assumes "a \<ge> (0 :: real)" "b \<ge> 0" "x \<noteq> 0"
  shows   "a powr x = b powr x \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a powr x = b powr x) = (a = b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> a
0 \<le> b
x \<noteq> 0

goal (1 subgoal):
 1. (a powr x = b powr x) = (a = b)
[PROOF STEP]
by (auto simp: powr_def)


[STATEMENT]
lemma order_reflect_poly_ge:
  fixes c :: "'a :: field"
  assumes "c \<noteq> 0" and "p \<noteq> 0"
  shows   "order c (reflect_poly p) \<ge> order (1 / c) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
have "reflect_poly ([:-(1 / c), 1:] ^ order (1 / c) p) dvd reflect_poly p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflect_poly ([:- ((1::'a) / c), 1::'a:] ^ order ((1::'a) / c) p) dvd reflect_poly p
[PROOF STEP]
by (intro reflect_poly_dvdI, subst order_divides) auto
[PROOF STATE]
proof (state)
this:
reflect_poly ([:- ((1::'a) / c), 1::'a:] ^ order ((1::'a) / c) p) dvd reflect_poly p

goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
reflect_poly ([:- ((1::'a) / c), 1::'a:] ^ order ((1::'a) / c) p) dvd reflect_poly p

goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
have "reflect_poly ([:-(1 / c), 1:] ^ order (1 / c) p) =
               smult ((-1 / c) ^ order (1 / c) p) ([:-c, 1:] ^ order (1 / c) p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflect_poly ([:- ((1::'a) / c), 1::'a:] ^ order ((1::'a) / c) p) = smult ((- (1::'a) / c) ^ order ((1::'a) / c) p) ([:- c, 1::'a:] ^ order ((1::'a) / c) p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
p \<noteq> 0

goal (1 subgoal):
 1. reflect_poly ([:- ((1::'a) / c), 1::'a:] ^ order ((1::'a) / c) p) = smult ((- (1::'a) / c) ^ order ((1::'a) / c) p) ([:- c, 1::'a:] ^ order ((1::'a) / c) p)
[PROOF STEP]
by (simp add: reflect_poly_power reflect_poly_pCons smult_power)
[PROOF STATE]
proof (state)
this:
reflect_poly ([:- ((1::'a) / c), 1::'a:] ^ order ((1::'a) / c) p) = smult ((- (1::'a) / c) ^ order ((1::'a) / c) p) ([:- c, 1::'a:] ^ order ((1::'a) / c) p)

goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
smult ((- (1::'a) / c) ^ order ((1::'a) / c) p) ([:- c, 1::'a:] ^ order ((1::'a) / c) p) dvd reflect_poly p
[PROOF STEP]
have "([:-c, 1:] ^ order (1 / c) p) dvd reflect_poly p"
[PROOF STATE]
proof (prove)
using this:
smult ((- (1::'a) / c) ^ order ((1::'a) / c) p) ([:- c, 1::'a:] ^ order ((1::'a) / c) p) dvd reflect_poly p

goal (1 subgoal):
 1. [:- c, 1::'a:] ^ order ((1::'a) / c) p dvd reflect_poly p
[PROOF STEP]
by (rule smult_dvd_cancel)
[PROOF STATE]
proof (state)
this:
[:- c, 1::'a:] ^ order ((1::'a) / c) p dvd reflect_poly p

goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
with \<open>p \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[:- c, 1::'a:] ^ order ((1::'a) / c) p dvd reflect_poly p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
[:- c, 1::'a:] ^ order ((1::'a) / c) p dvd reflect_poly p

goal (1 subgoal):
 1. order ((1::'a) / c) p \<le> order c (reflect_poly p)
[PROOF STEP]
by (subst (asm) order_divides) auto
[PROOF STATE]
proof (state)
this:
order ((1::'a) / c) p \<le> order c (reflect_poly p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_baliR[simp]: "size (rbt_baliR t1 a b t2) = Suc (size t1 + size t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (rbt_baliR t1 a b t2) = Suc (size t1 + size t2)
[PROOF STEP]
by (induction t1 a b t2 rule: rbt_baliR.induct) auto


[STATEMENT]
lemma path_component_of_sym:
  assumes "path_component_of X x y"
  shows "path_component_of X y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_of X y x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path_component_of X x y

goal (1 subgoal):
 1. path_component_of X y x
[PROOF STEP]
apply (clarsimp simp: path_component_of_def pathin_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<lbrakk>continuous_map (top_of_set {0..1}) X g; x = g 0; y = g 1\<rbrakk> \<Longrightarrow> \<exists>ga. continuous_map (top_of_set {0..1}) X ga \<and> ga 0 = g 1 \<and> ga 1 = g 0
[PROOF STEP]
apply (rule_tac x="g \<circ> (\<lambda>t. 1 - t)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<lbrakk>continuous_map (top_of_set {0..1}) X g; x = g 0; y = g 1\<rbrakk> \<Longrightarrow> continuous_map (top_of_set {0..1}) X (g \<circ> (-) 1) \<and> (g \<circ> (-) 1) 0 = g 1 \<and> (g \<circ> (-) 1) 1 = g 0
[PROOF STEP]
apply (auto intro!: continuous_map_compose simp: continuous_map_in_subtopology continuous_on_op_minus)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Lim_bounded2:
  fixes f :: "nat \<Rightarrow> 'a::linorder_topology"
  assumes lim:"f \<longlonglongrightarrow> l" and ge: "\<forall>n\<ge>N. f n \<ge> C"
  shows "l \<ge> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<le> l
[PROOF STEP]
using ge
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>N. C \<le> f n

goal (1 subgoal):
 1. C \<le> l
[PROOF STEP]
by (intro tendsto_le[OF trivial_limit_sequentially lim tendsto_const])
     (auto simp: eventually_sequentially)


[STATEMENT]
lemma normalize_sort_eq_imp_sort_eqv: "sort_ex cs s1 \<Longrightarrow> sort_ex cs s2 \<Longrightarrow> finite s1 \<Longrightarrow> finite s2
  \<Longrightarrow> normalize_sort cs s1 = normalize_sort cs s2
  \<Longrightarrow> sort_eqv cs s1 s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sort_ex cs s1; sort_ex cs s2; finite s1; finite s2; normalize_sort cs s1 = normalize_sort cs s2\<rbrakk> \<Longrightarrow> sort_eqv cs s1 s2
[PROOF STEP]
by (metis sort_eqv_sym sort_eqv_trans wf_subclass_loc.sort_eqv_normalize_sort wf_subclass_loc_axioms)


[STATEMENT]
lemma isCont_o2: "isCont f a \<Longrightarrow> isCont g (f a) \<Longrightarrow> isCont (\<lambda>x. g (f x)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isCont f a; isCont g (f a)\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. g (f x)) a
[PROOF STEP]
unfolding isCont_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>a\<rightarrow> f a; g \<midarrow>f a\<rightarrow> g (f a)\<rbrakk> \<Longrightarrow> (\<lambda>x. g (f x)) \<midarrow>a\<rightarrow> g (f a)
[PROOF STEP]
by (rule tendsto_compose)


[STATEMENT]
lemma bound_at_worst_lemma:
  fixes a::"('e, 'f)float"
  assumes threshold: "\<bar>x\<bar> < threshold TYPE(('e, 'f)float)"
  assumes finite: "is_finite a"
  shows "\<bar>valof (round To_nearest x::('e, 'f)float) - x\<bar> \<le> \<bar>valof a - x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>valof (IEEE.round To_nearest x) - x\<bar> \<le> \<bar>valof a - x\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>valof (IEEE.round To_nearest x) - x\<bar> \<le> \<bar>valof a - x\<bar>
[PROOF STEP]
have *: "(round To_nearest x::('e,'f)float) =
      closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x
[PROOF STEP]
using threshold finite
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < threshold TYPE(('e, 'f) IEEE.float)
is_finite a

goal (1 subgoal):
 1. IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
IEEE.round To_nearest x = closest valof (\<lambda>a. even (fraction a)) {a. is_finite a} x

goal (1 subgoal):
 1. \<bar>valof (IEEE.round To_nearest x) - x\<bar> \<le> \<bar>valof a - x\<bar>
[PROOF STEP]
have "is_closest (valof) {a. is_finite a} x (round To_nearest x::('e,'f)float)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_closest valof {a. is_finite a} x (IEEE.round To_nearest x)
[PROOF STEP]
using is_finite_nonempty
[PROOF STATE]
proof (prove)
using this:
{a. is_finite a} \<noteq> {}

goal (1 subgoal):
 1. is_closest valof {a. is_finite a} x (IEEE.round To_nearest x)
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
{a. is_finite a} \<noteq> {}

goal (1 subgoal):
 1. is_closest valof {a. is_finite a} x (closest valof (\<lambda>a. even (fraction a)) (Collect is_finite) x)
[PROOF STEP]
by (intro closest_is_closest) auto
[PROOF STATE]
proof (state)
this:
is_closest valof {a. is_finite a} x (IEEE.round To_nearest x)

goal (1 subgoal):
 1. \<bar>valof (IEEE.round To_nearest x) - x\<bar> \<le> \<bar>valof a - x\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_closest valof {a. is_finite a} x (IEEE.round To_nearest x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_closest valof {a. is_finite a} x (IEEE.round To_nearest x)

goal (1 subgoal):
 1. \<bar>valof (IEEE.round To_nearest x) - x\<bar> \<le> \<bar>valof a - x\<bar>
[PROOF STEP]
using finite is_closest_def
[PROOF STATE]
proof (prove)
using this:
is_closest valof {a. is_finite a} x (IEEE.round To_nearest x)
is_finite a
is_closest ?v ?s ?x ?a = (?a \<in> ?s \<and> (\<forall>b. b \<in> ?s \<longrightarrow> \<bar>?v ?a - ?x\<bar> \<le> \<bar>?v b - ?x\<bar>))

goal (1 subgoal):
 1. \<bar>valof (IEEE.round To_nearest x) - x\<bar> \<le> \<bar>valof a - x\<bar>
[PROOF STEP]
by (metis mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
\<bar>valof (IEEE.round To_nearest x) - x\<bar> \<le> \<bar>valof a - x\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_of_enat_0[simp]: "ennreal_of_enat 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal_of_enat 0 = 0
[PROOF STEP]
using ennreal_of_enat_enat[of 0]
[PROOF STATE]
proof (prove)
using this:
ennreal_of_enat (enat 0) = of_nat 0

goal (1 subgoal):
 1. ennreal_of_enat 0 = 0
[PROOF STEP]
unfolding enat_0
[PROOF STATE]
proof (prove)
using this:
ennreal_of_enat 0 = of_nat 0

goal (1 subgoal):
 1. ennreal_of_enat 0 = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma tseq2_test:
  "p = --p \<Longrightarrow> q = --q \<Longrightarrow> r = --r \<Longrightarrow> s = --s \<Longrightarrow> tseq2 p q x r s m = --tseq2 p q x r s m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p = - - p; q = - - q; r = - - r; s = - - s\<rbrakk> \<Longrightarrow> tseq2 p q x r s m = - - tseq2 p q x r s m
[PROOF STEP]
apply (induct m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>p = - - p; q = - - q; r = - - r; s = - - s\<rbrakk> \<Longrightarrow> tseq2 p q x r s 0 = - - tseq2 p q x r s 0
 2. \<And>m. \<lbrakk>\<lbrakk>p = - - p; q = - - q; r = - - r; s = - - s\<rbrakk> \<Longrightarrow> tseq2 p q x r s m = - - tseq2 p q x r s m; p = - - p; q = - - q; r = - - r; s = - - s\<rbrakk> \<Longrightarrow> tseq2 p q x r s (Suc m) = - - tseq2 p q x r s (Suc m)
[PROOF STEP]
apply (smt tseq2_def power_zero_id id_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<lbrakk>p = - - p; q = - - q; r = - - r; s = - - s\<rbrakk> \<Longrightarrow> tseq2 p q x r s m = - - tseq2 p q x r s m; p = - - p; q = - - q; r = - - r; s = - - s\<rbrakk> \<Longrightarrow> tseq2 p q x r s (Suc m) = - - tseq2 p q x r s (Suc m)
[PROOF STEP]
by (smt tseq2_def tfun2_test power_succ_unfold_ext)


[STATEMENT]
lemma (in monoid) m_concat_cons[simp]:
  "\<lbrakk> x \<in> carrier G ; set xs \<subseteq> carrier G \<rbrakk> \<Longrightarrow> m_concat (x#xs) = x \<otimes> m_concat xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; set xs \<subseteq> carrier G\<rbrakk> \<Longrightarrow> m_concat (x # xs) = x \<otimes> m_concat xs
[PROOF STEP]
by(induct xs)(auto simp add: m_assoc)


[STATEMENT]
lemma of_nat_in_complex_cone [simp, intro]: "a \<le> 0 \<Longrightarrow> 0 \<le> b \<Longrightarrow> of_nat n \<in> complex_cone a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> 0; 0 \<le> b\<rbrakk> \<Longrightarrow> of_nat n \<in> complex_cone a b
[PROOF STEP]
using nonneg_of_real_in_complex_cone[of "real n"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> real n; ?a \<le> 0; 0 \<le> ?b\<rbrakk> \<Longrightarrow> complex_of_real (real n) \<in> complex_cone ?a ?b

goal (1 subgoal):
 1. \<lbrakk>a \<le> 0; 0 \<le> b\<rbrakk> \<Longrightarrow> of_nat n \<in> complex_cone a b
[PROOF STEP]
by (simp del: nonneg_of_real_in_complex_cone)


[STATEMENT]
lemma valid_decompD:
  assumes "valid_decomp X ps" and "(h, U) \<in> set ps"
  shows "h \<in> P[X]" and "h \<noteq> 0" and "U \<subseteq> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> P[X] &&& h \<noteq> 0 &&& U \<subseteq> X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_decomp X ps
(h, U) \<in> set ps

goal (1 subgoal):
 1. h \<in> P[X] &&& h \<noteq> 0 &&& U \<subseteq> X
[PROOF STEP]
unfolding valid_decomp_def
[PROOF STATE]
proof (prove)
using this:
\<forall>(h, U)\<in>set ps. h \<in> P[X] \<and> h \<noteq> 0 \<and> U \<subseteq> X
(h, U) \<in> set ps

goal (1 subgoal):
 1. h \<in> P[X] &&& h \<noteq> 0 &&& U \<subseteq> X
[PROOF STEP]
by blast+


[STATEMENT]
theorem p13: "p \<or> (q \<and> r) \<longleftrightarrow> (p \<or> q) \<and> (p \<or> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<or> q \<and> r) = ((p \<or> q) \<and> (p \<or> r))
[PROOF STEP]
by auto2


[STATEMENT]
lemma "(\<forall>x. P(x) \<longrightarrow> (\<forall>x. Q(x))) \<and>
       (\<not>\<not>(\<forall>x. Q(x)\<or>R(x)) \<longrightarrow> (\<exists>x. Q(x)&S(x))) \<and>
       (\<not>\<not>(\<exists>x. S(x)) \<longrightarrow> (\<forall>x. L(x) \<longrightarrow> M(x)))
   \<longrightarrow> (\<forall>x. P(x) \<and> L(x) \<longrightarrow> M(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x \<longrightarrow> (\<forall>x. Q x)) \<and> (\<not> \<not> (\<forall>x. Q x \<or> R x) \<longrightarrow> (\<exists>x. Q x \<and> S x)) \<and> (\<not> (\<nexists>x. S x) \<longrightarrow> (\<forall>x. L x \<longrightarrow> M x)) \<longrightarrow> (\<forall>x. P x \<and> L x \<longrightarrow> M x)
[PROOF STEP]
by iprover


[STATEMENT]
lemma inner_mult_right: "inner a (of_real m * b) = m * (inner a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner a (of_real m * b) = m * inner a b
[PROOF STEP]
by (metis real_inner_class.inner_scaleR_right scaleR_conv_of_real)


[STATEMENT]
lemma ordinal_times_mono:
"\<lbrakk>x \<le> x'; y \<le> y'\<rbrakk> \<Longrightarrow> x * y \<le> x' * (y'::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> x'; y \<le> y'\<rbrakk> \<Longrightarrow> x * y \<le> x' * y'
[PROOF STEP]
by (rule order_trans[OF ordinal_times_monoL ordinal_times_monoR])


[STATEMENT]
lemma homeomorphism_sym: "homeomorphism S t f g = homeomorphism t S g f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism S t f g = homeomorphism t S g f
[PROOF STEP]
by (force simp: homeomorphism_def)


[STATEMENT]
lemma size_Union_distinct_cart_prod_filter: "distinct_mset M \<Longrightarrow>
    (\<And> p . p \<in># M \<Longrightarrow> size ({# b \<in># B . P p b #}) = c) \<Longrightarrow>
    size (\<Sum>p\<in>#M. ({#p#} \<times># {# b \<in># B . P p b #})) = size (M) * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct_mset M; \<And>p. p \<in># M \<Longrightarrow> size (filter_mset (P p) B) = c\<rbrakk> \<Longrightarrow> size (\<Sum>p\<in>#M. {#p#} \<times># filter_mset (P p) B) = size M * c
[PROOF STEP]
by (induction M) auto


[STATEMENT]
lemma open_neighbourhood_base_of:
  "(\<forall>S. P S \<longrightarrow> openin X S)
        \<Longrightarrow> neighbourhood_base_of P X \<longleftrightarrow> (\<forall>W x. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. P U \<and> x \<in> U \<and> U \<subseteq> W))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S. P S \<longrightarrow> openin X S \<Longrightarrow> neighbourhood_base_of P X = (\<forall>W x. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. P U \<and> x \<in> U \<and> U \<subseteq> W))
[PROOF STEP]
apply (simp add: neighbourhood_base_of, safe, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>W x. \<lbrakk>\<forall>S. P S \<longrightarrow> openin X S; \<forall>W x. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. P U \<and> x \<in> U \<and> U \<subseteq> W); openin X W; x \<in> W\<rbrakk> \<Longrightarrow> \<exists>U. openin X U \<and> (\<exists>V. P V \<and> x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> W)
[PROOF STEP]
by meson


[STATEMENT]
lemma round_num_denom: "round_num_denom num denom =
  round (of_int num / rat_of_int denom)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
proof (cases "denom = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. denom = 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
 2. denom \<noteq> 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
denom \<noteq> 0

goal (2 subgoals):
 1. denom = 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
 2. denom \<noteq> 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
have "denom \<noteq> 0 \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. denom \<noteq> 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
unfolding round_def round_num_denom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. denom \<noteq> 0 \<Longrightarrow> (2 * num + denom) div (2 * denom) = \<lfloor>rat_of_int num / rat_of_int denom + 1 / 2\<rfloor>
[PROOF STEP]
unfolding floor_divide_of_int_eq[where ?'a = rat, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. denom \<noteq> 0 \<Longrightarrow> \<lfloor>rat_of_int (2 * num + denom) / rat_of_int (2 * denom)\<rfloor> = \<lfloor>rat_of_int num / rat_of_int denom + 1 / 2\<rfloor>
[PROOF STEP]
by (rule arg_cong[of _ _ floor], simp add: add_divide_distrib)
[PROOF STATE]
proof (state)
this:
denom \<noteq> 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)

goal (2 subgoals):
 1. denom = 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
 2. denom \<noteq> 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
denom \<noteq> 0
denom \<noteq> 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
denom \<noteq> 0
denom \<noteq> 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)

goal (1 subgoal):
 1. round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
round_num_denom num denom = round (rat_of_int num / rat_of_int denom)

goal (1 subgoal):
 1. denom = 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. denom = 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
denom = 0

goal (1 subgoal):
 1. denom = 0 \<Longrightarrow> round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round_num_denom num denom = round (rat_of_int num / rat_of_int denom)
[PROOF STEP]
unfolding True round_num_denom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * num + 0) div (2 * 0) = round (rat_of_int num / rat_of_int 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
round_num_denom num denom = round (rat_of_int num / rat_of_int denom)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma obtain_smallest: "P (n::nat) \<Longrightarrow> \<exists>k\<le>n. P k \<and> (\<forall>a<k.\<not>(P a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n \<Longrightarrow> \<exists>k\<le>n. P k \<and> (\<forall>a<k. \<not> P a)
[PROOF STEP]
by (metis ex_least_nat_le not_less_zero zero_le)


[STATEMENT]
lemma cos_float_interval:
  "cos ` set_of (real_interval x) \<subseteq> set_of (real_interval (cos_float_interval p x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos ` set_of (real_interval x) \<subseteq> set_of (real_interval (cos_float_interval p x))
[PROOF STEP]
by (auto simp: set_of_eq bnds_cos_lower bnds_cos_upper lower_cos_float_interval
      upper_cos_float_interval)


[STATEMENT]
lemma poincare_distance_formula_zero_sum:
  assumes "u \<in> unit_disc" and "v \<in> unit_disc"
  shows "poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v =
         (let u' = cmod (to_complex u); v' = cmod (to_complex v)
           in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
obtain u' v' where uv: "u' = to_complex u" "v' = to_complex v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u' v'. \<lbrakk>u' = to_complex u; v' = to_complex v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u' = to_complex u
v' = to_complex v

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
have uv': "u = of_complex u'" "v = of_complex v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = of_complex u' &&& v = of_complex v'
[PROOF STEP]
using uv assms inf_or_of_complex[of u] inf_or_of_complex[of v]
[PROOF STATE]
proof (prove)
using this:
u' = to_complex u
v' = to_complex v
u \<in> unit_disc
v \<in> unit_disc
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)

goal (1 subgoal):
 1. u = of_complex u' &&& v = of_complex v'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = of_complex u'
v = of_complex v'

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
let ?u' = "cmod u'" and ?v' = "cmod v'"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
have disc: "?u'\<^sup>2 < 1" "?v'\<^sup>2 < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod u')\<^sup>2 < 1 &&& (cmod v')\<^sup>2 < 1
[PROOF STEP]
using unit_disc_cmod_square_lt_1[OF \<open>u \<in> unit_disc\<close>]
[PROOF STATE]
proof (prove)
using this:
(cmod (to_complex u))\<^sup>2 < 1

goal (1 subgoal):
 1. (cmod u')\<^sup>2 < 1 &&& (cmod v')\<^sup>2 < 1
[PROOF STEP]
using unit_disc_cmod_square_lt_1[OF \<open>v \<in> unit_disc\<close>] uv
[PROOF STATE]
proof (prove)
using this:
(cmod (to_complex u))\<^sup>2 < 1
(cmod (to_complex v))\<^sup>2 < 1
u' = to_complex u
v' = to_complex v

goal (1 subgoal):
 1. (cmod u')\<^sup>2 < 1 &&& (cmod v')\<^sup>2 < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
thm arcosh_add
[PROOF STATE]
proof (state)
this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
have "arcosh (1 + 2 * ?u'\<^sup>2 / (1 - ?u'\<^sup>2)) + arcosh (1 + 2 * ?v'\<^sup>2 / (1 - ?v'\<^sup>2)) =
        arcosh (((1 + ?u'\<^sup>2) * (1 + ?v'\<^sup>2) + 4 * ?u' * ?v') / ((1 - ?u'\<^sup>2) * (1 - ?v'\<^sup>2)))" (is "arcosh ?ll + arcosh ?rr = arcosh ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcosh (1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) + arcosh (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
proof (subst arcosh_add)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 1 \<le> 1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)
 2. 1 \<le> 1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)
 3. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
show "?ll \<ge> 1"  "?rr \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) &&& 1 \<le> 1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. 1 \<le> 1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) &&& 1 \<le> 1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> 1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)
1 \<le> 1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
show "arcosh ((1 + 2 * ?u'\<^sup>2 / (1 - ?u'\<^sup>2)) * (1 + 2 * ?v'\<^sup>2 / (1 - ?v'\<^sup>2)) +
                  sqrt (((1 + 2 * ?u'\<^sup>2 / (1 - ?u'\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * ?v'\<^sup>2 / (1 - ?v'\<^sup>2))\<^sup>2 - 1))) =
          arcosh ?r" (is "arcosh ?l = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
have "1 + 2 * ?u'\<^sup>2 / (1 - ?u'\<^sup>2) = (1 + ?u'\<^sup>2) / (1 - ?u'\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) = (1 + (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2)
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. 1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) = (1 + (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2)
[PROOF STEP]
by (subst add_divide_eq_iff, simp_all)
[PROOF STATE]
proof (state)
this:
1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) = (1 + (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2)

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) = (1 + (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2)

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
have "1 + 2 * ?v'\<^sup>2 / (1 - ?v'\<^sup>2) = (1 + ?v'\<^sup>2) / (1 - ?v'\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2) = (1 + (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2)
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. 1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2) = (1 + (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2)
[PROOF STEP]
by (subst add_divide_eq_iff, simp_all)
[PROOF STATE]
proof (state)
this:
1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2) = (1 + (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2)

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2) = (1 + (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2)

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
have "sqrt (((1 + 2 * ?u'\<^sup>2 / (1 - ?u'\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * ?v'\<^sup>2 / (1 - ?v'\<^sup>2))\<^sup>2 - 1)) =
               (4  * ?u' * ?v') / ((1 - ?u'\<^sup>2) * (1 - ?v'\<^sup>2))" (is "sqrt ?s = ?t")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
have "?s = ?t\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1) = (4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))\<^sup>2
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1) = (4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))\<^sup>2
[PROOF STEP]
apply (subst add_divide_eq_iff, simp)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(cmod u')\<^sup>2 < 1; (cmod v')\<^sup>2 < 1; (cmod u')\<^sup>2 < 1; (cmod v')\<^sup>2 < 1\<rbrakk> \<Longrightarrow> (((1 * (1 - (cmod u')\<^sup>2) + 2 * (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * (((1 * (1 - (cmod v')\<^sup>2) + 2 * (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1) = (4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))\<^sup>2
[PROOF STEP]
apply (subst power_divide)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(cmod u')\<^sup>2 < 1; (cmod v')\<^sup>2 < 1; (cmod u')\<^sup>2 < 1; (cmod v')\<^sup>2 < 1\<rbrakk> \<Longrightarrow> ((1 * (1 - (cmod u')\<^sup>2) + 2 * (cmod u')\<^sup>2)\<^sup>2 / (1 - (cmod u')\<^sup>2)\<^sup>2 - 1) * ((1 * (1 - (cmod v')\<^sup>2) + 2 * (cmod v')\<^sup>2)\<^sup>2 / (1 - (cmod v')\<^sup>2)\<^sup>2 - 1) = (4 * cmod u' * cmod v')\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))\<^sup>2
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(cmod u')\<^sup>2 < 1; (cmod v')\<^sup>2 < 1\<rbrakk> \<Longrightarrow> (((cmod u')\<^sup>2 + 1)\<^sup>2 / (1 - (cmod u')\<^sup>2)\<^sup>2 - 1) * (((cmod v')\<^sup>2 + 1)\<^sup>2 / (1 - (cmod v')\<^sup>2)\<^sup>2 - 1) = (4 * cmod u' * cmod v')\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))\<^sup>2
[PROOF STEP]
apply (subst divide_diff_eq_iff, simp)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(cmod u')\<^sup>2 < 1; (cmod v')\<^sup>2 < 1\<rbrakk> \<Longrightarrow> (((cmod u')\<^sup>2 + 1)\<^sup>2 - 1 * (1 - (cmod u')\<^sup>2)\<^sup>2) / (1 - (cmod u')\<^sup>2)\<^sup>2 * ((((cmod v')\<^sup>2 + 1)\<^sup>2 - 1 * (1 - (cmod v')\<^sup>2)\<^sup>2) / (1 - (cmod v')\<^sup>2)\<^sup>2) = (4 * cmod u' * cmod v')\<^sup>2 / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))\<^sup>2
[PROOF STEP]
apply (simp add: power2_eq_square field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1) = (4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))\<^sup>2

goal (1 subgoal):
 1. sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1) = (4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))\<^sup>2

goal (1 subgoal):
 1. sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1) = (4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))\<^sup>2
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) = (1 + (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2)
1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2) = (1 + (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2)
sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
have "?l = ?r"
[PROOF STATE]
proof (prove)
using this:
1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) = (1 + (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2)
1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2) = (1 + (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2)
sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. (1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
using disc
[PROOF STATE]
proof (prove)
using this:
1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2) = (1 + (cmod u')\<^sup>2) / (1 - (cmod u')\<^sup>2)
1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2) = (1 + (cmod v')\<^sup>2) / (1 - (cmod v')\<^sup>2)
sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = 4 * cmod u' * cmod v' / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
(cmod u')\<^sup>2 < 1
(cmod v')\<^sup>2 < 1

goal (1 subgoal):
 1. (1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))
[PROOF STEP]
by simp (subst add_divide_distrib, simp)
[PROOF STATE]
proof (state)
this:
(1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1)) = ((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2))

goal (1 subgoal):
 1. arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
arcosh ((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) * (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) + sqrt (((1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2))\<^sup>2 - 1) * ((1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2))\<^sup>2 - 1))) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
arcosh (1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) + arcosh (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
arcosh (1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) + arcosh (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
using uv' assms
[PROOF STATE]
proof (prove)
using this:
arcosh (1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) + arcosh (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
u = of_complex u'
v = of_complex v'
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
using poincare_distance_formula
[PROOF STATE]
proof (prove)
using this:
arcosh (1 + 2 * (cmod u')\<^sup>2 / (1 - (cmod u')\<^sup>2)) + arcosh (1 + 2 * (cmod v')\<^sup>2 / (1 - (cmod v')\<^sup>2)) = arcosh (((1 + (cmod u')\<^sup>2) * (1 + (cmod v')\<^sup>2) + 4 * cmod u' * cmod v') / ((1 - (cmod u')\<^sup>2) * (1 - (cmod v')\<^sup>2)))
u = of_complex u'
v = of_complex v'
u \<in> unit_disc
v \<in> unit_disc
\<lbrakk>?u \<in> unit_disc; ?v \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_distance ?u ?v = poincare_distance_formula (to_complex ?u) (to_complex ?v)

goal (1 subgoal):
 1. poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
poincare_distance u 0\<^sub>h + poincare_distance 0\<^sub>h v = (let u' = cmod (to_complex u); v' = cmod (to_complex v) in arcosh (((1 + u'\<^sup>2) * (1 + v'\<^sup>2) + 4 * u' * v') / ((1 - u'\<^sup>2) * (1 - v'\<^sup>2))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma none_in_empty_fset:
  shows "(\<forall>x. x |\<notin>| S) \<longleftrightarrow> S = {||}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x |\<notin>| S) = (S = {||})
[PROOF STEP]
by descending simp


[STATEMENT]
lemma spy_method_via_h_framework_lists_completeness :
  fixes M1 :: "('a::linorder,'b::linorder,'c::linorder) fsm"
  fixes M2 :: "('d,'b,'c) fsm"
  assumes "observable M1"
  and     "observable M2"
  and     "minimal M1"
  and     "minimal M2"
  and     "size_r M1 \<le> m"
  and     "size M2 \<le> m"
  and     "inputs M2 = inputs M1"
  and     "outputs M2 = outputs M1"
shows "(L M1 = L M2) \<longleftrightarrow> list_all (passes_test_case M2 (initial M2)) (spy_method_via_h_framework_lists M1 m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (spy_method_via_h_framework_lists M1 m)
[PROOF STEP]
using h_framework_static_with_simple_graph_lists_completeness[OF assms, where dist_fun="(\<lambda> k q . get_HSI M1 q)", OF _ get_HSI_finite]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_simple_graph_lists M1 (\<lambda>k. get_HSI M1) m)

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (spy_method_via_h_framework_lists M1 m)
[PROOF STEP]
using get_HSI_distinguishes[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_simple_graph_lists M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (spy_method_via_h_framework_lists M1 m)
[PROOF STEP]
unfolding spy_method_via_h_framework_lists_def h_framework_static_with_simple_graph_lists_def spy_method_via_h_framework_def
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)))
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_simple_graph M1 (\<lambda>k. get_HSI M1) m)))
[PROOF STEP]
by blast


[STATEMENT]
lemma Re_linepath: "Re(linepath (of_real a) (of_real b) x) = (1 - x)*a + x*b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (linepath (complex_of_real a) (complex_of_real b) x) = (1 - x) * a + x * b
[PROOF STEP]
by (simp add: linepath_def)


[STATEMENT]
lemma permute_comp[simp]: "permute x \<circ> permute y = permute (x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute x \<circ> permute y = permute (x + y)
[PROOF STEP]
by auto


[STATEMENT]
theorem is_unifiers_comp:
  "is_unifiers \<sigma> (set_mset ` set (map2 add_mset As Bs) \<cdot>ass \<eta>) \<longleftrightarrow>
   is_unifiers (\<eta> \<odot> \<sigma>) (set_mset ` set (map2 add_mset As Bs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unifiers \<sigma> (set_mset ` set (Map2.map2 add_mset As Bs) \<cdot>ass \<eta>) = is_unifiers (\<eta> \<odot> \<sigma>) (set_mset ` set (Map2.map2 add_mset As Bs))
[PROOF STEP]
unfolding is_unifiers_def is_unifier_def subst_atmss_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>AA\<in>(\<lambda>AA. AA \<cdot>as \<eta>) ` set_mset ` set (Map2.map2 add_mset As Bs). card (AA \<cdot>as \<sigma>) \<le> 1) = (\<forall>AA\<in>set_mset ` set (Map2.map2 add_mset As Bs). card (AA \<cdot>as (\<eta> \<odot> \<sigma>)) \<le> 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma assoc'_in_hom [intro]:
    assumes "ide a" and "ide b" and "ide c"
    shows "\<guillemotleft>\<a>\<^sup>-\<^sup>1[a, b, c] : a \<otimes> (b \<otimes> c) \<rightarrow> (a \<otimes> b) \<otimes> c\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<a>\<^sup>-\<^sup>1[a, b, c] : a \<otimes> b \<otimes> c \<rightarrow> (a \<otimes> b) \<otimes> c\<guillemotright>
[PROOF STEP]
using assms assoc'_def
[PROOF STATE]
proof (prove)
using this:
ide a
ide b
ide c
\<a>\<^sup>-\<^sup>1[?a, ?b, ?c] \<equiv> \<langle>\<langle>\<pp>\<^sub>1[?a, ?b \<otimes> ?c], \<pp>\<^sub>1[?b, ?c] \<cdot> \<pp>\<^sub>0[?a, ?b \<otimes> ?c]\<rangle>, \<pp>\<^sub>0[?b, ?c] \<cdot> \<pp>\<^sub>0[?a, ?b \<otimes> ?c]\<rangle>

goal (1 subgoal):
 1. \<guillemotleft>\<a>\<^sup>-\<^sup>1[a, b, c] : a \<otimes> b \<otimes> c \<rightarrow> (a \<otimes> b) \<otimes> c\<guillemotright>
[PROOF STEP]
by auto


[STATEMENT]
lemma trans_iless_iadd1: "i < (j::enat) \<Longrightarrow> i < j + m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < j \<Longrightarrow> i < j + m
[PROOF STEP]
by (rule order_less_le_trans[OF _ ile_add1])


[STATEMENT]
theorem ord_power: "coprime m a \<Longrightarrow> ord m (a ^ k :: nat) = ord m a div gcd k (ord m a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime m a \<Longrightarrow> ord m (a ^ k) = ord m a div gcd k (ord m a)
[PROOF STEP]
using ord_power_aux[of m a k]
[PROOF STATE]
proof (prove)
using this:
ord m (a ^ k) * gcd k (ord m a) = ord m a

goal (1 subgoal):
 1. coprime m a \<Longrightarrow> ord m (a ^ k) = ord m a div gcd k (ord m a)
[PROOF STEP]
by (metis div_mult_self_is_m gcd_pos_nat ord_eq_0)


[STATEMENT]
lemma "\<not> (\<exists>(x::int) (y::int) (z::int). 4*x + (-6::int)*y = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>x y z. 4 * x + - 6 * y = 1
[PROOF STEP]
by cooper


[STATEMENT]
lemma arctan_one: "arctan 1 = pi / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan 1 = pi / 4
[PROOF STEP]
by (rule arctan_unique) (simp_all add: tan_45 m2pi_less_pi)


[STATEMENT]
lemma tcg_trans: "\<lbrakk>tcg x y; tcg y z\<rbrakk> \<Longrightarrow> tcg x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>tcg x y; tcg y z\<rbrakk> \<Longrightarrow> tcg x z
[PROOF STEP]
using tcg_def
[PROOF STATE]
proof (prove)
using this:
tcg ?x ?y = (\<tau> ?x \<le> \<tau> ?y \<and> \<tau> ?y \<le> \<tau> ?x)

goal (1 subgoal):
 1. \<lbrakk>tcg x y; tcg y z\<rbrakk> \<Longrightarrow> tcg x z
[PROOF STEP]
by force


[STATEMENT]
lemma cauchy_ine\<^sub>N_I:
  assumes "\<And>e. e > 0 \<Longrightarrow> (\<exists>M. \<forall>n\<ge>M. \<forall>m\<ge>M. eNorm N (u n - u m) < e)"
  shows "cauchy_ine\<^sub>N N u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy_ine\<^sub>N N u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<exists>M. \<forall>n\<ge>M. \<forall>m\<ge>M. eNorm N (u n - u m) < ?e

goal (1 subgoal):
 1. cauchy_ine\<^sub>N N u
[PROOF STEP]
unfolding cauchy_ine\<^sub>N_def
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<exists>M. \<forall>n\<ge>M. \<forall>m\<ge>M. eNorm N (u n - u m) < ?e

goal (1 subgoal):
 1. \<forall>e>0. \<exists>M. \<forall>n\<ge>M. \<forall>m\<ge>M. eNorm N (u n - u m) < e
[PROOF STEP]
by auto


[STATEMENT]
lemma ccpo_gfp_simp: "\<And>f. mono f \<Longrightarrow> ccpo.fixp Inf (\<ge>) f = gfp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. mono f \<Longrightarrow> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f = gfp f
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f. mono f \<Longrightarrow> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f \<le> gfp f
 2. \<And>f. mono f \<Longrightarrow> gfp f \<le> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f
[PROOF STEP]
apply (rule gfp_upperbound)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f. mono f \<Longrightarrow> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f \<le> f (ccpo.fixp Inf (\<lambda>x y. y \<le> x) f)
 2. \<And>f. mono f \<Longrightarrow> gfp f \<le> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f
[PROOF STEP]
apply (drule ccpo.fixp_unfold[OF is_dual_ccpo dual_ccpo_monoI, symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f. f (ccpo.fixp Inf (\<lambda>x y. y \<le> x) f) = ccpo.fixp Inf (\<lambda>x y. y \<le> x) f \<Longrightarrow> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f \<le> f (ccpo.fixp Inf (\<lambda>x y. y \<le> x) f)
 2. \<And>f. mono f \<Longrightarrow> gfp f \<le> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. mono f \<Longrightarrow> gfp f \<le> ccpo.fixp Inf (\<lambda>x y. y \<le> x) f
[PROOF STEP]
apply (rule ccpo.fixp_lowerbound[OF is_dual_ccpo dual_ccpo_monoI], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. mono f \<Longrightarrow> gfp f \<le> f (gfp f)
[PROOF STEP]
apply (simp add: gfp_unfold[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma has_derivative_transform_within:
  assumes "(f has_derivative f') (at x within s)"
    and "0 < d"
    and "x \<in> s"
    and "\<And>x'. \<lbrakk>x' \<in> s; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'"
  shows "(g has_derivative f') (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative f') (at x within s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x within s)
0 < d
x \<in> s
\<lbrakk>?x' \<in> s; dist ?x' x < d\<rbrakk> \<Longrightarrow> f ?x' = g ?x'

goal (1 subgoal):
 1. (g has_derivative f') (at x within s)
[PROOF STEP]
unfolding has_derivative_within
[PROOF STATE]
proof (prove)
using this:
bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within s)
0 < d
x \<in> s
\<lbrakk>?x' \<in> s; dist ?x' x < d\<rbrakk> \<Longrightarrow> f ?x' = g ?x'

goal (1 subgoal):
 1. bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (g y - (g x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within s)
[PROOF STEP]
by (force simp add: intro: Lim_transform_within)


[STATEMENT]
lemma pointwise_le_trans: "\<lbrakk>x \<unlhd> y; y \<unlhd> z\<rbrakk> \<Longrightarrow> x \<unlhd> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<unlhd> y; y \<unlhd> z\<rbrakk> \<Longrightarrow> x \<unlhd> z
[PROOF STEP]
by (smt (verit, del_insts) le_trans list_all2_trans pointwise_le_def)


[STATEMENT]
lemma convex_polygon_segments_of_aform:
  assumes "1 < length (half_segments_of_aform X)"
  shows "convex_polygon (segments_of_aform X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_polygon (segments_of_aform X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex_polygon (segments_of_aform X)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < length (half_segments_of_aform X)
[PROOF STEP]
have hne: "half_segments_of_aform X \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
1 < length (half_segments_of_aform X)

goal (1 subgoal):
 1. half_segments_of_aform X \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
half_segments_of_aform X \<noteq> []

goal (1 subgoal):
 1. convex_polygon (segments_of_aform X)
[PROOF STEP]
from convex_polychain_segments_of_aform[OF assms]
[PROOF STATE]
proof (chain)
picking this:
convex_polychain (segments_of_aform X)
[PROOF STEP]
have "convex_polychain (segments_of_aform X)"
[PROOF STATE]
proof (prove)
using this:
convex_polychain (segments_of_aform X)

goal (1 subgoal):
 1. convex_polychain (segments_of_aform X)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
convex_polychain (segments_of_aform X)

goal (1 subgoal):
 1. convex_polygon (segments_of_aform X)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
convex_polychain (segments_of_aform X)

goal (1 subgoal):
 1. convex_polygon (segments_of_aform X)
[PROOF STEP]
by (auto simp: convex_polygon_def segments_of_aform_closed)
[PROOF STATE]
proof (state)
this:
convex_polygon (segments_of_aform X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_bot_fun: "(bot :: ('a::finite \<Rightarrow> 'b::finite_lattice_complete)) = Inf_fin UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bot = \<Sqinter>\<^sub>f\<^sub>i\<^sub>n UNIV
[PROOF STEP]
by (metis Inf_UNIV Inf_fin_Inf empty_not_UNIV finite)


[STATEMENT]
lemma Pbij_compose_Pbij:
  "\<lbrakk>\<beta> : Pbij; \<gamma> : Pbij\<rbrakk> \<Longrightarrow> Pbij_compose \<beta> \<gamma> : Pbij"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_compose \<beta> \<gamma> \<in> Pbij
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_compose \<beta> \<gamma> \<in> Pbij
[PROOF STEP]
by (simp add: Pbij_compose_def Pbij_def, clarsimp)


[STATEMENT]
lemma fps_const_add_left: "fps_const (c::'a::monoid_add) + f =
    Abs_fps (\<lambda>n. if n = 0 then c + f$0 else f$n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_const c + f = Abs_fps (\<lambda>n. if n = 0 then c + f $ 0 else f $ n)
[PROOF STEP]
by (simp add: fps_ext)


[STATEMENT]
lemma map_option_in_optionI:
  "\<lbrakk> ox \<in> opt S; \<forall>x\<in>S. ox = Some x \<longrightarrow> f x \<in> S \<rbrakk>
  \<Longrightarrow> map_option f ox \<in> opt S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ox \<in> opt S; \<forall>x\<in>S. ox = Some x \<longrightarrow> f x \<in> S\<rbrakk> \<Longrightarrow> map_option f ox \<in> opt S
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ox \<in> opt S; \<forall>x\<in>S. ox = Some x \<longrightarrow> f x \<in> S\<rbrakk> \<Longrightarrow> map_option f ox \<in> opt S
[PROOF STEP]
apply (unfold map_option_case)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ox \<in> opt S; \<forall>x\<in>S. ox = Some x \<longrightarrow> f x \<in> S\<rbrakk> \<Longrightarrow> (case ox of None \<Rightarrow> None | Some x \<Rightarrow> Some (f x)) \<in> opt S
[PROOF STEP]
apply (simp split: option.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ox \<in> opt S; \<forall>x\<in>S. ox = Some x \<longrightarrow> f x \<in> S\<rbrakk> \<Longrightarrow> \<forall>x2. ox = Some x2 \<longrightarrow> f x2 \<in> S
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eventually_not_iff: "eventually (\<lambda>x. \<not> P x) F \<longleftrightarrow> \<not> eventually P F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. \<not> P x) = (\<not> eventually P F)
[PROOF STEP]
unfolding not_eventually frequently_eq_eventually
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. \<not> P x) = (\<forall>\<^sub>F x in F. \<not> P x)
[PROOF STEP]
..


[STATEMENT]
lemma bitwise_add_append:
  assumes "x = [] \<or> \<not>carry (fst (last x)) (snd (last x)) True"
  shows "bitwise_add (x @ y) (x\<noteq>[] \<and> c) = bitwise_add x (x\<noteq>[] \<and> c) @ bitwise_add y False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitwise_add (x @ y) (x \<noteq> [] \<and> c) = bitwise_add x (x \<noteq> [] \<and> c) @ bitwise_add y False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = [] \<or> \<not> carry (fst (last x)) (snd (last x)) True

goal (1 subgoal):
 1. bitwise_add (x @ y) (x \<noteq> [] \<and> c) = bitwise_add x (x \<noteq> [] \<and> c) @ bitwise_add y False
[PROOF STEP]
unfolding bitwise_add_def
[PROOF STATE]
proof (prove)
using this:
x = [] \<or> \<not> carry (fst (last x)) (snd (last x)) True

goal (1 subgoal):
 1. foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (x @ y) (\<lambda>_. []) (x \<noteq> [] \<and> c) = foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) x (\<lambda>_. []) (x \<noteq> [] \<and> c) @ foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) y (\<lambda>_. []) False
[PROOF STEP]
by(induct x arbitrary: c) (auto simp add: case_prod_unfold xor3_def carry_def split: if_split_asm)


[STATEMENT]
lemma contour_integral_reversepath:
  assumes "valid_path g"
    shows "contour_integral (reversepath g) f = - (contour_integral g f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
proof (cases "f contour_integrable_on g")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
 2. \<not> f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f contour_integrable_on g

goal (2 subgoals):
 1. f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
 2. \<not> f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f contour_integrable_on g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on g

goal (1 subgoal):
 1. contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
by (simp add: assms contour_integral_unique has_contour_integral_integral has_contour_integral_reversepath)
[PROOF STATE]
proof (state)
this:
contour_integral (reversepath g) f = - contour_integral g f

goal (1 subgoal):
 1. \<not> f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f contour_integrable_on g

goal (1 subgoal):
 1. \<not> f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> f contour_integrable_on g
[PROOF STEP]
have "\<not> f contour_integrable_on (reversepath g)"
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on g

goal (1 subgoal):
 1. \<not> f contour_integrable_on reversepath g
[PROOF STEP]
by (simp add: assms contour_integrable_reversepath_eq)
[PROOF STATE]
proof (state)
this:
\<not> f contour_integrable_on reversepath g

goal (1 subgoal):
 1. \<not> f contour_integrable_on g \<Longrightarrow> contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> f contour_integrable_on g
\<not> f contour_integrable_on reversepath g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on g
\<not> f contour_integrable_on reversepath g

goal (1 subgoal):
 1. contour_integral (reversepath g) f = - contour_integral g f
[PROOF STEP]
by (simp add: not_integrable_contour_integral)
[PROOF STATE]
proof (state)
this:
contour_integral (reversepath g) f = - contour_integral g f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_subst:
  fixes S::"'a::euclidean_space set"
  assumes "is_interval S"
    and "x \<in> S" "y j \<in> S"
    and "j \<in> Basis"
  shows "(\<Sum>i\<in>Basis. (if i = j then y i \<bullet> i else x \<bullet> i) *\<^sub>R i) \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (if i = j then y i \<bullet> i else x \<bullet> i) *\<^sub>R i) \<in> S
[PROOF STEP]
by (rule mem_is_intervalI[OF assms(1,2)]) (auto simp: assms)