[STATEMENT]
lemma at_to_infinity: "(at (0::'a::{real_normed_field,field})) = filtermap inverse at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at (0::'a) = filtermap inverse at_infinity
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. at (0::'a) \<le> filtermap inverse at_infinity
 2. filtermap inverse at_infinity \<le> at (0::'a)
[PROOF STEP]
have "(inverse \<longlongrightarrow> (0::'a)) at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inverse \<longlongrightarrow> (0::'a)) at_infinity
[PROOF STEP]
by (fact tendsto_inverse_0)
[PROOF STATE]
proof (state)
this:
(inverse \<longlongrightarrow> (0::'a)) at_infinity

goal (2 subgoals):
 1. at (0::'a) \<le> filtermap inverse at_infinity
 2. filtermap inverse at_infinity \<le> at (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(inverse \<longlongrightarrow> (0::'a)) at_infinity
[PROOF STEP]
show "filtermap inverse at_infinity \<le> at (0::'a)"
[PROOF STATE]
proof (prove)
using this:
(inverse \<longlongrightarrow> (0::'a)) at_infinity

goal (1 subgoal):
 1. filtermap inverse at_infinity \<le> at (0::'a)
[PROOF STEP]
using filterlim_def filterlim_ident filterlim_inverse_at_iff
[PROOF STATE]
proof (prove)
using this:
(inverse \<longlongrightarrow> (0::'a)) at_infinity
filterlim ?f ?F2.0 ?F1.0 = (filtermap ?f ?F1.0 \<le> ?F2.0)
LIM x ?F. x :> ?F
(LIM x ?F. inverse (?g x) :> at (0::?'b)) = filterlim ?g at_infinity ?F

goal (1 subgoal):
 1. filtermap inverse at_infinity \<le> at (0::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
filtermap inverse at_infinity \<le> at (0::'a)

goal (1 subgoal):
 1. at (0::'a) \<le> filtermap inverse at_infinity
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. at (0::'a) \<le> filtermap inverse at_infinity
[PROOF STEP]
have "filtermap inverse (filtermap inverse (at (0::'a))) \<le> filtermap inverse at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap inverse (filtermap inverse (at (0::'a))) \<le> filtermap inverse at_infinity
[PROOF STEP]
using filterlim_inverse_at_infinity
[PROOF STATE]
proof (prove)
using this:
filterlim inverse at_infinity (at (0::?'a))

goal (1 subgoal):
 1. filtermap inverse (filtermap inverse (at (0::'a))) \<le> filtermap inverse at_infinity
[PROOF STEP]
unfolding filterlim_def
[PROOF STATE]
proof (prove)
using this:
filtermap inverse (at (0::?'a)) \<le> at_infinity

goal (1 subgoal):
 1. filtermap inverse (filtermap inverse (at (0::'a))) \<le> filtermap inverse at_infinity
[PROOF STEP]
by (rule filtermap_mono)
[PROOF STATE]
proof (state)
this:
filtermap inverse (filtermap inverse (at (0::'a))) \<le> filtermap inverse at_infinity

goal (1 subgoal):
 1. at (0::'a) \<le> filtermap inverse at_infinity
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filtermap inverse (filtermap inverse (at (0::'a))) \<le> filtermap inverse at_infinity
[PROOF STEP]
show "at (0::'a) \<le> filtermap inverse at_infinity"
[PROOF STATE]
proof (prove)
using this:
filtermap inverse (filtermap inverse (at (0::'a))) \<le> filtermap inverse at_infinity

goal (1 subgoal):
 1. at (0::'a) \<le> filtermap inverse at_infinity
[PROOF STEP]
by (simp add: filtermap_ident filtermap_filtermap)
[PROOF STATE]
proof (state)
this:
at (0::'a) \<le> filtermap inverse at_infinity

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SN_on_weakening:
  assumes "SN_on R1 A"
  shows "SN_on (R1 \<inter> R2) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
assume "\<exists>S. S 0 \<in> A \<and> chain (R1 \<inter> R2) S"
[PROOF STATE]
proof (state)
this:
\<exists>S. S 0 \<in> A \<and> (\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2)

goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>S. S 0 \<in> A \<and> (\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2)
[PROOF STEP]
obtain S where
      S0: "S 0 \<in> A" and
      SN: "chain (R1 \<inter> R2) S"
[PROOF STATE]
proof (prove)
using this:
\<exists>S. S 0 \<in> A \<and> (\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2)

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S 0 \<in> A; \<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S 0 \<in> A
\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2

goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
from SN
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2
[PROOF STEP]
have SN': "chain R1 S"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2

goal (1 subgoal):
 1. \<forall>i. (S i, S (Suc i)) \<in> R1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i. (S i, S (Suc i)) \<in> R1

goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
with S0 and assms
[PROOF STATE]
proof (chain)
picking this:
S 0 \<in> A
SN_on R1 A
\<forall>i. (S i, S (Suc i)) \<in> R1
[PROOF STEP]
have "False"
[PROOF STATE]
proof (prove)
using this:
S 0 \<in> A
SN_on R1 A
\<forall>i. (S i, S (Suc i)) \<in> R1

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<exists>S. S 0 \<in> A \<and> (\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2) \<Longrightarrow> False

goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>S. S 0 \<in> A \<and> (\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2) \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>S. S 0 \<in> A \<and> (\<forall>i. (S i, S (Suc i)) \<in> R1 \<inter> R2) \<Longrightarrow> False

goal (1 subgoal):
 1. SN_on (R1 \<inter> R2) A
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
SN_on (R1 \<inter> R2) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma primes_omega_less_primes_omega_primorial:
  fixes n :: nat
  assumes n: "n > 0" and "n < primorial x"
  shows "primes_omega n < primes_omega (primorial x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primes_omega n < primes_omega (primorial x)
[PROOF STEP]
proof (cases "n > 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
 2. \<not> 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 1 < n

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
 2. \<not> 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
have [simp]: "primes_pi 2 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primes_pi 2 = 1
[PROOF STEP]
by (simp add: eval_\<pi>)
[PROOF STATE]
proof (state)
this:
primes_pi 2 = 1

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
 2. \<not> 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
from False assms
[PROOF STATE]
proof (chain)
picking this:
\<not> 1 < n
0 < n
n < primorial x
[PROOF STEP]
have [simp]: "n = 1"
[PROOF STATE]
proof (prove)
using this:
\<not> 1 < n
0 < n
n < primorial x

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

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
 2. \<not> 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
n < primorial x
[PROOF STEP]
have "\<not>(x < 2)"
[PROOF STATE]
proof (prove)
using this:
0 < n
n < primorial x

goal (1 subgoal):
 1. \<not> x < 2
[PROOF STEP]
by (intro notI) (auto simp: primorial_conv_primorial')
[PROOF STATE]
proof (state)
this:
\<not> x < 2

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
 2. \<not> 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> x < 2

goal (1 subgoal):
 1. primes_omega n < primes_omega (primorial x)
[PROOF STEP]
using assms \<pi>_mono[of 2 x]
[PROOF STATE]
proof (prove)
using this:
\<not> x < 2
0 < n
n < primorial x
2 \<le> x \<Longrightarrow> primes_pi 2 \<le> primes_pi x

goal (1 subgoal):
 1. primes_omega n < primes_omega (primorial x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
primes_omega n < primes_omega (primorial x)

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
1 < n

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
define m where "m = primes_omega n"
[PROOF STATE]
proof (state)
this:
m = primes_omega n

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
have le: "primorial' m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primorial' m \<le> n
[PROOF STEP]
using primorial'_primes_omega_le[of n] \<open>n > 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> primorial' (primes_omega n) \<le> n
1 < n

goal (1 subgoal):
 1. primorial' m \<le> n
[PROOF STEP]
by (simp add: m_def primes_omega_def)
[PROOF STATE]
proof (state)
this:
primorial' m \<le> n

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
primorial' m \<le> n

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
have "\<dots> < primorial x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < primorial x
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
n < primorial x

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n < primorial x

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
have "\<dots> = primorial' (nat \<lfloor>primes_pi x\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primorial x = primorial' (nat \<lfloor>primes_pi x\<rfloor>)
[PROOF STEP]
by (simp add: primorial_conv_primorial')
[PROOF STATE]
proof (state)
this:
primorial x = primorial' (nat \<lfloor>primes_pi x\<rfloor>)

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
primorial' m < primorial' (nat \<lfloor>primes_pi x\<rfloor>)
[PROOF STEP]
have "m < nat \<lfloor>primes_pi x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
primorial' m < primorial' (nat \<lfloor>primes_pi x\<rfloor>)

goal (1 subgoal):
 1. m < nat \<lfloor>primes_pi x\<rfloor>
[PROOF STEP]
using strict_mono_less[OF strict_mono_primorial']
[PROOF STATE]
proof (prove)
using this:
primorial' m < primorial' (nat \<lfloor>primes_pi x\<rfloor>)
(primorial' ?x < primorial' ?y) = (?x < ?y)

goal (1 subgoal):
 1. m < nat \<lfloor>primes_pi x\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m < nat \<lfloor>primes_pi x\<rfloor>

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
hence "m < primes_pi x"
[PROOF STATE]
proof (prove)
using this:
m < nat \<lfloor>primes_pi x\<rfloor>

goal (1 subgoal):
 1. real m < primes_pi x
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real m < primes_pi x

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real m < primes_pi x

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
have "\<dots> = primes_omega (primorial x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primes_pi x = real (primes_omega (primorial x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
primes_pi x = real (primes_omega (primorial x))

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> primes_omega n < primes_omega (primorial x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real m < real (primes_omega (primorial x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real m < real (primes_omega (primorial x))

goal (1 subgoal):
 1. primes_omega n < primes_omega (primorial x)
[PROOF STEP]
unfolding m_def of_nat_less_iff
[PROOF STATE]
proof (prove)
using this:
primes_omega n < primes_omega (primorial x)

goal (1 subgoal):
 1. primes_omega n < primes_omega (primorial x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
primes_omega n < primes_omega (primorial x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma between_cong_2:
  assumes "Bet A D B" and
    "Bet A E B"
    and "Cong A D A E"
  shows "D = E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D = E
[PROOF STEP]
using l5_3
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Bet ?A ?B ?D; Bet ?A ?C ?D\<rbrakk> \<Longrightarrow> Bet ?A ?B ?C \<or> Bet ?A ?C ?B

goal (1 subgoal):
 1. D = E
[PROOF STEP]
by (smt Tarski_neutral_dimensionless_axioms assms(1) assms(2) assms(3) cong_diff cong_inner_transitivity l4_3_1)


[STATEMENT]
lemma heapify_snd:
  "n \<le> length xs \<Longrightarrow> snd (heapify n xs) = drop n xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length xs \<Longrightarrow> snd (heapify n xs) = drop n xs
[PROOF STEP]
apply (induct xs arbitrary: n rule: measure_induct[where f=length])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. \<lbrakk>\<forall>y. length y < length x \<longrightarrow> (\<forall>x\<le>length y. snd (heapify x y) = drop x y); n \<le> length x\<rbrakk> \<Longrightarrow> snd (heapify n x) = drop n x
[PROOF STEP]
apply (case_tac n; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n nat. \<lbrakk>\<forall>y. length y < length x \<longrightarrow> (\<forall>x\<le>length y. snd (heapify x y) = drop x y); Suc nat \<le> length x; n = Suc nat\<rbrakk> \<Longrightarrow> snd (heapify (Suc nat) x) = drop (Suc nat) x
[PROOF STEP]
apply (clarsimp simp: Suc_le_length_iff case_prod_beta)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat ys. \<lbrakk>\<forall>y. length y < Suc (length ys) \<longrightarrow> (\<forall>x\<le>length y. snd (heapify x y) = drop x y); nat \<le> length ys\<rbrakk> \<Longrightarrow> drop (nat div 2 + Suc nat div 2) ys = drop nat ys
[PROOF STEP]
apply (rule arg_cong[where f="\<lambda>n. drop n xs" for xs])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat ys. \<lbrakk>\<forall>y. length y < Suc (length ys) \<longrightarrow> (\<forall>x\<le>length y. snd (heapify x y) = drop x y); nat \<le> length ys\<rbrakk> \<Longrightarrow> nat div 2 + Suc nat div 2 = nat
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma qfN_zero: "\<lbrakk> (N::int) \<ge> 1; a^2 + N*b^2 = 0 \<rbrakk> \<Longrightarrow> (a = 0 \<and> b = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> N; a\<^sup>2 + N * b\<^sup>2 = 0\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> N; a\<^sup>2 + N * b\<^sup>2 = 0\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0
[PROOF STEP]
assume N: "N \<ge> 1" and abN: "a^2 + N*b^2 = 0"
[PROOF STATE]
proof (state)
this:
1 \<le> N
a\<^sup>2 + N * b\<^sup>2 = 0

goal (1 subgoal):
 1. \<lbrakk>1 \<le> N; a\<^sup>2 + N * b\<^sup>2 = 0\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = 0 \<and> b = 0
[PROOF STEP]
proof (rule ccontr, auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<noteq> 0 \<Longrightarrow> False
 2. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "a \<noteq> 0"
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (2 subgoals):
 1. a \<noteq> 0 \<Longrightarrow> False
 2. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "a^2 > 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. 0 < a\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < a\<^sup>2

goal (2 subgoals):
 1. a \<noteq> 0 \<Longrightarrow> False
 2. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < a\<^sup>2

goal (2 subgoals):
 1. a \<noteq> 0 \<Longrightarrow> False
 2. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "N*b^2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> N * b\<^sup>2
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 \<le> N * b\<^sup>2
 2. \<not> ?P \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
assume "b = 0"
[PROOF STATE]
proof (state)
this:
b = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 \<le> N * b\<^sup>2
 2. \<not> ?P \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
b = 0

goal (1 subgoal):
 1. 0 \<le> N * b\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> N * b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
assume "\<not> b = 0"
[PROOF STATE]
proof (state)
this:
b \<noteq> 0

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
hence " b^2 > 0"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0

goal (1 subgoal):
 1. 0 < b\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
from N
[PROOF STATE]
proof (chain)
picking this:
1 \<le> N
[PROOF STEP]
have "N>0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> N

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

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < b\<^sup>2
0 < N
[PROOF STEP]
have "N*b^2 > N*0"
[PROOF STATE]
proof (prove)
using this:
0 < b\<^sup>2
0 < N

goal (1 subgoal):
 1. N * 0 < N * b\<^sup>2
[PROOF STEP]
by (auto simp only: zmult_zless_mono2)
[PROOF STATE]
proof (state)
this:
N * 0 < N * b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> 0 \<le> N * b\<^sup>2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
N * 0 < N * b\<^sup>2

goal (1 subgoal):
 1. 0 \<le> N * b\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> N * b\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> N * b\<^sup>2

goal (2 subgoals):
 1. a \<noteq> 0 \<Longrightarrow> False
 2. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < a\<^sup>2
0 \<le> N * b\<^sup>2
[PROOF STEP]
have "a^2 + N*b^2 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < a\<^sup>2
0 \<le> N * b\<^sup>2

goal (1 subgoal):
 1. 0 < a\<^sup>2 + N * b\<^sup>2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 < a\<^sup>2 + N * b\<^sup>2

goal (2 subgoals):
 1. a \<noteq> 0 \<Longrightarrow> False
 2. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
with abN
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 + N * b\<^sup>2 = 0
0 < a\<^sup>2 + N * b\<^sup>2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + N * b\<^sup>2 = 0
0 < a\<^sup>2 + N * b\<^sup>2

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "b \<noteq> 0"
[PROOF STATE]
proof (state)
this:
b \<noteq> 0

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "b^2>0"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0

goal (1 subgoal):
 1. 0 < b\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
from N
[PROOF STATE]
proof (chain)
picking this:
1 \<le> N
[PROOF STEP]
have "N>0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> N

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

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < b\<^sup>2
0 < N
[PROOF STEP]
have "N*b^2>N*0"
[PROOF STATE]
proof (prove)
using this:
0 < b\<^sup>2
0 < N

goal (1 subgoal):
 1. N * 0 < N * b\<^sup>2
[PROOF STEP]
by (auto simp only: zmult_zless_mono2)
[PROOF STATE]
proof (state)
this:
N * 0 < N * b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "N*b^2 > 0"
[PROOF STATE]
proof (prove)
using this:
N * 0 < N * b\<^sup>2

goal (1 subgoal):
 1. 0 < N * b\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < N * b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < N * b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "a^2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a\<^sup>2
[PROOF STEP]
by (rule zero_le_power2)
[PROOF STATE]
proof (state)
this:
0 \<le> a\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < N * b\<^sup>2
0 \<le> a\<^sup>2
[PROOF STEP]
have "a^2 + N*b^2 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < N * b\<^sup>2
0 \<le> a\<^sup>2

goal (1 subgoal):
 1. 0 < a\<^sup>2 + N * b\<^sup>2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 < a\<^sup>2 + N * b\<^sup>2

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
with abN
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 + N * b\<^sup>2 = 0
0 < a\<^sup>2 + N * b\<^sup>2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + N * b\<^sup>2 = 0
0 < a\<^sup>2 + N * b\<^sup>2

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a = 0 \<and> b = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sort_key_append:
  "\<forall>x\<in>set xs. \<forall>y\<in>set ys. f x < f y \<Longrightarrow> sort_key f (xs @ ys) = sort_key f xs @ sort_key f ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. \<forall>y\<in>set ys. f x < f y \<Longrightarrow> sort_key f (xs @ ys) = sort_key f xs @ sort_key f ys
[PROOF STEP]
by(induct xs)(simp_all add: insort_key_append1)


[STATEMENT]
lemma (in domain) finprod_mult_of:
  assumes "finite A"
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<in> carrier (mult_of R)"
  shows "finprod R f A = finprod (mult_of R) f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod R f A = finprod (Ring_Divisibility.mult_of R) f A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
?x \<in> A \<Longrightarrow> f ?x \<in> carrier (Ring_Divisibility.mult_of R)

goal (1 subgoal):
 1. finprod R f A = finprod (Ring_Divisibility.mult_of R) f A
[PROOF STEP]
by (induction A rule:finite_induct, auto)


[STATEMENT]
lemma fps_lr_inverse_eq_0_iff:
  fixes x :: "'a::{comm_monoid_add,mult_zero,uminus}"
  and   y :: "'b::{ab_group_add,mult_zero}"
  shows "fps_left_inverse f x = 0 \<longleftrightarrow> x = 0"
  and   "fps_right_inverse g y = 0 \<longleftrightarrow> y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_left_inverse f x = 0) = (x = (0::'a)) &&& (fps_right_inverse g y = 0) = (y = (0::'b))
[PROOF STEP]
using fps_lr_inverse_starting0 fps_lr_inverse_eq0_imp_starting0
[PROOF STATE]
proof (prove)
using this:
fps_left_inverse ?f (0::?'a) = 0
fps_right_inverse ?g (0::?'b) = 0
fps_left_inverse ?f ?x = 0 \<Longrightarrow> ?x = (0::?'a)
fps_right_inverse ?f ?x = 0 \<Longrightarrow> ?x = (0::?'a)

goal (1 subgoal):
 1. (fps_left_inverse f x = 0) = (x = (0::'a)) &&& (fps_right_inverse g y = 0) = (y = (0::'b))
[PROOF STEP]
by    auto


[STATEMENT]
lemma expands_to_min_gt:
  assumes "(g expands_to G) basis" "eventually (\<lambda>x. f x > g x) at_top"
  shows   "((\<lambda>x. min (f x) (g x)) expands_to G) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. min (f x) (g x)) expands_to G) basis
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
(g expands_to G) basis

goal (1 subgoal):
 1. ((\<lambda>x. min (f x) (g x)) expands_to G) basis
[PROOF STEP]
by (rule expands_to_cong) (insert assms(2), auto simp: min_def elim: eventually_mono)


[STATEMENT]
lemma closed_Collect_conj:
  assumes "closed {x. P x}" "closed {x. Q x}"
  shows "closed {x. P x \<and> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x \<and> Q x}
[PROOF STEP]
using closed_Int[OF assms]
[PROOF STATE]
proof (prove)
using this:
closed ({x. P x} \<inter> {x. Q x})

goal (1 subgoal):
 1. closed {x. P x \<and> Q x}
[PROOF STEP]
by (simp add: Int_def)


[STATEMENT]
lemma preal_add_less_cancel_right [simp]: "((r::preal) + t < s + t) = (r < s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r + t < s + t) = (r < s)
[PROOF STEP]
using preal_add_less_cancel_left [symmetric, of r s t]
[PROOF STATE]
proof (prove)
using this:
(r < s) = (t + r < t + s)

goal (1 subgoal):
 1. (r + t < s + t) = (r < s)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma (in group) rcos_disjoint:
  assumes "subgroup H G"
  shows "pairwise disjnt (rcosets H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise disjnt (rcosets H)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pairwise disjnt (rcosets H)
[PROOF STEP]
interpret subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pairwise disjnt (rcosets H)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise disjnt (rcosets H)
[PROOF STEP]
unfolding RCOSETS_def r_coset_def pairwise_def disjnt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Union>a\<in>carrier G. {\<Union>h\<in>H. {h \<otimes> a}}. \<forall>y\<in>\<Union>a\<in>carrier G. {\<Union>h\<in>H. {h \<otimes> a}}. x \<noteq> y \<longrightarrow> x \<inter> y = {}
[PROOF STEP]
by (blast intro: rcos_equation assms sym)
[PROOF STATE]
proof (state)
this:
pairwise disjnt (rcosets H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Hoeffdings_lemma_aux:
  fixes h p :: real
  assumes "h \<ge> 0" and "p \<ge> 0"
  defines "L \<equiv> (\<lambda>h. -h * p + ln (1 + p * (exp h - 1)))"
  shows   "L h \<le> h\<^sup>2 / 8"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L h \<le> h\<^sup>2 / 8
[PROOF STEP]
proof (cases "h = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
h \<noteq> 0

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
hence h: "h > 0"
[PROOF STATE]
proof (prove)
using this:
h \<noteq> 0

goal (1 subgoal):
 1. 0 < h
[PROOF STEP]
using \<open>h \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
h \<noteq> 0
0 \<le> h

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

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
define L' where "L' = (\<lambda>h. -p + p * exp h / (1 + p * (exp h - 1)))"
[PROOF STATE]
proof (state)
this:
L' = (\<lambda>h. - p + p * exp h / (1 + p * (exp h - 1)))

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
define L'' where "L'' = (\<lambda>h. -(p\<^sup>2) * exp h * exp h / (1 + p * (exp h - 1))\<^sup>2 +
                              p * exp h / (1 + p * (exp h - 1)))"
[PROOF STATE]
proof (state)
this:
L'' = (\<lambda>h. - p\<^sup>2 * exp h * exp h / (1 + p * (exp h - 1))\<^sup>2 + p * exp h / (1 + p * (exp h - 1)))

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
define Ls where "Ls = (\<lambda>n. [L, L', L''] ! n)"
[PROOF STATE]
proof (state)
this:
Ls = (!) [L, L', L'']

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
have [simp]: "L 0 = 0" "L' 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L 0 = 0 &&& L' 0 = 0
[PROOF STEP]
by (auto simp: L_def L'_def)
[PROOF STATE]
proof (state)
this:
L 0 = 0
L' 0 = 0

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
have L': "(L has_real_derivative L' x) (at x)" if "x \<in> {0..h}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L has_real_derivative L' x) (at x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (L has_real_derivative L' x) (at x)
[PROOF STEP]
have "1 + p * (exp x - 1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + p * (exp x - 1)
[PROOF STEP]
using \<open>p \<ge> 0\<close> that
[PROOF STATE]
proof (prove)
using this:
0 \<le> p
x \<in> {0..h}

goal (1 subgoal):
 1. 0 < 1 + p * (exp x - 1)
[PROOF STEP]
by (intro add_pos_nonneg mult_nonneg_nonneg) auto
[PROOF STATE]
proof (state)
this:
0 < 1 + p * (exp x - 1)

goal (1 subgoal):
 1. (L has_real_derivative L' x) (at x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < 1 + p * (exp x - 1)

goal (1 subgoal):
 1. (L has_real_derivative L' x) (at x)
[PROOF STEP]
unfolding L_def L'_def
[PROOF STATE]
proof (prove)
using this:
0 < 1 + p * (exp x - 1)

goal (1 subgoal):
 1. ((\<lambda>h. - h * p + ln (1 + p * (exp h - 1))) has_real_derivative - p + p * exp x / (1 + p * (exp x - 1))) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
(L has_real_derivative L' x) (at x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {0..h} \<Longrightarrow> (L has_real_derivative L' ?x) (at ?x)

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
have L'': "(L' has_real_derivative L'' x) (at x)" if "x \<in> {0..h}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L' has_real_derivative L'' x) (at x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (L' has_real_derivative L'' x) (at x)
[PROOF STEP]
have *: "1 + p * (exp x - 1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + p * (exp x - 1)
[PROOF STEP]
using \<open>p \<ge> 0\<close> that
[PROOF STATE]
proof (prove)
using this:
0 \<le> p
x \<in> {0..h}

goal (1 subgoal):
 1. 0 < 1 + p * (exp x - 1)
[PROOF STEP]
by (intro add_pos_nonneg mult_nonneg_nonneg) auto
[PROOF STATE]
proof (state)
this:
0 < 1 + p * (exp x - 1)

goal (1 subgoal):
 1. (L' has_real_derivative L'' x) (at x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L' has_real_derivative L'' x) (at x)
[PROOF STEP]
unfolding L'_def L''_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>h. - p + p * exp h / (1 + p * (exp h - 1))) has_real_derivative - p\<^sup>2 * exp x * exp x / (1 + p * (exp x - 1))\<^sup>2 + p * exp x / (1 + p * (exp x - 1))) (at x)
[PROOF STEP]
by (insert *, (rule derivative_eq_intros refl | simp)+) (auto simp: divide_simps; algebra)
[PROOF STATE]
proof (state)
this:
(L' has_real_derivative L'' x) (at x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {0..h} \<Longrightarrow> (L' has_real_derivative L'' ?x) (at ?x)

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
have diff: "\<forall>m t. m < 2 \<and> 0 \<le> t \<and> t \<le> h \<longrightarrow> (Ls m has_real_derivative Ls (Suc m) t) (at t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m t. m < 2 \<and> 0 \<le> t \<and> t \<le> h \<longrightarrow> (Ls m has_real_derivative Ls (Suc m) t) (at t)
[PROOF STEP]
using L' L''
[PROOF STATE]
proof (prove)
using this:
?x \<in> {0..h} \<Longrightarrow> (L has_real_derivative L' ?x) (at ?x)
?x \<in> {0..h} \<Longrightarrow> (L' has_real_derivative L'' ?x) (at ?x)

goal (1 subgoal):
 1. \<forall>m t. m < 2 \<and> 0 \<le> t \<and> t \<le> h \<longrightarrow> (Ls m has_real_derivative Ls (Suc m) t) (at t)
[PROOF STEP]
by (auto simp: Ls_def nth_Cons split: nat.splits)
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < 2 \<and> 0 \<le> t \<and> t \<le> h \<longrightarrow> (Ls m has_real_derivative Ls (Suc m) t) (at t)

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
from Taylor[of 2 Ls L 0 h 0 h, OF _ _ diff]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < 2; Ls 0 = L; 0 \<le> 0; 0 \<le> h; 0 \<le> h; h \<le> h; h \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>t. (if h < 0 then h < t \<and> t < 0 else 0 < t \<and> t < h) \<and> L h = (\<Sum>m<2. Ls m 0 / fact m * (h - 0) ^ m) + Ls 2 t / fact 2 * (h - 0)\<^sup>2
[PROOF STEP]
obtain t where t: "t \<in> {0<..<h}" "L h = L'' t * h\<^sup>2 / 2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 2; Ls 0 = L; 0 \<le> 0; 0 \<le> h; 0 \<le> h; h \<le> h; h \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>t. (if h < 0 then h < t \<and> t < 0 else 0 < t \<and> t < h) \<and> L h = (\<Sum>m<2. Ls m 0 / fact m * (h - 0) ^ m) + Ls 2 t / fact 2 * (h - 0)\<^sup>2

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> {0<..<h}; L h = L'' t * h\<^sup>2 / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>h > 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 2; Ls 0 = L; 0 \<le> 0; 0 \<le> h; 0 \<le> h; h \<le> h; h \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>t. (if h < 0 then h < t \<and> t < 0 else 0 < t \<and> t < h) \<and> L h = (\<Sum>m<2. Ls m 0 / fact m * (h - 0) ^ m) + Ls 2 t / fact 2 * (h - 0)\<^sup>2
0 < h

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> {0<..<h}; L h = L'' t * h\<^sup>2 / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: Ls_def lessThan_nat_numeral)
[PROOF STATE]
proof (state)
this:
t \<in> {0<..<h}
L h = L'' t * h\<^sup>2 / 2

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
define u where "u = p * exp t / (1 + p * (exp t - 1))"
[PROOF STATE]
proof (state)
this:
u = p * exp t / (1 + p * (exp t - 1))

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
have "L'' t = u * (1 - u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L'' t = u * (1 - u)
[PROOF STEP]
by (simp add: L''_def u_def divide_simps; algebra)
[PROOF STATE]
proof (state)
this:
L'' t = u * (1 - u)

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
L'' t = u * (1 - u)

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
have "\<dots> \<le> 1 / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u * (1 - u) \<le> 1 / 4
[PROOF STEP]
using mult_const_minus_self_real_le[of u 1]
[PROOF STATE]
proof (prove)
using this:
u * (1 - u) \<le> 1\<^sup>2 / 4

goal (1 subgoal):
 1. u * (1 - u) \<le> 1 / 4
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u * (1 - u) \<le> 1 / 4

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
L'' t \<le> 1 / 4
[PROOF STEP]
have "L'' t \<le> 1 / 4"
[PROOF STATE]
proof (prove)
using this:
L'' t \<le> 1 / 4

goal (1 subgoal):
 1. L'' t \<le> 1 / 4
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
L'' t \<le> 1 / 4

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
note t(2)
[PROOF STATE]
proof (state)
this:
L h = L'' t * h\<^sup>2 / 2

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
L h = L'' t * h\<^sup>2 / 2

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
have "L'' t * h\<^sup>2 / 2 \<le> (1 / 4) * h\<^sup>2 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L'' t * h\<^sup>2 / 2 \<le> 1 / 4 * h\<^sup>2 / 2
[PROOF STEP]
using \<open>L'' t \<le> 1 / 4\<close>
[PROOF STATE]
proof (prove)
using this:
L'' t \<le> 1 / 4

goal (1 subgoal):
 1. L'' t * h\<^sup>2 / 2 \<le> 1 / 4 * h\<^sup>2 / 2
[PROOF STEP]
by (intro mult_right_mono divide_right_mono) auto
[PROOF STATE]
proof (state)
this:
L'' t * h\<^sup>2 / 2 \<le> 1 / 4 * h\<^sup>2 / 2

goal (2 subgoals):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
 2. h \<noteq> 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
L h \<le> 1 / 4 * h\<^sup>2 / 2
[PROOF STEP]
show "L h \<le> h\<^sup>2 / 8"
[PROOF STATE]
proof (prove)
using this:
L h \<le> 1 / 4 * h\<^sup>2 / 2

goal (1 subgoal):
 1. L h \<le> h\<^sup>2 / 8
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
L h \<le> h\<^sup>2 / 8

goal (1 subgoal):
 1. h = 0 \<Longrightarrow> L h \<le> h\<^sup>2 / 8
[PROOF STEP]
qed (auto simp: L_def)


[STATEMENT]
lemma games_lfp_option_stable:
  assumes g: "g \<in> games_lfp"
  and opt: "left_option g opt \<or> right_option g opt"
  shows "opt \<in> games_lfp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. opt \<in> games_lfp
[PROOF STEP]
apply (rule games_option_stable[where g=g])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. games_lfp = fixgames games_lfp
 2. g \<in> games_lfp
 3. left_option g opt \<or> right_option g opt
[PROOF STEP]
apply (simp add: games_lfp_unfold[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. g \<in> games_lfp
 2. left_option g opt \<or> right_option g opt
[PROOF STEP]
apply (simp_all add: assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_bij:
  assumes "bij F"
    "\<forall>x\<in>s. f x = g (F x)"
  shows "\<And>t. F ` s =  t \<Longrightarrow> sum f s = sum g t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. F ` s = t \<Longrightarrow> sum f s = sum g t
[PROOF STEP]
by (metis assms bij_betw_def bij_betw_subset subset_UNIV sum.reindex_cong)


[STATEMENT]
lemma gcd_neg2 [simp]: "gcd a (-b) = gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd a (- b) = gcd a b
[PROOF STEP]
by (rule sym, rule gcdI) (simp_all add: gcd_greatest)


[STATEMENT]
lemma eigenvector_hom: assumes A: "A \<in> carrier_mat n n"
  and ev: "eigenvector A v ev"
  shows "eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
let ?A = "mat\<^sub>h A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
let ?v = "vec\<^sub>h v"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
let ?ev = "hom ev"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
from ev[unfolded eigenvector_def] A
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec (dim_row A) \<and> v \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v v = ev \<cdot>\<^sub>v v
A \<in> carrier_mat n n
[PROOF STEP]
have v: "v \<in> carrier_vec n" "v \<noteq> 0\<^sub>v n" "A *\<^sub>v v = ev \<cdot>\<^sub>v v"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (dim_row A) \<and> v \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v v = ev \<cdot>\<^sub>v v
A \<in> carrier_mat n n

goal (1 subgoal):
 1. v \<in> carrier_vec n &&& v \<noteq> 0\<^sub>v n &&& A *\<^sub>v v = ev \<cdot>\<^sub>v v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
A *\<^sub>v v = ev \<cdot>\<^sub>v v

goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
from v(1)
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n
[PROOF STEP]
have v1: "?v \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n

goal (1 subgoal):
 1. vec\<^sub>h v \<in> carrier_vec n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec\<^sub>h v \<in> carrier_vec n

goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
from v(1-2)
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
[PROOF STEP]
obtain i where "i < n" and "v $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < n; v $ i \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
i < n
v $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
with v(1)
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n
i < n
v $ i \<noteq> (0::'a)
[PROOF STEP]
have "?v $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
i < n
v $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. vec\<^sub>h v $ i \<noteq> (0::'b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec\<^sub>h v $ i \<noteq> (0::'b)

goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
hence v2: "?v \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
vec\<^sub>h v $ i \<noteq> (0::'b)

goal (1 subgoal):
 1. vec\<^sub>h v \<noteq> 0\<^sub>v n
[PROOF STEP]
using \<open>i < n\<close> v(1)
[PROOF STATE]
proof (prove)
using this:
vec\<^sub>h v $ i \<noteq> (0::'b)
i < n
v \<in> carrier_vec n

goal (1 subgoal):
 1. vec\<^sub>h v \<noteq> 0\<^sub>v n
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
vec\<^sub>h v \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
from arg_cong[OF v(3), of "vec\<^sub>h", unfolded mult_mat_vec_hom[OF A v(1)] vec_hom_smult]
[PROOF STATE]
proof (chain)
picking this:
mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v
[PROOF STEP]
have v3: "?A *\<^sub>v ?v = ?ev \<cdot>\<^sub>v ?v"
[PROOF STATE]
proof (prove)
using this:
mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v

goal (1 subgoal):
 1. mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v

goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
from v1 v2 v3
[PROOF STATE]
proof (chain)
picking this:
vec\<^sub>h v \<in> carrier_vec n
vec\<^sub>h v \<noteq> 0\<^sub>v n
mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vec\<^sub>h v \<in> carrier_vec n
vec\<^sub>h v \<noteq> 0\<^sub>v n
mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v

goal (1 subgoal):
 1. eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)
[PROOF STEP]
unfolding eigenvector_def
[PROOF STATE]
proof (prove)
using this:
vec\<^sub>h v \<in> carrier_vec n
vec\<^sub>h v \<noteq> 0\<^sub>v n
mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v

goal (1 subgoal):
 1. vec\<^sub>h v \<in> carrier_vec (dim_row (mat\<^sub>h A)) \<and> vec\<^sub>h v \<noteq> 0\<^sub>v (dim_row (mat\<^sub>h A)) \<and> mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
vec\<^sub>h v \<in> carrier_vec n
vec\<^sub>h v \<noteq> 0\<^sub>v n
mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v
A \<in> carrier_mat n n

goal (1 subgoal):
 1. vec\<^sub>h v \<in> carrier_vec (dim_row (mat\<^sub>h A)) \<and> vec\<^sub>h v \<noteq> 0\<^sub>v (dim_row (mat\<^sub>h A)) \<and> mat\<^sub>h A *\<^sub>v vec\<^sub>h v = hom ev \<cdot>\<^sub>v vec\<^sub>h v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigenvector (mat\<^sub>h A) (vec\<^sub>h v) (hom ev)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma find_remove_2_strengthening :
  assumes "find_remove_2 P xs ys = Some (x,y,xs')"
  and     "P' x y"
  and     "\<And> x' y' . P' x' y' \<Longrightarrow> P x' y'"
shows "find_remove_2 P' xs ys = Some (x,y,xs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_remove_2 P' xs ys = Some (x, y, xs')
[PROOF STEP]
using assms find_remove_2'_strengthening
[PROOF STATE]
proof (prove)
using this:
find_remove_2 P xs ys = Some (x, y, xs')
P' x y
P' ?x' ?y' \<Longrightarrow> P ?x' ?y'
\<lbrakk>find_remove_2' ?P ?xs ?ys ?prev = Some (?x, ?y, ?xs'); ?P' ?x ?y; \<And>x' y'. ?P' x' y' \<Longrightarrow> ?P x' y'\<rbrakk> \<Longrightarrow> find_remove_2' ?P' ?xs ?ys ?prev = Some (?x, ?y, ?xs')

goal (1 subgoal):
 1. find_remove_2 P' xs ys = Some (x, y, xs')
[PROOF STEP]
by (metis find_remove_2.simps)


[STATEMENT]
lemma recurrent_subset_of_recurrent_subset:
  "recurrent_subset_infty(recurrent_subset_infty A) = recurrent_subset_infty A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. recurrent_subset_infty (recurrent_subset_infty A) = recurrent_subset_infty A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. recurrent_subset_infty (recurrent_subset_infty A) \<subseteq> recurrent_subset_infty A
 2. recurrent_subset_infty A \<subseteq> recurrent_subset_infty (recurrent_subset_infty A)
[PROOF STEP]
show "recurrent_subset_infty (recurrent_subset_infty A) \<subseteq> recurrent_subset_infty A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. recurrent_subset_infty (recurrent_subset_infty A) \<subseteq> recurrent_subset_infty A
[PROOF STEP]
using recurrent_subset_incl(2)[of A] recurrent_subset_rel_incl(2)
[PROOF STATE]
proof (prove)
using this:
recurrent_subset_infty A \<subseteq> A
?A \<subseteq> ?B \<Longrightarrow> recurrent_subset_infty ?A \<subseteq> recurrent_subset_infty ?B

goal (1 subgoal):
 1. recurrent_subset_infty (recurrent_subset_infty A) \<subseteq> recurrent_subset_infty A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
recurrent_subset_infty (recurrent_subset_infty A) \<subseteq> recurrent_subset_infty A

goal (1 subgoal):
 1. recurrent_subset_infty A \<subseteq> recurrent_subset_infty (recurrent_subset_infty A)
[PROOF STEP]
show "recurrent_subset_infty A \<subseteq> recurrent_subset_infty (recurrent_subset_infty A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. recurrent_subset_infty A \<subseteq> recurrent_subset_infty (recurrent_subset_infty A)
[PROOF STEP]
using recurrent_subset_infty_returns recurrent_subset_infty_inf_returns
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> recurrent_subset_infty ?A; (T ^^ ?n) ?x \<in> ?A\<rbrakk> \<Longrightarrow> (T ^^ ?n) ?x \<in> recurrent_subset_infty ?A
(?x \<in> recurrent_subset_infty ?A) = (?x \<in> ?A \<and> infinite {n. (T ^^ n) ?x \<in> ?A})

goal (1 subgoal):
 1. recurrent_subset_infty A \<subseteq> recurrent_subset_infty (recurrent_subset_infty A)
[PROOF STEP]
by (metis (no_types, lifting) Collect_cong subsetI)
[PROOF STATE]
proof (state)
this:
recurrent_subset_infty A \<subseteq> recurrent_subset_infty (recurrent_subset_infty A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(0::real) < x \<and> 0 < y ==> 0 < x + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<and> 0 < y \<Longrightarrow> 0 < x + y
[PROOF STEP]
by arith


[STATEMENT]
lemma (in Ring) ar_c_top: "\<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R\<rbrakk>
       \<Longrightarrow> (c_top (b_ag R) I (a \<uplus>\<^bsub>R\<^esub> I) (b \<uplus>\<^bsub>R\<^esub> I)) = (a \<plusminus> b) \<uplus>\<^bsub>R\<^esub> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> c_top (b_ag R) I (a \<uplus>\<^bsub>R\<^esub> I) (b \<uplus>\<^bsub>R\<^esub> I) = (a \<plusminus> b) \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (cut_tac ring_is_ag, frule ideal_asubg,
       frule aGroup.asubg_nsubg[of "R" "I"], assumption,
       frule aGroup.b_ag_group[of "R"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R; aGroup R; R +> I; b_ag R \<triangleright> I; Group (b_ag R)\<rbrakk> \<Longrightarrow> c_top (b_ag R) I (a \<uplus>\<^bsub>R\<^esub> I) (b \<uplus>\<^bsub>R\<^esub> I) = (a \<plusminus> b) \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (simp add:ar_coset_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R; aGroup R; R +> I; b_ag R \<triangleright> I; Group (b_ag R)\<rbrakk> \<Longrightarrow> c_top (b_ag R) I (I \<bullet>\<^bsub>b_ag R\<^esub> a) (I \<bullet>\<^bsub>b_ag R\<^esub> b) = I \<bullet>\<^bsub>b_ag R\<^esub> (a \<plusminus> b)
[PROOF STEP]
apply (subst Group.c_top_welldef[THEN sym], assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R; aGroup R; R +> I; b_ag R \<triangleright> I; Group (b_ag R)\<rbrakk> \<Longrightarrow> a \<in> carrier (b_ag R)
 2. \<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R; aGroup R; R +> I; b_ag R \<triangleright> I; Group (b_ag R)\<rbrakk> \<Longrightarrow> b \<in> carrier (b_ag R)
 3. \<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R; aGroup R; R +> I; b_ag R \<triangleright> I; Group (b_ag R)\<rbrakk> \<Longrightarrow> I \<bullet>\<^bsub>b_ag R\<^esub> (a \<cdot>\<^bsub>b_ag R\<^esub> b) = I \<bullet>\<^bsub>b_ag R\<^esub> (a \<plusminus> b)
[PROOF STEP]
apply (simp add:aGroup.ag_carrier_carrier)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; a \<in> carrier R; b \<in> carrier R; aGroup R; R +> I; b_ag R \<triangleright> I; Group (b_ag R)\<rbrakk> \<Longrightarrow> I \<bullet>\<^bsub>b_ag R\<^esub> (a \<cdot>\<^bsub>b_ag R\<^esub> b) = I \<bullet>\<^bsub>b_ag R\<^esub> (a \<plusminus> b)
[PROOF STEP]
apply (simp add:aGroup.agop_gop)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sd_distl: "Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
assume a: "Y \<noteq> {}"
[PROOF STATE]
proof (state)
this:
Y \<noteq> {}

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
have "sd_prod x (Sup_prod Y) = sd_prod x ((\<Squnion>y \<in> Y. fst y), (\<Squnion>y \<in> Y. snd y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sd_prod x (Sup_prod Y) = sd_prod x (\<Squnion> (fst ` Y), \<Squnion> (snd ` Y))
[PROOF STEP]
by (simp add: Sup_prod_def)
[PROOF STATE]
proof (state)
this:
sd_prod x (Sup_prod Y) = sd_prod x (\<Squnion> (fst ` Y), \<Squnion> (snd ` Y))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sd_prod x (Sup_prod Y) = sd_prod x (\<Squnion> (fst ` Y), \<Squnion> (snd ` Y))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
have "... = ((fst x) \<cdot> (\<Squnion>y \<in> Y. fst y), (snd x \<squnion> (\<alpha> (fst x) (\<Squnion>y \<in> Y. snd y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sd_prod x (\<Squnion> (fst ` Y), \<Squnion> (snd ` Y)) = (fst x \<cdot> \<Squnion> (fst ` Y), snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y)))
[PROOF STEP]
by (simp add: sd_prod_def)
[PROOF STATE]
proof (state)
this:
sd_prod x (\<Squnion> (fst ` Y), \<Squnion> (snd ` Y)) = (fst x \<cdot> \<Squnion> (fst ` Y), snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y)))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sd_prod x (\<Squnion> (fst ` Y), \<Squnion> (snd ` Y)) = (fst x \<cdot> \<Squnion> (fst ` Y), snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y)))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
have "... = ((\<Squnion>y \<in> Y. fst x \<cdot> fst y), (snd x \<squnion> (\<alpha> (fst x) (\<Squnion>y \<in> Y. snd y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fst x \<cdot> \<Squnion> (fst ` Y), snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y)))
[PROOF STEP]
by (simp add: Sup_distl image_comp)
[PROOF STATE]
proof (state)
this:
(fst x \<cdot> \<Squnion> (fst ` Y), snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y)))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fst x \<cdot> \<Squnion> (fst ` Y), snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y)))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
have "... = ((\<Squnion>y \<in> Y. fst x \<cdot> fst y), (snd x \<squnion> (\<Squnion>y \<in> Y. \<alpha> (fst x) (snd y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> (\<Squnion>y\<in>Y. \<alpha> (fst x) (snd y)))
[PROOF STEP]
by (simp add: act4 image_comp)
[PROOF STATE]
proof (state)
this:
(\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> (\<Squnion>y\<in>Y. \<alpha> (fst x) (snd y)))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (\<Squnion> (snd ` Y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> (\<Squnion>y\<in>Y. \<alpha> (fst x) (snd y)))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
have "... = ((\<Squnion>y \<in> Y. fst x \<cdot> fst y), (\<Squnion>y \<in> Y. snd x \<squnion> (\<alpha> (fst x) (snd y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> (\<Squnion>y\<in>Y. \<alpha> (fst x) (snd y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, \<Squnion>y\<in>Y. snd x \<squnion> \<alpha> (fst x) (snd y))
[PROOF STEP]
using a sd_distl_aux
[PROOF STATE]
proof (prove)
using this:
Y \<noteq> {}
?Y \<noteq> {} \<Longrightarrow> ?p \<squnion> (\<Squnion>y\<in>?Y. \<alpha> ?x (snd y)) = (\<Squnion>y\<in>?Y. ?p \<squnion> \<alpha> ?x (snd y))

goal (1 subgoal):
 1. (\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> (\<Squnion>y\<in>Y. \<alpha> (fst x) (snd y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, \<Squnion>y\<in>Y. snd x \<squnion> \<alpha> (fst x) (snd y))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> (\<Squnion>y\<in>Y. \<alpha> (fst x) (snd y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, \<Squnion>y\<in>Y. snd x \<squnion> \<alpha> (fst x) (snd y))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>y\<in>Y. fst x \<cdot> fst y, snd x \<squnion> (\<Squnion>y\<in>Y. \<alpha> (fst x) (snd y))) = (\<Squnion>y\<in>Y. fst x \<cdot> fst y, \<Squnion>y\<in>Y. snd x \<squnion> \<alpha> (fst x) (snd y))

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
have "... = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> (\<alpha> (fst x) (snd y))) |y. y \<in> Y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>y\<in>Y. fst x \<cdot> fst y, \<Squnion>y\<in>Y. snd x \<squnion> \<alpha> (fst x) (snd y)) = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |y. y \<in> Y}
[PROOF STEP]
apply (unfold Sup_prod_def, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<Squnion>y\<in>Y. fst x \<cdot> fst y) = \<Squnion> (fst ` {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |y. y \<in> Y})
 2. (\<Squnion>y\<in>Y. snd x \<squnion> \<alpha> (fst x) (snd y)) = \<Squnion> (snd ` {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |y. y \<in> Y})
[PROOF STEP]
by ( simp add: SUP_Sup_eq, rule_tac f=Sup in arg_cong, force)+
[PROOF STATE]
proof (state)
this:
(\<Squnion>y\<in>Y. fst x \<cdot> fst y, \<Squnion>y\<in>Y. snd x \<squnion> \<alpha> (fst x) (snd y)) = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |y. y \<in> Y}

goal (1 subgoal):
 1. Y \<noteq> {} \<Longrightarrow> sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sd_prod x (Sup_prod Y) = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |y. y \<in> Y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sd_prod x (Sup_prod Y) = Sup_prod {(fst x \<cdot> fst y, snd x \<squnion> \<alpha> (fst x) (snd y)) |y. y \<in> Y}

goal (1 subgoal):
 1. sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}
[PROOF STEP]
by (simp add: sd_prod_def)
[PROOF STATE]
proof (state)
this:
sd_prod x (Sup_prod Y) = Sup_prod {sd_prod x y |y. y \<in> Y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eqpoll_path_components_Euclidean_complements:
  assumes "closedin (Euclidean_space n) S" "closedin (Euclidean_space n) T"
          "(subtopology (Euclidean_space n) S) homeomorphic_space (subtopology (Euclidean_space n) T)"
 shows "path_components_of
             (subtopology (Euclidean_space n)
                          (topspace(Euclidean_space n) - S))
      \<approx> path_components_of
             (subtopology (Euclidean_space n)
                          (topspace(Euclidean_space n) - T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - S)) \<approx> path_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - T))
[PROOF STEP]
by (simp add: assms isomorphic_homology_groups_Euclidean_complements isomorphic_homology_imp_path_components)


[STATEMENT]
lemma quad_form_congruence [simp]:
  assumes "mat_det M \<noteq> 0"
  shows "quad_form (M *\<^sub>m\<^sub>v z) (congruence (mat_inv M) H) = quad_form z H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quad_form (M *\<^sub>m\<^sub>v z) (congruence (mat_inv M) H) = quad_form z H
[PROOF STEP]
using bilinear_form_congruence[OF assms]
[PROOF STATE]
proof (prove)
using this:
bilinear_form (M *\<^sub>m\<^sub>v ?v1.0) (M *\<^sub>m\<^sub>v ?v2.0) (congruence (mat_inv M) ?H) = bilinear_form ?v1.0 ?v2.0 ?H

goal (1 subgoal):
 1. quad_form (M *\<^sub>m\<^sub>v z) (congruence (mat_inv M) H) = quad_form z H
[PROOF STEP]
by simp


[STATEMENT]
lemma (in ideal) quotient_is_ring: "ring (R Quot I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring (R Quot I)
[PROOF STEP]
proof (rule ringI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. abelian_group (R Quot I)
 2. Group.monoid (R Quot I)
 3. \<And>x y z. \<lbrakk>x \<in> carrier (R Quot I); y \<in> carrier (R Quot I); z \<in> carrier (R Quot I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>R Quot I\<^esub> y) \<otimes>\<^bsub>R Quot I\<^esub> z = x \<otimes>\<^bsub>R Quot I\<^esub> z \<oplus>\<^bsub>R Quot I\<^esub> y \<otimes>\<^bsub>R Quot I\<^esub> z
 4. \<And>x y z. \<lbrakk>x \<in> carrier (R Quot I); y \<in> carrier (R Quot I); z \<in> carrier (R Quot I)\<rbrakk> \<Longrightarrow> z \<otimes>\<^bsub>R Quot I\<^esub> (x \<oplus>\<^bsub>R Quot I\<^esub> y) = z \<otimes>\<^bsub>R Quot I\<^esub> x \<oplus>\<^bsub>R Quot I\<^esub> z \<otimes>\<^bsub>R Quot I\<^esub> y
[PROOF STEP]
show "abelian_group (R Quot I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_group (R Quot I)
[PROOF STEP]
apply (rule comm_group_abelian_groupI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group (add_monoid (R Quot I))
[PROOF STEP]
apply (simp add: FactRing_def a_factorgroup_is_comm_group[unfolded A_FactGroup_def'])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
abelian_group (R Quot I)

goal (3 subgoals):
 1. Group.monoid (R Quot I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (R Quot I); y \<in> carrier (R Quot I); z \<in> carrier (R Quot I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>R Quot I\<^esub> y) \<otimes>\<^bsub>R Quot I\<^esub> z = x \<otimes>\<^bsub>R Quot I\<^esub> z \<oplus>\<^bsub>R Quot I\<^esub> y \<otimes>\<^bsub>R Quot I\<^esub> z
 3. \<And>x y z. \<lbrakk>x \<in> carrier (R Quot I); y \<in> carrier (R Quot I); z \<in> carrier (R Quot I)\<rbrakk> \<Longrightarrow> z \<otimes>\<^bsub>R Quot I\<^esub> (x \<oplus>\<^bsub>R Quot I\<^esub> y) = z \<otimes>\<^bsub>R Quot I\<^esub> x \<oplus>\<^bsub>R Quot I\<^esub> z \<otimes>\<^bsub>R Quot I\<^esub> y
[PROOF STEP]
show "Group.monoid (R Quot I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.monoid (R Quot I)
[PROOF STEP]
by (rule monoidI)
      (auto simp add: FactRing_simps rcoset_mult_add m_assoc)
[PROOF STATE]
proof (state)
this:
Group.monoid (R Quot I)

goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (R Quot I); y \<in> carrier (R Quot I); z \<in> carrier (R Quot I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>R Quot I\<^esub> y) \<otimes>\<^bsub>R Quot I\<^esub> z = x \<otimes>\<^bsub>R Quot I\<^esub> z \<oplus>\<^bsub>R Quot I\<^esub> y \<otimes>\<^bsub>R Quot I\<^esub> z
 2. \<And>x y z. \<lbrakk>x \<in> carrier (R Quot I); y \<in> carrier (R Quot I); z \<in> carrier (R Quot I)\<rbrakk> \<Longrightarrow> z \<otimes>\<^bsub>R Quot I\<^esub> (x \<oplus>\<^bsub>R Quot I\<^esub> y) = z \<otimes>\<^bsub>R Quot I\<^esub> x \<oplus>\<^bsub>R Quot I\<^esub> z \<otimes>\<^bsub>R Quot I\<^esub> y
[PROOF STEP]
qed (auto simp: FactRing_simps rcoset_mult_add a_rcos_sum l_distr r_distr)


[STATEMENT]
lemma tank_arith:
  assumes "0 \<le> (\<tau>::real)" and "0 < c\<^sub>o" and "c\<^sub>o < c\<^sub>i"
  shows "\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> - ((hmin - y) / c\<^sub>o) \<Longrightarrow>  hmin \<le> y - c\<^sub>o * \<tau>"
    and "\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> (hmax - y) / (c\<^sub>i - c\<^sub>o) \<Longrightarrow>  (c\<^sub>i - c\<^sub>o) * \<tau> + y \<le> hmax"
    and "hmin \<le> y \<Longrightarrow> hmin \<le> (c\<^sub>i - c\<^sub>o) * \<tau> + y"
    and "y \<le> hmax \<Longrightarrow> y - c\<^sub>o * \<tau> \<le> hmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> - ((hmin - y) / c\<^sub>o) \<Longrightarrow> hmin \<le> y - c\<^sub>o \<cdot> \<tau>) &&& (\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> (hmax - y) / (c\<^sub>i - c\<^sub>o) \<Longrightarrow> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y \<le> hmax)) &&& (hmin \<le> y \<Longrightarrow> hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y) &&& (y \<le> hmax \<Longrightarrow> y - c\<^sub>o \<cdot> \<tau> \<le> hmax)
[PROOF STEP]
apply(simp_all add: field_simps le_divide_eq assms)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. hmin \<le> y \<Longrightarrow> hmin + \<tau> \<cdot> c\<^sub>o \<le> y + \<tau> \<cdot> c\<^sub>i
 2. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<tau>
0 < c\<^sub>o
c\<^sub>o < c\<^sub>i

goal (2 subgoals):
 1. hmin \<le> y \<Longrightarrow> hmin + \<tau> \<cdot> c\<^sub>o \<le> y + \<tau> \<cdot> c\<^sub>i
 2. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
apply (meson add_mono less_eq_real_def mult_left_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<tau>
0 < c\<^sub>o
c\<^sub>o < c\<^sub>i

goal (1 subgoal):
 1. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
by (meson add_increasing2 less_eq_real_def mult_nonneg_nonneg)


[STATEMENT]
lemma dual_blocks_size_is_rep: "j < length \<B>s* \<Longrightarrow> card (\<B>s* ! j) = \<B> rep (\<V>s ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < length \<B>s* \<Longrightarrow> card (\<B>s* ! j) = \<B> rep \<V>s ! j
[PROOF STEP]
using dual_incidence_mat_eq_trans trans_mat_rep_block_size_sym(2)
[PROOF STATE]
proof (prove)
using this:
ordered_dual_sys.N = N\<^sup>T
?i < dim_row ?M \<Longrightarrow> mat_rep_num ?M ?i = mat_block_size ?M\<^sup>T ?i

goal (1 subgoal):
 1. j < length \<B>s* \<Longrightarrow> card (\<B>s* ! j) = \<B> rep \<V>s ! j
[PROOF STEP]
by (metis dual_blocks_len dual_is_ordered_inc_sys inc_mat_dim_row mat_rep_num_N_row
      ordered_incidence_system.mat_block_size_N_col points_list_length size_mset)


[STATEMENT]
lemma product_topology_empty:
   "product_topology X {} = topology (\<lambda>S. S \<in> {{},{\<lambda>k. undefined}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_topology X {} = topology (\<lambda>S. S \<in> {{}, {\<lambda>k. undefined}})
[PROOF STEP]
unfolding product_topology union_of_def intersection_of_def arbitrary_def relative_to_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topology (\<lambda>S. \<exists>\<U>. True \<and> \<U> \<subseteq> {T. \<exists>U. (\<exists>\<U>. finite \<U> \<and> \<U> \<subseteq> {{f. f i \<in> U} |i U. i \<in> {} \<and> openin (X i) U} \<and> \<Inter> \<U> = U) \<and> (\<Pi>\<^sub>E i\<in>{}. topspace (X i)) \<inter> U = T} \<and> \<Union> \<U> = S) = topology (\<lambda>S. S \<in> {{}, {\<lambda>k. undefined}})
[PROOF STEP]
by (auto intro: arg_cong [where f=topology])


[STATEMENT]
theorem (in Height_Bounded_Labeling) pr_algo_cost_bound:
  assumes A: "((f,l),p,(f',l')) \<in> trcl pr_algo_lts"
  shows "(\<Sum>a\<leftarrow>p. cost_estimate a) \<le> 26 * (card V)^2 * card E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
have "(\<Sum>a\<leftarrow>p. cost_estimate a)
    = card V * length (filter is_RELABEL p) + length (filter is_PUSH p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p)
[PROOF STEP]
proof (induction p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum_list (map cost_estimate []) = card V * length (filter is_RELABEL []) + length (filter is_PUSH [])
 2. \<And>a p. sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p) \<Longrightarrow> sum_list (map cost_estimate (a # p)) = card V * length (filter is_RELABEL (a # p)) + length (filter is_PUSH (a # p))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. sum_list (map cost_estimate []) = card V * length (filter is_RELABEL []) + length (filter is_PUSH [])
 2. \<And>a p. sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p) \<Longrightarrow> sum_list (map cost_estimate (a # p)) = card V * length (filter is_RELABEL (a # p)) + length (filter is_PUSH (a # p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map cost_estimate []) = card V * length (filter is_RELABEL []) + length (filter is_PUSH [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate []) = card V * length (filter is_RELABEL []) + length (filter is_PUSH [])

goal (1 subgoal):
 1. \<And>a p. sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p) \<Longrightarrow> sum_list (map cost_estimate (a # p)) = card V * length (filter is_RELABEL (a # p)) + length (filter is_PUSH (a # p))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p) \<Longrightarrow> sum_list (map cost_estimate (a # p)) = card V * length (filter is_RELABEL (a # p)) + length (filter is_PUSH (a # p))
[PROOF STEP]
case (Cons a p)
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p)

goal (1 subgoal):
 1. \<And>a p. sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p) \<Longrightarrow> sum_list (map cost_estimate (a # p)) = card V * length (filter is_RELABEL (a # p)) + length (filter is_PUSH (a # p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p)

goal (1 subgoal):
 1. sum_list (map cost_estimate (a # p)) = card V * length (filter is_RELABEL (a # p)) + length (filter is_PUSH (a # p))
[PROOF STEP]
by (cases a) auto
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate (a # p)) = card V * length (filter is_RELABEL (a # p)) + length (filter is_PUSH (a # p))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p)

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate p) = card V * length (filter is_RELABEL p) + length (filter is_PUSH p)

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
have "card V * length (filter is_RELABEL p) \<le> 2 * (card V)^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card V * length (filter is_RELABEL p) \<le> 2 * card V ^ 3
[PROOF STEP]
using relabel_action_bound[OF A]
[PROOF STATE]
proof (prove)
using this:
length (filter is_RELABEL p) \<le> 2 * (card V)\<^sup>2

goal (1 subgoal):
 1. card V * length (filter is_RELABEL p) \<le> 2 * card V ^ 3
[PROOF STEP]
by (auto simp: power2_eq_square power3_eq_cube)
[PROOF STATE]
proof (state)
this:
card V * length (filter is_RELABEL p) \<le> 2 * card V ^ 3

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card V * length (filter is_RELABEL p) \<le> 2 * card V ^ 3

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
note push_action_bound[OF A]
[PROOF STATE]
proof (state)
this:
length (filter is_PUSH p) \<le> 22 * (card V)\<^sup>2 * card E

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + length (filter is_PUSH p) \<le> y + length (filter is_PUSH p); \<And>x y. x \<le> y \<Longrightarrow> 2 * card V ^ 3 + x \<le> 2 * card V ^ 3 + y\<rbrakk> \<Longrightarrow> sum_list (map cost_estimate p) \<le> 2 * card V ^ 3 + 22 * (card V)\<^sup>2 * card E
[PROOF STEP]
have "sum_list (map cost_estimate p)
              \<le> 2 * card V ^ 3 + 22 * (card V)\<^sup>2 * card E"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + length (filter is_PUSH p) \<le> y + length (filter is_PUSH p); \<And>x y. x \<le> y \<Longrightarrow> 2 * card V ^ 3 + x \<le> 2 * card V ^ 3 + y\<rbrakk> \<Longrightarrow> sum_list (map cost_estimate p) \<le> 2 * card V ^ 3 + 22 * (card V)\<^sup>2 * card E

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 2 * card V ^ 3 + 22 * (card V)\<^sup>2 * card E
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate p) \<le> 2 * card V ^ 3 + 22 * (card V)\<^sup>2 * card E

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate p) \<le> 2 * card V ^ 3 + 22 * (card V)\<^sup>2 * card E

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
have "(card V)^3 \<le> 2 * (card V)\<^sup>2 * card E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card V ^ 3 \<le> 2 * (card V)\<^sup>2 * card E
[PROOF STEP]
by (simp add: card_V_est_E power2_eq_square power3_eq_cube)
[PROOF STATE]
proof (state)
this:
card V ^ 3 \<le> 2 * (card V)\<^sup>2 * card E

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> 2 * x + 22 * (card V)\<^sup>2 * card E \<le> 2 * y + 22 * (card V)\<^sup>2 * card E) \<Longrightarrow> sum_list (map cost_estimate p) \<le> 2 * (2 * (card V)\<^sup>2 * card E) + 22 * (card V)\<^sup>2 * card E
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> 2 * x + 22 * (card V)\<^sup>2 * card E \<le> 2 * y + 22 * (card V)\<^sup>2 * card E) \<Longrightarrow> sum_list (map cost_estimate p) \<le> 2 * (2 * (card V)\<^sup>2 * card E) + 22 * (card V)\<^sup>2 * card E

goal (1 subgoal):
 1. sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
sum_list (map cost_estimate p) \<le> 26 * (card V)\<^sup>2 * card E

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disj_eq_nota_conv[simp]:
    "(a \<or> b \<longleftrightarrow> \<not>a) \<longleftrightarrow> (a=False \<and> b=True)"
    "(b \<or> a \<longleftrightarrow> \<not>a) \<longleftrightarrow> (a=False \<and> b=True)"
    "(\<not>a \<or> b \<longleftrightarrow> a) \<longleftrightarrow> (a=True \<and> b=True)"
    "(b \<or> \<not>a \<longleftrightarrow> a) \<longleftrightarrow> (a=True \<and> b=True)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((a \<or> b) = (\<not> a)) = (a = False \<and> b = True) &&& ((b \<or> a) = (\<not> a)) = (a = False \<and> b = True)) &&& ((\<not> a \<or> b) = a) = (a = True \<and> b = True) &&& ((b \<or> \<not> a) = a) = (a = True \<and> b = True)
[PROOF STEP]
by auto


[STATEMENT]
lemma Const_mult:
  \<open>Const (a * b) = Const a * Const b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Const (a * b) = Const a * Const b
[PROOF STEP]
by transfer (simp add: Const\<^sub>0_def times_monomial_monomial)


[STATEMENT]
lemma pre_post_compose:
  "-q \<le> -r \<Longrightarrow> -p\<stileturn>-s \<le> (-p\<stileturn>-q)*(-r\<stileturn>-s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - q \<le> - r \<Longrightarrow> - p \<stileturn> - s \<le> (- p \<stileturn> - q) * (- r \<stileturn> - s)
[PROOF STEP]
by (meson pre_compose pre_post_galois pre_post_pre pre_post_right_antitone)


[STATEMENT]
lemma args_to_set_subset3:
  assumes "set ps1 \<subseteq> set ps2"
  shows "args_to_set (gs, bs, ps1) \<subseteq> args_to_set (gs, bs, ps2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. args_to_set (gs, bs, ps1) \<subseteq> args_to_set (gs, bs, ps2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set ps1 \<subseteq> set ps2

goal (1 subgoal):
 1. args_to_set (gs, bs, ps1) \<subseteq> args_to_set (gs, bs, ps2)
[PROOF STEP]
unfolding args_to_set_alt
[PROOF STATE]
proof (prove)
using this:
set ps1 \<subseteq> set ps2

goal (1 subgoal):
 1. fst ` set gs \<union> fst ` set bs \<union> fst ` fst ` set ps1 \<union> fst ` snd ` set ps1 \<subseteq> fst ` set gs \<union> fst ` set bs \<union> fst ` fst ` set ps2 \<union> fst ` snd ` set ps2
[PROOF STEP]
by blast


[STATEMENT]
lemma iMODb_inext_diff_const: "
  \<lbrakk> t \<in> [r, mod m, c]; t < r + m * c \<rbrakk> \<Longrightarrow> inext t [r, mod m, c] - t = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> [ r, mod m, c ]; t < r + m * c\<rbrakk> \<Longrightarrow> inext t [ r, mod m, c ] - t = m
[PROOF STEP]
by (simp add: iMODb_inext)


[STATEMENT]
lemma complex_cnj_zero_iff [iff]: "cnj z = 0 \<longleftrightarrow> z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cnj z = 0) = (z = 0)
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma proj_minus: "proj_poly k (p - q) = proj_poly k p - proj_poly k q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k (p - q) = proj_poly k p - proj_poly k q
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_proj_poly lookup_minus)


[STATEMENT]
lemma subset_Above_Under: "B \<le> Field r \<Longrightarrow> B \<le> Above r (Under r B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> Field r \<Longrightarrow> B \<subseteq> Above r (Under r B)
[PROOF STEP]
by(auto simp add: Above_def Under_def)


[STATEMENT]
lemma iprev_less_mono: "
  \<lbrakk> a < b; a \<in> I; b \<in> I; \<exists>x\<in>I. x < a \<rbrakk> \<Longrightarrow> iprev a I < iprev b I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; a \<in> I; b \<in> I; \<exists>x\<in>I. x < a\<rbrakk> \<Longrightarrow> iprev a I < iprev b I
[PROOF STEP]
apply (rule less_le_trans[of _ a])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a < b; a \<in> I; b \<in> I; \<exists>x\<in>I. x < a\<rbrakk> \<Longrightarrow> iprev a I < a
 2. \<lbrakk>a < b; a \<in> I; b \<in> I; \<exists>x\<in>I. x < a\<rbrakk> \<Longrightarrow> a \<le> iprev b I
[PROOF STEP]
apply (blast intro: iprev_mono2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; a \<in> I; b \<in> I; \<exists>x\<in>I. x < a\<rbrakk> \<Longrightarrow> a \<le> iprev b I
[PROOF STEP]
apply (rule ccontr, simp add: linorder_not_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; a \<in> I; b \<in> I; \<exists>x\<in>I. x < a; iprev b I < a\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (blast dest: iprev_min_step)


[STATEMENT]
lemma word_sless_msb_less: "x <s y \<longleftrightarrow> (msb y \<longrightarrow> msb x) \<and> ((msb x \<and> \<not> msb y) \<or> x < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x <s y) = ((msb y \<longrightarrow> msb x) \<and> (msb x \<and> \<not> msb y \<or> x < y))
[PROOF STEP]
by (auto simp add: word_sless_eq word_sle_msb_le)


[STATEMENT]
lemma sH_whileI: "\<forall>s. P s \<longrightarrow> I s \<Longrightarrow> \<forall>s. I s \<and> \<not> B s \<longrightarrow> Q s \<Longrightarrow> \<^bold>{\<lambda>s. I s \<and> B s\<^bold>} X \<^bold>{I\<^bold>}
  \<Longrightarrow> \<^bold>{P\<^bold>} (WHILE B INV I DO X) \<^bold>{Q\<^bold>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>s. P s \<longrightarrow> I s; \<forall>s. I s \<and> \<not> B s \<longrightarrow> Q s; \<^bold>{\<lambda>s. I s \<and> B s\<^bold>}X\<^bold>{I\<^bold>}\<rbrakk> \<Longrightarrow> \<^bold>{P\<^bold>}WHILE B INV I DO X\<^bold>{Q\<^bold>}
[PROOF STEP]
by (rule H_while_inv, simp_all add: ndfun_kat_H)


[STATEMENT]
lemma (in PolynRg) erH_rHom_0:"\<lbrakk>PolynRg A B Y; h \<in> rHom S B\<rbrakk>  \<Longrightarrow>
                   (erH R S X A B Y h) \<zero> = \<zero>\<^bsub>A\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>PolynRg A B Y; h \<in> rHom S B\<rbrakk> \<Longrightarrow> erH R S X A B Y h \<zero> = \<zero>\<^bsub>A\<^esub>
[PROOF STEP]
apply (cut_tac subring, frule subring_Ring,
       cut_tac PolynRg.is_Ring[of A B Y],
       cut_tac PolynRg.subring[of A B Y],
       cut_tac Ring.subring_Ring[of A B])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A; Subring A B; Ring B\<rbrakk> \<Longrightarrow> erH R S X A B Y h \<zero> = \<zero>\<^bsub>A\<^esub>
 2. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A; Subring A B\<rbrakk> \<Longrightarrow> Ring A
 3. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A; Subring A B\<rbrakk> \<Longrightarrow> Subring A B
 4. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A\<rbrakk> \<Longrightarrow> PolynRg A B Y
 5. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S\<rbrakk> \<Longrightarrow> PolynRg A B Y
[PROOF STEP]
apply (simp add:erH_def erh_def s_cf_def polyn_expr_def)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A; Subring A B; Ring B\<rbrakk> \<Longrightarrow> (\<zero> \<in> carrier R \<longrightarrow> snd (cf_h h (0, \<lambda>j. \<zero>\<^bsub>S\<^esub>)) 0 \<cdot>\<^sub>r\<^bsub>A\<^esub> 1\<^sub>r\<^bsub>A\<^esub> = \<zero>\<^bsub>A\<^esub>) \<and> (\<zero> \<notin> carrier R \<longrightarrow> undefined = \<zero>\<^bsub>A\<^esub>)
 2. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A; Subring A B\<rbrakk> \<Longrightarrow> Ring A
 3. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A; Subring A B\<rbrakk> \<Longrightarrow> Subring A B
 4. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S; Ring A\<rbrakk> \<Longrightarrow> PolynRg A B Y
 5. \<lbrakk>PolynRg A B Y; h \<in> rHom S B; Subring R S; Ring S\<rbrakk> \<Longrightarrow> PolynRg A B Y
[PROOF STEP]
apply (cut_tac ring_zero,
        simp add:cf_h_def cmp_def rHom_0_0,
        simp add:Ring.Subring_zero_ring_zero,
        frule Ring.ring_zero[of A], simp add:Ring.ring_r_one, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma star_subset_lists: "A \<subseteq> lists S \<Longrightarrow> star A \<subseteq> lists S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> lists S \<Longrightarrow> star A \<subseteq> lists S
[PROOF STEP]
unfolding star_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> lists S \<Longrightarrow> \<Union> (range ((^^) A)) \<subseteq> lists S
[PROOF STEP]
by(blast dest: lang_pow_subset_lists)


[STATEMENT]
lemma fmrel_code:
  "fmrel R m n \<longleftrightarrow>
    fBall (fmdom m) (\<lambda>x. rel_option R (fmlookup m x) (fmlookup n x)) \<and>
    fBall (fmdom n) (\<lambda>x. rel_option R (fmlookup m x) (fmlookup n x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel R m n = (fBall (fmdom m) (\<lambda>x. rel_option R (fmlookup m x) (fmlookup n x)) \<and> fBall (fmdom n) (\<lambda>x. rel_option R (fmlookup m x) (fmlookup n x)))
[PROOF STEP]
unfolding fmrel_iff fmlookup_dom_iff fBall_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. rel_option R (fmlookup m x) (fmlookup n x)) = ((\<forall>x. (\<exists>a. fmlookup m x = Some a) \<longrightarrow> rel_option R (fmlookup m x) (fmlookup n x)) \<and> (\<forall>x. (\<exists>a. fmlookup n x = Some a) \<longrightarrow> rel_option R (fmlookup m x) (fmlookup n x)))
[PROOF STEP]
by (metis option.collapse option.rel_sel)


[STATEMENT]
lemma I_ZmX_unitary:
  shows "unitary I_ZmX"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary I_ZmX
[PROOF STEP]
unfolding I_ZmX_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> ZmX)
[PROOF STEP]
using tensor_mat_unitary[of "1\<^sub>m 2" ZmX] ZmX_carrier
    unitary_ZmX
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary (1\<^sub>m 2); Complex_Matrix.unitary ZmX; 0 < dim_row (1\<^sub>m 2); 0 < dim_row ZmX\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> ZmX)
ZmX \<in> carrier_mat 2 2
Complex_Matrix.unitary ZmX

goal (1 subgoal):
 1. Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> ZmX)
[PROOF STEP]
using unitary_one
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary (1\<^sub>m 2); Complex_Matrix.unitary ZmX; 0 < dim_row (1\<^sub>m 2); 0 < dim_row ZmX\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> ZmX)
ZmX \<in> carrier_mat 2 2
Complex_Matrix.unitary ZmX
Complex_Matrix.unitary (1\<^sub>m ?n)

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


[STATEMENT]
lemma geodesic_segment_unique_endpoints:
  assumes "geodesic_segment_between G x y"
          "geodesic_segment_between G a b"
  shows "{x, y} = {a, b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x, y} = {a, b}
[PROOF STEP]
by (metis geodesic_segment_disconnection assms(1) assms(2) doubleton_eq_iff geodesic_segment_endpoints(1) geodesic_segment_endpoints(2))


[STATEMENT]
lemma of_nat_take_bit:
  \<open>of_nat (take_bit n m) = take_bit n (of_nat m)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (take_bit n m) = take_bit n (of_nat m)
[PROOF STEP]
by (rule bit_eqI) (simp add: bit_take_bit_iff Bit_Operations.bit_take_bit_iff bit_of_nat_iff)


[STATEMENT]
lemma subst_poly_0[simp]: "subst_poly \<sigma> 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_poly \<sigma> 0 = 0
[PROOF STEP]
unfolding subst_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>vars 0. coeff 0 x *R \<sigma> x) = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma foldr_disj_map: "Ifm bs (foldr disj (map f xs) F) = (\<exists> x \<in> set xs. Ifm bs (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bs (foldr MIR.disj (map f xs) F) = (\<exists>x\<in>set xs. Ifm bs (f x))
[PROOF STEP]
by(induct xs, simp_all)


[STATEMENT]
lemma Inf_distrib_INF_qual:
  fixes f :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
  assumes qual: "P {d x |x. x \<in> X}"
  assumes f_Inf_distrib: "\<And>c D. P D \<Longrightarrow> f c (\<Sqinter> D) = \<Sqinter> {f c d | d . d \<in> D }"
  shows "f c (\<Sqinter>x\<in>X. d x) = (\<Sqinter>x\<in>X. f c (d x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
have "f c (\<Sqinter>x\<in>X. d x) = f c (\<Sqinter>{d x |x. x \<in> X})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = f c (\<Sqinter> {d x |x::'b. x \<in> X})
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
by (simp add: INF_Inf)
[PROOF STATE]
proof (state)
this:
(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) (\<Sqinter> ((d::'b::type \<Rightarrow> 'a::type) ` (X::'b::type set))) = f c (\<Sqinter> {d x |x::'b::type. x \<in> X})

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) (\<Sqinter> ((d::'b::type \<Rightarrow> 'a::type) ` (X::'b::type set))) = f c (\<Sqinter> {d x |x::'b::type. x \<in> X})

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
have "... = (\<Sqinter>{f c dx |dx. dx \<in> {d x | x. x \<in> X}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f c (\<Sqinter> {d x |x::'b. x \<in> X}) = \<Sqinter> {f c dx |dx::'a. dx \<in> {d x |x::'b. x \<in> X}}
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
by (simp add: qual f_Inf_distrib)
[PROOF STATE]
proof (state)
this:
(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) (\<Sqinter> {(d::'b::type \<Rightarrow> 'a::type) x |x::'b::type. x \<in> (X::'b::type set)}) = \<Sqinter> {f c dx |dx::'a::type. dx \<in> {d x |x::'b::type. x \<in> X}}

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) (\<Sqinter> {(d::'b::type \<Rightarrow> 'a::type) x |x::'b::type. x \<in> (X::'b::type set)}) = \<Sqinter> {f c dx |dx::'a::type. dx \<in> {d x |x::'b::type. x \<in> X}}

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
have "... = (\<Sqinter>{f c (d x) |x. x \<in> X})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {f c dx |dx::'a. dx \<in> {d x |x::'b. x \<in> X}} = \<Sqinter> {f c (d x) |x::'b. x \<in> X}
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
by (simp only: nested_Collect)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) dx |dx::'a::type. dx \<in> {(d::'b::type \<Rightarrow> 'a::type) x |x::'b::type. x \<in> (X::'b::type set)}} = \<Sqinter> {f c (d x) |x::'b::type. x \<in> X}

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sqinter> {(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) dx |dx::'a::type. dx \<in> {(d::'b::type \<Rightarrow> 'a::type) x |x::'b::type. x \<in> (X::'b::type set)}} = \<Sqinter> {f c (d x) |x::'b::type. x \<in> X}

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
have "... = (\<Sqinter>x\<in>X. f c (d x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {f c (d x) |x::'b. x \<in> X} = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
by (simp add: INF_Inf)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) ((d::'b::type \<Rightarrow> 'a::type) x) |x::'b::type. x \<in> (X::'b::type set)} = (\<Sqinter>x::'b::type\<in>X. f c (d x))

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) (\<Sqinter> ((d::'b::type \<Rightarrow> 'a::type) ` (X::'b::type set))) = (\<Sqinter>x::'b::type\<in>X. f c (d x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) (\<Sqinter> ((d::'b::type \<Rightarrow> 'a::type) ` (X::'b::type set))) = (\<Sqinter>x::'b::type\<in>X. f c (d x))

goal (1 subgoal):
 1. f c (\<Sqinter> (d ` X)) = (\<Sqinter>x::'b\<in>X. f c (d x))
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f::'a::type \<Rightarrow> 'a::type \<Rightarrow> 'a::type) (c::'a::type) (\<Sqinter> ((d::'b::type \<Rightarrow> 'a::type) ` (X::'b::type set))) = (\<Sqinter>x::'b::type\<in>X. f c (d x))

goal:
No subgoals!
variables:
X :: 'b set
d :: 'b \<Rightarrow> 'a
Inf :: 'a set \<Rightarrow> 'a
c :: 'a
f :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a, 'b :: type
[PROOF STEP]
qed


[STATEMENT]
lemma hull_Un_left: "P hull (S \<union> T) = P hull (P hull S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P hull (S \<union> T) = P hull (P hull S \<union> T)
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. P hull (S \<union> T) \<subseteq> P hull (P hull S \<union> T)
 2. P hull (P hull S \<union> T) \<subseteq> P hull (S \<union> T)
[PROOF STEP]
apply (simp add: Un_commute hull_mono hull_subset sup.coboundedI2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P hull (P hull S \<union> T) \<subseteq> P hull (S \<union> T)
[PROOF STEP]
by (metis Un_subset_iff hull_hull hull_mono hull_subset)


[STATEMENT]
lemma lang_biderivs: "\<lbrakk>wf n r; wf_word n w1; wf_word n w2\<rbrakk> \<Longrightarrow>
  lang n (biderivs w1 w2 r) = biQuots w1 w2 (lang n r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.wf n r; wf_word n w1; wf_word n w2\<rbrakk> \<Longrightarrow> lang n (biderivs w1 w2 r) = biQuots w1 w2 (lang n r)
[PROOF STEP]
unfolding biderivs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.wf n r; wf_word n w1; wf_word n w2\<rbrakk> \<Longrightarrow> lang n ((rderivs w2 \<circ> lderivs w1) r) = biQuots w1 w2 (lang n r)
[PROOF STEP]
by (auto simp: lang_rderivs lang_lderivs in_lists_conv_set)


[STATEMENT]
lemma card_Nset_im:"f \<in> {j. j \<le> (n::nat)} \<rightarrow> A \<Longrightarrow>
                      (Suc 0) \<le> card (f `{j. j \<le> n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> {j. j \<le> n} \<rightarrow> A \<Longrightarrow> Suc 0 \<le> card (f ` {j. j \<le> n})
[PROOF STEP]
apply (cut_tac image_Nsetn_card_pos[of f n])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {j. j \<le> n} \<rightarrow> A; 0 < card (f ` {i. i \<le> n})\<rbrakk> \<Longrightarrow> Suc 0 \<le> card (f ` {j. j \<le> n})
[PROOF STEP]
apply (frule_tac m = 0 and n = "card (f ` {i. i \<le> n})" in Suc_leI,
        assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done