[STATEMENT]
lemma RSubmodule_RSpan : "set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms)
[PROOF STEP]
proof (induct ms)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> M \<Longrightarrow> RSubmodule (RSpan [])
 2. \<And>a ms. \<lbrakk>set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms); set (a # ms) \<subseteq> M\<rbrakk> \<Longrightarrow> RSubmodule (RSpan (a # ms))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> M

goal (2 subgoals):
 1. set [] \<subseteq> M \<Longrightarrow> RSubmodule (RSpan [])
 2. \<And>a ms. \<lbrakk>set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms); set (a # ms) \<subseteq> M\<rbrakk> \<Longrightarrow> RSubmodule (RSpan (a # ms))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RSubmodule (RSpan [])
[PROOF STEP]
using trivial_RSubmodule
[PROOF STATE]
proof (prove)
using this:
RSubmodule 0

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

goal (1 subgoal):
 1. \<And>a ms. \<lbrakk>set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms); set (a # ms) \<subseteq> M\<rbrakk> \<Longrightarrow> RSubmodule (RSpan (a # ms))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ms. \<lbrakk>set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms); set (a # ms) \<subseteq> M\<rbrakk> \<Longrightarrow> RSubmodule (RSpan (a # ms))
[PROOF STEP]
case (Cons m ms)
[PROOF STATE]
proof (state)
this:
set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms)
set (m # ms) \<subseteq> M

goal (1 subgoal):
 1. \<And>a ms. \<lbrakk>set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms); set (a # ms) \<subseteq> M\<rbrakk> \<Longrightarrow> RSubmodule (RSpan (a # ms))
[PROOF STEP]
hence "RSubmodule (RSpan [m])" "RSubmodule (RSpan ms)"
[PROOF STATE]
proof (prove)
using this:
set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms)
set (m # ms) \<subseteq> M

goal (1 subgoal):
 1. RSubmodule (RSpan [m]) &&& RSubmodule (RSpan ms)
[PROOF STEP]
using RSubmodule_RSpan_single
[PROOF STATE]
proof (prove)
using this:
set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms)
set (m # ms) \<subseteq> M
?m \<in> M \<Longrightarrow> RSubmodule (RSpan [?m])

goal (1 subgoal):
 1. RSubmodule (RSpan [m]) &&& RSubmodule (RSpan ms)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
RSubmodule (RSpan [m])
RSubmodule (RSpan ms)

goal (1 subgoal):
 1. \<And>a ms. \<lbrakk>set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms); set (a # ms) \<subseteq> M\<rbrakk> \<Longrightarrow> RSubmodule (RSpan (a # ms))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
RSubmodule (RSpan [m])
RSubmodule (RSpan ms)

goal (1 subgoal):
 1. RSubmodule (RSpan (m # ms))
[PROOF STEP]
using RSpan_Cons RSubmodule_set_plus
[PROOF STATE]
proof (prove)
using this:
RSubmodule (RSpan [m])
RSubmodule (RSpan ms)
RSpan (?m # ?ms) = RSpan [?m] + RSpan ?ms
\<lbrakk>RSubmodule ?L; RSubmodule ?N\<rbrakk> \<Longrightarrow> RSubmodule (?L + ?N)

goal (1 subgoal):
 1. RSubmodule (RSpan (m # ms))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
RSubmodule (RSpan (m # ms))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in subprob_space) nn_integral_le_const:
  assumes "0 \<le> c" "AE x in M. f x \<le> c"
  shows "(\<integral>\<^sup>+x. f x \<partial>M) \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
have "(\<integral>\<^sup>+ x. f x \<partial>M) \<le> (\<integral>\<^sup>+ x. c \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M f \<le> \<integral>\<^sup>+ x. c \<partial>M
[PROOF STEP]
by(rule nn_integral_mono_AE) fact
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f \<le> \<integral>\<^sup>+ x. c \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f \<le> \<integral>\<^sup>+ x. c \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
have "\<dots> \<le> c * emeasure M (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. c \<partial>M \<le> c * emeasure M (space M)
[PROOF STEP]
using \<open>0 \<le> c\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> c

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. c \<partial>M \<le> c * emeasure M (space M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. c \<partial>M \<le> c * emeasure M (space M)

goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. c \<partial>M \<le> c * emeasure M (space M)

goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
have "\<dots> \<le> c * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * emeasure M (space M) \<le> c * 1
[PROOF STEP]
using emeasure_space_le_1 \<open>0 \<le> c\<close>
[PROOF STATE]
proof (prove)
using this:
emeasure M (space M) \<le> 1
0 \<le> c

goal (1 subgoal):
 1. c * emeasure M (space M) \<le> c * 1
[PROOF STEP]
by(rule mult_left_mono)
[PROOF STATE]
proof (state)
this:
c * emeasure M (space M) \<le> c * 1

goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N M f \<le> c * 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M f \<le> c * 1

goal (1 subgoal):
 1. integral\<^sup>N M f \<le> c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f \<le> c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_subsets_ideal_iff:
  assumes "ideal \<aa> R (+) (\<cdot>) \<zero> \<one>" and "ideal \<bb> R (+) (\<cdot>) \<zero> \<one>"
  shows "\<V> (ideal_gen_by_prod \<aa> \<bb>) = (\<V> \<aa>) \<union> (\<V> \<bb>)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<V> ideal_gen_by_prod \<aa> \<bb> = \<V> \<aa> \<union> \<V> \<bb>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<V> ideal_gen_by_prod \<aa> \<bb> \<subseteq> \<V> \<aa> \<union> \<V> \<bb>
 2. \<V> \<aa> \<union> \<V> \<bb> \<subseteq> \<V> ideal_gen_by_prod \<aa> \<bb>
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<V> ideal_gen_by_prod \<aa> \<bb> \<subseteq> \<V> \<aa> \<union> \<V> \<bb>
[PROOF STEP]
unfolding closed_subsets_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> ideal_gen_by_prod \<aa> \<bb> \<subseteq> I} \<subseteq> {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> \<aa> \<subseteq> I} \<union> {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> \<bb> \<subseteq> I}
[PROOF STEP]
by clarsimp (meson assms ideal_implies_subset ideal_mult_in_subgroup_generated in_mono pr_ideal.absorbent)
[PROOF STATE]
proof (state)
this:
\<V> ideal_gen_by_prod \<aa> \<bb> \<subseteq> \<V> \<aa> \<union> \<V> \<bb>

goal (1 subgoal):
 1. \<V> \<aa> \<union> \<V> \<bb> \<subseteq> \<V> ideal_gen_by_prod \<aa> \<bb>
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<V> \<aa> \<union> \<V> \<bb> \<subseteq> \<V> ideal_gen_by_prod \<aa> \<bb>
[PROOF STEP]
unfolding closed_subsets_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> \<aa> \<subseteq> I} \<union> {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> \<bb> \<subseteq> I} \<subseteq> {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> ideal_gen_by_prod \<aa> \<bb> \<subseteq> I}
[PROOF STEP]
using closed_subsets_ideal_aux [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>pr_ideal R ?x (+) (\<cdot>) \<zero> \<one>; \<aa> \<subseteq> ?x \<or> \<bb> \<subseteq> ?x\<rbrakk> \<Longrightarrow> ideal_gen_by_prod \<aa> \<bb> \<subseteq> ?x

goal (1 subgoal):
 1. {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> \<aa> \<subseteq> I} \<union> {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> \<bb> \<subseteq> I} \<subseteq> {I. pr_ideal R I (+) (\<cdot>) \<zero> \<one> \<and> ideal_gen_by_prod \<aa> \<bb> \<subseteq> I}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<V> \<aa> \<union> \<V> \<bb> \<subseteq> \<V> ideal_gen_by_prod \<aa> \<bb>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma relInvImage_mono:
  "R1 \<subseteq> R2 \<Longrightarrow> relInvImage A R1 f \<subseteq> relInvImage A R2 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> relInvImage A R1 f \<subseteq> relInvImage A R2 f
[PROOF STEP]
unfolding relInvImage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> {(a1, a2) |a1 a2. a1 \<in> A \<and> a2 \<in> A \<and> (f a1, f a2) \<in> R1} \<subseteq> {(a1, a2) |a1 a2. a1 \<in> A \<and> a2 \<in> A \<and> (f a1, f a2) \<in> R2}
[PROOF STEP]
by auto


[STATEMENT]
theorem conjE: "A \<and> B \<Longrightarrow> (A \<Longrightarrow> B \<Longrightarrow> C) \<Longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<and> B; \<lbrakk>A; B\<rbrakk> \<Longrightarrow> C\<rbrakk> \<Longrightarrow> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>A \<and> B; \<lbrakk>A; B\<rbrakk> \<Longrightarrow> C\<rbrakk> \<Longrightarrow> C
[PROOF STEP]
assume "A \<and> B"
[PROOF STATE]
proof (state)
this:
A \<and> B

goal (1 subgoal):
 1. \<lbrakk>A \<and> B; \<lbrakk>A; B\<rbrakk> \<Longrightarrow> C\<rbrakk> \<Longrightarrow> C
[PROOF STEP]
assume r: "A \<Longrightarrow> B \<Longrightarrow> C"
[PROOF STATE]
proof (state)
this:
\<lbrakk>A; B\<rbrakk> \<Longrightarrow> C

goal (1 subgoal):
 1. \<lbrakk>A \<and> B; \<lbrakk>A; B\<rbrakk> \<Longrightarrow> C\<rbrakk> \<Longrightarrow> C
[PROOF STEP]
show C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C
[PROOF STEP]
proof (rule r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A
 2. B
[PROOF STEP]
show A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A
[PROOF STEP]
by (rule conjunct1) fact
[PROOF STATE]
proof (state)
this:
A

goal (1 subgoal):
 1. B
[PROOF STEP]
show B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B
[PROOF STEP]
by (rule conjunct2) fact
[PROOF STATE]
proof (state)
this:
B

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma succ_ran_fin:
  assumes R: "(succi,E) \<in> \<langle>Rv\<rangle>succg_rel"
  assumes "v\<in>Range Rv"
  shows "finite (E``{v})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (E `` {v})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(succi, E) \<in> \<langle>Rv\<rangle>succg_rel
v \<in> Range Rv

goal (1 subgoal):
 1. finite (E `` {v})
[PROOF STEP]
unfolding succg_rel_def br_def E_of_succ_def
[PROOF STATE]
proof (prove)
using this:
(succi, E) \<in> (Rv \<rightarrow> \<langle>Rv\<rangle>list_set_rel) O {(c, a). a = {(u, v). v \<in> c u} \<and> True}
v \<in> Range Rv

goal (1 subgoal):
 1. finite (E `` {v})
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a y. \<lbrakk>(a, v) \<in> Rv; (succi, y) \<in> Rv \<rightarrow> \<langle>Rv\<rangle>list_set_rel; E = {(u, v). v \<in> y u}\<rbrakk> \<Longrightarrow> finite (y v)
[PROOF STEP]
apply (drule (1) fun_relD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a y. \<lbrakk>(a, v) \<in> Rv; E = {(u, v). v \<in> y u}; (succi a, y v) \<in> \<langle>Rv\<rangle>list_set_rel\<rbrakk> \<Longrightarrow> finite (y v)
[PROOF STEP]
using list_set_rel_range[of Rv]
[PROOF STATE]
proof (prove)
using this:
Range (\<langle>Rv\<rangle>list_set_rel) = {S. finite S \<and> S \<subseteq> Range Rv}

goal (1 subgoal):
 1. \<And>a y. \<lbrakk>(a, v) \<in> Rv; E = {(u, v). v \<in> y u}; (succi a, y v) \<in> \<langle>Rv\<rangle>list_set_rel\<rbrakk> \<Longrightarrow> finite (y v)
[PROOF STEP]
by auto


[STATEMENT]
lemma Infinitesimal_mult:
  fixes x y :: "'a::real_normed_algebra star"
  assumes "x \<in> Infinitesimal" "y \<in> Infinitesimal"
  shows "x * y \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y \<in> Infinitesimal
[PROOF STEP]
proof (rule InfinitesimalI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> hnorm (x * y) < r
[PROOF STEP]
show "hnorm (x * y) < r"
    if "r \<in> \<real>" and "0 < r" for r :: "real star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hnorm (x * y) < r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hnorm (x * y) < r
[PROOF STEP]
have "hnorm x < 1" "hnorm y < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hnorm x < 1 &&& hnorm y < r
[PROOF STEP]
using assms that
[PROOF STATE]
proof (prove)
using this:
x \<in> Infinitesimal
y \<in> Infinitesimal
r \<in> \<real>
0 < r

goal (1 subgoal):
 1. hnorm x < 1 &&& hnorm y < r
[PROOF STEP]
by (auto simp add: InfinitesimalD)
[PROOF STATE]
proof (state)
this:
hnorm x < 1
hnorm y < r

goal (1 subgoal):
 1. hnorm (x * y) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hnorm x < 1
hnorm y < r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hnorm x < 1
hnorm y < r

goal (1 subgoal):
 1. hnorm (x * y) < r
[PROOF STEP]
using hnorm_mult_less
[PROOF STATE]
proof (prove)
using this:
hnorm x < 1
hnorm y < r
\<lbrakk>hnorm ?x < ?r; hnorm ?y < ?s\<rbrakk> \<Longrightarrow> hnorm (?x * ?y) < ?r * ?s

goal (1 subgoal):
 1. hnorm (x * y) < r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
hnorm (x * y) < r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?r \<in> \<real>; 0 < ?r\<rbrakk> \<Longrightarrow> hnorm (x * y) < ?r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigoI [intro]:
  assumes "eventually (\<lambda>x. (norm (f x)) \<le> c * (norm (g x))) F"
  shows   "f \<in> O[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
proof (rule landau_o.bigI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?c
 2. \<forall>\<^sub>F x in F. norm (f x) \<le> ?c * norm (g x)
[PROOF STEP]
show "max 1 c > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < max 1 c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < max 1 c

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> max 1 c * norm (g x)
[PROOF STEP]
have "c * (norm (g x)) \<le> max 1 c * (norm (g x))" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * norm (g x) \<le> max 1 c * norm (g x)
[PROOF STEP]
by (simp add: mult_right_mono)
[PROOF STATE]
proof (state)
this:
c * norm (g ?x) \<le> max 1 c * norm (g ?x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> max 1 c * norm (g x)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
c * norm (g ?x) \<le> max 1 c * norm (g ?x)
[PROOF STEP]
show "eventually (\<lambda>x. (norm (f x)) \<le> max 1 c * (norm (g x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
c * norm (g ?x) \<le> max 1 c * norm (g ?x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> max 1 c * norm (g x)
[PROOF STEP]
by (auto elim!: eventually_mono dest: order.trans)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x) \<le> max 1 c * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_hd_drop:
  "n < length xs \<Longrightarrow> take n xs @ [hd (drop n xs)] = take (Suc n) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length xs \<Longrightarrow> take n xs @ [hd (drop n xs)] = take (Suc n) xs
[PROOF STEP]
by (induct xs arbitrary: n) (simp_all add:drop_Cons split:nat.split)


[STATEMENT]
lemma iprev_eq_if_neq_iMin: "
  \<lbrakk> iprev a I = iprev b I; iMin I \<noteq> a; iMin I \<noteq> b \<rbrakk> \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>iprev a I = iprev b I; iMin I \<noteq> a; iMin I \<noteq> b\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (drule arg_cong[where f="\<lambda>x. inext x I"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>iMin I \<noteq> a; iMin I \<noteq> b; inext (iprev a I) I = inext (iprev b I) I\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (simp add: inext_iprev)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma compare_pow_le_iff: "p > 0 \<Longrightarrow> (x :: 'a) \<ge> 0 \<Longrightarrow> y \<ge> 0 \<Longrightarrow> (x ^ p \<le> y ^ p) = (x \<le> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < p; (0::'a) \<le> x; (0::'a) \<le> y\<rbrakk> \<Longrightarrow> (x ^ p \<le> y ^ p) = (x \<le> y)
[PROOF STEP]
by (rule power_mono_iff)


[STATEMENT]
lemma SIod_isom_Iod:"\<lbrakk>Order D; T \<subseteq> carrier D \<rbrakk> \<Longrightarrow>
          ord_isom (SIod D T) (Iod D T) (\<lambda>x\<in>T. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> ord_isom (SIod D T) (Iod D T) (\<lambda>x\<in>T. x)
[PROOF STEP]
apply (simp add:ord_isom_def ord_inj_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> (\<lambda>x\<in>T. x) \<in> extensional (carrier (SIod D T)) \<and> (\<lambda>x\<in>T. x) \<in> carrier (SIod D T) \<rightarrow> carrier (Iod D T) \<and> inj_on (\<lambda>x\<in>T. x) (carrier (SIod D T)) \<and> (\<forall>a\<in>carrier (SIod D T). (a \<in> T \<longrightarrow> (\<forall>b\<in>carrier (SIod D T). (b \<in> T \<longrightarrow> a \<prec>\<^bsub>SIod D T\<^esub> b = a \<prec>\<^bsub>Iod D T\<^esub> b) \<and> (b \<notin> T \<longrightarrow> a \<prec>\<^bsub>SIod D T\<^esub> b = a \<prec>\<^bsub>Iod D T\<^esub> undefined))) \<and> (a \<notin> T \<longrightarrow> (\<forall>b\<in>carrier (SIod D T). (b \<in> T \<longrightarrow> a \<prec>\<^bsub>SIod D T\<^esub> b = undefined \<prec>\<^bsub>Iod D T\<^esub> b) \<and> (b \<notin> T \<longrightarrow> a \<prec>\<^bsub>SIod D T\<^esub> b = undefined \<prec>\<^bsub>Iod D T\<^esub> undefined)))) \<and> surj_to (\<lambda>x\<in>T. x) (carrier (SIod D T)) (carrier (Iod D T))
[PROOF STEP]
apply (simp add:SIod_carrier Order.Iod_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> (\<forall>a\<in>T. \<forall>b\<in>T. a \<prec>\<^bsub>SIod D T\<^esub> b = a \<prec>\<^bsub>Iod D T\<^esub> b) \<and> surj_to (\<lambda>x\<in>T. x) T T
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> \<forall>a\<in>T. \<forall>b\<in>T. a \<prec>\<^bsub>SIod D T\<^esub> b = a \<prec>\<^bsub>Iod D T\<^esub> b
 2. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> surj_to (\<lambda>x\<in>T. x) T T
[PROOF STEP]
apply (fold idmap_def[of T])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> \<forall>a\<in>T. \<forall>b\<in>T. a \<prec>\<^bsub>SIod D T\<^esub> b = a \<prec>\<^bsub>Iod D T\<^esub> b
 2. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> surj_to (idmap T) T T
[PROOF STEP]
apply (simp add:SIod_less Order.Iod_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> surj_to (idmap T) T T
[PROOF STEP]
apply (cut_tac A = T in idmap_bij,
        simp add:bij_to_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma [code abstract]: "Rep_FingerTree (tail t) =
    (if (FingerTreeStruc.isEmpty (Rep_FingerTree t)) then Empty
     else FingerTreeStruc.tail (Rep_FingerTree t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_FingerTree (tail t) = (if FingerTreeStruc.isEmpty (Rep_FingerTree t) then Empty else FingerTreeStruc.tail (Rep_FingerTree t))
[PROOF STEP]
apply (simp add: tail_def FingerTreeStruc.tail_correct FingerTreeStruc.isEmpty_def empty_rep)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_FingerTree t = Empty \<longrightarrow> Rep_FingerTree local.empty = Empty
[PROOF STEP]
apply (auto simp add: empty_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_inf_right [simp]:
  assumes "z \<noteq> 0\<^sub>h"
  shows "z *\<^sub>h \<infinity>\<^sub>h = \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z *\<^sub>h \<infinity>\<^sub>h = \<infinity>\<^sub>h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. z *\<^sub>h \<infinity>\<^sub>h = \<infinity>\<^sub>h
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z za. \<lbrakk>z \<noteq> vec_zero; \<not> z \<approx>\<^sub>v 0\<^sub>v; \<not> za \<approx> 0\<^sub>h\<^sub>c\<rbrakk> \<Longrightarrow> z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v
[PROOF STEP]
fix z :: complex_vec
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z za. \<lbrakk>z \<noteq> vec_zero; \<not> z \<approx>\<^sub>v 0\<^sub>v; \<not> za \<approx> 0\<^sub>h\<^sub>c\<rbrakk> \<Longrightarrow> z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v
[PROOF STEP]
obtain z1 z2 where *: "z = (z1, z2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z1 z2. z = (z1, z2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases z, auto)
[PROOF STATE]
proof (state)
this:
z = (z1, z2)

goal (1 subgoal):
 1. \<And>z za. \<lbrakk>z \<noteq> vec_zero; \<not> z \<approx>\<^sub>v 0\<^sub>v; \<not> za \<approx> 0\<^sub>h\<^sub>c\<rbrakk> \<Longrightarrow> z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v
[PROOF STEP]
assume "z \<noteq> vec_zero" "\<not> (z \<approx>\<^sub>v 0\<^sub>v)"
[PROOF STATE]
proof (state)
this:
z \<noteq> vec_zero
\<not> z \<approx>\<^sub>v 0\<^sub>v

goal (1 subgoal):
 1. \<And>z za. \<lbrakk>z \<noteq> vec_zero; \<not> z \<approx>\<^sub>v 0\<^sub>v; \<not> za \<approx> 0\<^sub>h\<^sub>c\<rbrakk> \<Longrightarrow> z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v
[PROOF STEP]
hence "z1 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero
\<not> z \<approx>\<^sub>v 0\<^sub>v

goal (1 subgoal):
 1. z1 \<noteq> 0
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
z \<noteq> vec_zero
\<not> z \<approx>\<^sub>v 0\<^sub>v
z = (z1, z2)

goal (1 subgoal):
 1. z1 \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
z1 \<noteq> 0

goal (1 subgoal):
 1. \<And>z za. \<lbrakk>z \<noteq> vec_zero; \<not> z \<approx>\<^sub>v 0\<^sub>v; \<not> za \<approx> 0\<^sub>h\<^sub>c\<rbrakk> \<Longrightarrow> z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v
[PROOF STEP]
thus "z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v"
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> 0

goal (1 subgoal):
 1. z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> 0
z = (z1, z2)

goal (1 subgoal):
 1. z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z *\<^sub>v \<infinity>\<^sub>v \<approx>\<^sub>v \<infinity>\<^sub>v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hcomplex_hcnj_inverse: "\<And>z. hcnj (inverse z) = inverse (hcnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. hcnj (inverse z) = inverse (hcnj z)
[PROOF STEP]
by transfer (rule complex_cnj_inverse)


[STATEMENT]
lemma has_integral_divide:
  fixes c :: "_ :: real_normed_div_algebra"
  shows "(f has_integral y) S \<Longrightarrow> ((\<lambda>x. f x / c) has_integral (y / c)) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) S \<Longrightarrow> ((\<lambda>x. f x / c) has_integral y / c) S
[PROOF STEP]
unfolding divide_inverse
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) S \<Longrightarrow> ((\<lambda>x. f x * inverse c) has_integral y * inverse c) S
[PROOF STEP]
by (simp add: has_integral_mult_left)


[STATEMENT]
lemma iT_Minus_Minus_eq: "\<lbrakk> finite I; Max I \<le> k \<rbrakk> \<Longrightarrow> k \<ominus> (k \<ominus> I) = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; Max I \<le> k\<rbrakk> \<Longrightarrow> k \<ominus> (k \<ominus> I) = I
[PROOF STEP]
apply (simp add: iT_Minus_cut_eq[of k k I, symmetric] iT_Minus_Minus_cut_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; Max I \<le> k\<rbrakk> \<Longrightarrow> I \<down>\<le> k = I
[PROOF STEP]
apply (simp add: cut_le_Max_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in carrier) adh_closure_iff:
  "\<lbrakk> A \<subseteq> carrier; x \<in> carrier \<rbrakk> \<Longrightarrow> (x adh A) = (x \<in> closure A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> carrier; x \<in> carrier\<rbrakk> \<Longrightarrow> (x adh A) = (x \<in> closure A)
[PROOF STEP]
by (auto dest: adh_imp_closure closure_imp_adh)


[STATEMENT]
lemma gtrp2gtr:
  "((s,c),w,(s',c'))\<in>trcl (gtrp T)
  \<Longrightarrow> (add_mset s c,map le_rem_s w,add_mset s' c')\<in>trcl (gtr T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((s, c), w, s', c') \<in> trcl (gtrp T) \<Longrightarrow> (add_mset s c, map le_rem_s w, add_mset s' c') \<in> trcl (gtr T)
[PROOF STEP]
by (induct rule: trcl_pair_induct) (auto dest: gtrp2gtr_s)


[STATEMENT]
lemma lin_indpt_list_nonzero:
  assumes "lin_indpt_list G"
  shows "0\<^sub>v n \<notin> set G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v n \<notin> set G
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0\<^sub>v n \<notin> set G
[PROOF STEP]
from assms[unfolded lin_indpt_list_def]
[PROOF STATE]
proof (chain)
picking this:
set G \<subseteq> carrier_vec n \<and> distinct G \<and> lin_indpt (set G)
[PROOF STEP]
have "lin_indpt (set G)"
[PROOF STATE]
proof (prove)
using this:
set G \<subseteq> carrier_vec n \<and> distinct G \<and> lin_indpt (set G)

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

goal (1 subgoal):
 1. 0\<^sub>v n \<notin> set G
[PROOF STEP]
from vs_zero_lin_dep[OF _ this] assms[unfolded lin_indpt_list_def]
[PROOF STATE]
proof (chain)
picking this:
set G \<subseteq> carrier_vec n \<Longrightarrow> 0\<^sub>v n \<notin> set G
set G \<subseteq> carrier_vec n \<and> distinct G \<and> lin_indpt (set G)
[PROOF STEP]
show zero: "0\<^sub>v n \<notin> set G"
[PROOF STATE]
proof (prove)
using this:
set G \<subseteq> carrier_vec n \<Longrightarrow> 0\<^sub>v n \<notin> set G
set G \<subseteq> carrier_vec n \<and> distinct G \<and> lin_indpt (set G)

goal (1 subgoal):
 1. 0\<^sub>v n \<notin> set G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v n \<notin> set G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma square_free_iff_separable_GFp: assumes "degree f < CARD('a)"
  shows "square_free (f :: 'a :: prime_card mod_ring poly) = separable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_free f = separable f
[PROOF STEP]
using separable_imp_square_free[of f] square_free_separable_GFp[OF assms]
[PROOF STATE]
proof (prove)
using this:
separable f \<Longrightarrow> square_free f
square_free f \<Longrightarrow> separable f

goal (1 subgoal):
 1. square_free f = separable f
[PROOF STEP]
by auto


[STATEMENT]
lemma simply_connected_eq_homotopic_circlemaps2b:
  fixes S :: "'a::real_normed_vector set"
  assumes "\<And>f g::complex \<Rightarrow> 'a.
                \<lbrakk>continuous_on (sphere 0 1) f; f ` (sphere 0 1) \<subseteq> S;
                continuous_on (sphere 0 1) g; g ` (sphere 0 1) \<subseteq> S\<rbrakk>
                \<Longrightarrow> homotopic_with_canon (\<lambda>h. True) (sphere 0 1) S f g"
  shows "path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected S
[PROOF STEP]
proof (clarsimp simp add: path_connected_eq_homotopic_points)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> homotopic_loops S (linepath a a) (linepath b b)
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> homotopic_loops S (linepath a a) (linepath b b)
[PROOF STEP]
assume "a \<in> S" "b \<in> S"
[PROOF STATE]
proof (state)
this:
a \<in> S
b \<in> S

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> homotopic_loops S (linepath a a) (linepath b b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> S
b \<in> S
[PROOF STEP]
show "homotopic_loops S (linepath a a) (linepath b b)"
[PROOF STATE]
proof (prove)
using this:
a \<in> S
b \<in> S

goal (1 subgoal):
 1. homotopic_loops S (linepath a a) (linepath b b)
[PROOF STEP]
using homotopic_circlemaps_imp_homotopic_loops [OF assms [of "\<lambda>x. a" "\<lambda>x. b"]]
[PROOF STATE]
proof (prove)
using this:
a \<in> S
b \<in> S
\<lbrakk>continuous_on (sphere 0 1) (\<lambda>x. a); (\<lambda>x. a) ` sphere 0 1 \<subseteq> S; continuous_on (sphere 0 1) (\<lambda>x. b); (\<lambda>x. b) ` sphere 0 1 \<subseteq> S\<rbrakk> \<Longrightarrow> homotopic_loops S ((\<lambda>x. a) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) ((\<lambda>x. b) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))

goal (1 subgoal):
 1. homotopic_loops S (linepath a a) (linepath b b)
[PROOF STEP]
by (auto simp: o_def linepath_def)
[PROOF STATE]
proof (state)
this:
homotopic_loops S (linepath a a) (linepath b b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma graph_homo_union_id:
assumes "graph_homomorphism (graph_union A B) G f"
shows "graph A \<Longrightarrow> graph_homomorphism A G (Id_on (vertices A) O f)"
      "graph B \<Longrightarrow> graph_homomorphism B G (Id_on (vertices B) O f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (graph A \<Longrightarrow> graph_homomorphism A G (Id_on (vertices A) O f)) &&& (graph B \<Longrightarrow> graph_homomorphism B G (Id_on (vertices B) O f))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
graph_homomorphism (graph_union A B) G f

goal (1 subgoal):
 1. (graph A \<Longrightarrow> graph_homomorphism A G (Id_on (vertices A) O f)) &&& (graph B \<Longrightarrow> graph_homomorphism B G (Id_on (vertices B) O f))
[PROOF STEP]
unfolding graph_homomorphism_def edge_preserving
[PROOF STATE]
proof (prove)
using this:
vertices (graph_union A B) = Domain f \<and> graph (graph_union A B) \<and> graph G \<and> f `` vertices (graph_union A B) \<subseteq> vertices G \<and> univalent f \<and> on_triple f `` edges (graph_union A B) \<subseteq> edges G

goal (1 subgoal):
 1. (graph A \<Longrightarrow> vertices A = Domain (Id_on (vertices A) O f) \<and> graph A \<and> graph G \<and> (Id_on (vertices A) O f) `` vertices A \<subseteq> vertices G \<and> univalent (Id_on (vertices A) O f) \<and> on_triple (Id_on (vertices A) O f) `` edges A \<subseteq> edges G) &&& (graph B \<Longrightarrow> vertices B = Domain (Id_on (vertices B) O f) \<and> graph B \<and> graph G \<and> (Id_on (vertices B) O f) `` vertices B \<subseteq> vertices G \<and> univalent (Id_on (vertices B) O f) \<and> on_triple (Id_on (vertices B) O f) `` edges B \<subseteq> edges G)
[PROOF STEP]
by (auto dest:edge_preserving_atomic)


[STATEMENT]
lemma word_less_two_pow_divI:
  "\<lbrakk> (x :: 'a::len word) < 2 ^ (n - m); m \<le> n; n < LENGTH('a) \<rbrakk> \<Longrightarrow> x < 2 ^ n div 2 ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> x < 2 ^ n div 2 ^ m
[PROOF STEP]
apply (simp add: word_less_nat_alt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> unat x < unat (2 ^ n div 2 ^ m)
[PROOF STEP]
apply (subst unat_word_ariths)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> unat x < unat (2 ^ n) div unat (2 ^ m) mod 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst mod_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ n) div unat (2 ^ m) < 2 ^ LENGTH('a)
 2. \<lbrakk>unat x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> unat x < unat (2 ^ n) div unat (2 ^ m)
[PROOF STEP]
apply (rule order_le_less_trans [OF div_le_dividend])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ n) < 2 ^ LENGTH('a)
 2. \<lbrakk>unat x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> unat x < unat (2 ^ n) div unat (2 ^ m)
[PROOF STEP]
apply (rule unat_lt2p)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat x < 2 ^ (n - m); m \<le> n; n < LENGTH('a)\<rbrakk> \<Longrightarrow> unat x < unat (2 ^ n) div unat (2 ^ m)
[PROOF STEP]
apply (simp add: power_sub)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma k_nh_finite: "finite (k_neighborhood w v k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (k_neighborhood w v k)
[PROOF STEP]
unfolding k_neighborhood_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ({u \<in> verts G. \<mu> w v u \<le> ereal k} - {v})
[PROOF STEP]
using finite_verts
[PROOF STATE]
proof (prove)
using this:
finite (verts G)

goal (1 subgoal):
 1. finite ({u \<in> verts G. \<mu> w v u \<le> ereal k} - {v})
[PROOF STEP]
by force


[STATEMENT]
lemma setdist_compact_closed:
  fixes A :: "'a::heine_borel set"
  assumes A: "compact A" and B: "closed B"
    and "A \<noteq> {}" "B \<noteq> {}"
  shows "\<exists>x \<in> A. \<exists>y \<in> B. dist x y = setdist A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B
[PROOF STEP]
obtain x where "x \<in> A" "setdist A B = infdist x B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> A; setdist A B = infdist x B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis A assms(3) setdist_attains_inf setdist_sym)
[PROOF STATE]
proof (state)
this:
x \<in> A
setdist A B = infdist x B

goal (1 subgoal):
 1. \<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> A
setdist A B = infdist x B

goal (1 subgoal):
 1. \<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B
[PROOF STEP]
obtain y where"y \<in> B" "infdist x B = dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> B; infdist x B = dist x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using B \<open>B \<noteq> {}\<close> infdist_attains_inf
[PROOF STATE]
proof (prove)
using this:
closed B
B \<noteq> {}
\<lbrakk>closed ?X; ?X \<noteq> {}; \<And>x. \<lbrakk>x \<in> ?X; infdist ?y ?X = dist ?y x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> B; infdist x B = dist x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> B
infdist x B = dist x y

goal (1 subgoal):
 1. \<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
setdist A B = infdist x B
y \<in> B
infdist x B = dist x y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> A
setdist A B = infdist x B
y \<in> B
infdist x B = dist x y

goal (1 subgoal):
 1. \<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B
[PROOF STEP]
using \<open>x \<in> A\<close> \<open>y \<in> B\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> A
setdist A B = infdist x B
y \<in> B
infdist x B = dist x y
x \<in> A
y \<in> B

goal (1 subgoal):
 1. \<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>A. \<exists>y\<in>B. dist x y = setdist A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nrcons_list: "toList (nrcons t a) = (toList t) @ (nodeToList a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toList (nrcons t a) = toList t @ nodeToList a
[PROOF STEP]
apply (induct t a arbitrary: a rule: nrcons.induct)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>a aa. toList (nrcons Empty aa) = toList Empty @ nodeToList aa
 2. \<And>b a aa. toList (nrcons (Single b) aa) = toList (Single b) @ nodeToList aa
 3. \<And>uu_ pr m b a aa. toList (nrcons (Deep uu_ pr m (One b)) aa) = toList (Deep uu_ pr m (One b)) @ nodeToList aa
 4. \<And>uv_ pr m b c a aa. toList (nrcons (Deep uv_ pr m (Two b c)) aa) = toList (Deep uv_ pr m (Two b c)) @ nodeToList aa
 5. \<And>uw_ pr m b c d a aa. toList (nrcons (Deep uw_ pr m (Three b c d)) aa) = toList (Deep uw_ pr m (Three b c d)) @ nodeToList aa
 6. \<And>ux_ pr m b c d e a aa. (\<And>a. toList (nrcons m a) = toList m @ nodeToList a) \<Longrightarrow> toList (nrcons (Deep ux_ pr m (Four b c d e)) aa) = toList (Deep ux_ pr m (Four b c d e)) @ nodeToList aa
[PROOF STEP]
apply (auto simp add: deep_def toList_def node3_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sym_mod_range: "y > 0 \<Longrightarrow> x symmod y \<in> {- ((y - 1) div 2) .. y div 2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < y \<Longrightarrow> x symmod y \<in> {- ((y - 1) div 2)..y div 2}
[PROOF STEP]
unfolding sym_mod_def poly_mod.inv_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < y \<Longrightarrow> (if x mod y + x mod y \<le> y then x mod y else x mod y - y) \<in> {- ((y - 1) div 2)..y div 2}
[PROOF STEP]
using pos_mod_bound[of y x]
[PROOF STATE]
proof (prove)
using this:
0 < y \<Longrightarrow> x mod y < y

goal (1 subgoal):
 1. 0 < y \<Longrightarrow> (if x mod y + x mod y \<le> y then x mod y else x mod y - y) \<in> {- ((y - 1) div 2)..y div 2}
[PROOF STEP]
by (cases "x mod y \<ge> y", auto)
    (smt (verit) Euclidean_Division.pos_mod_bound Euclidean_Division.pos_mod_sign half_nonnegative_int_iff)+


[STATEMENT]
lemma prod_cancel_nat:
  \<comment> \<open>Contributed by Manuel Eberl\<close>
  fixes f::"'a \<Rightarrow> nat"
  assumes "B \<subseteq> A" and "finite A" and "\<forall>x\<in>B. f x \<noteq> 0"
  shows "prod f A / prod f B = prod f (A - B)" (is "?A / ?B = ?C")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (prod f A) / real (prod f B) = real (prod f (A - B))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (prod f A) / real (prod f B) = real (prod f (A - B))
[PROOF STEP]
from prod.subset_diff[OF assms(1,2)]
[PROOF STATE]
proof (chain)
picking this:
prod ?g A = prod ?g (A - B) * prod ?g B
[PROOF STEP]
have "?A = ?C * ?B"
[PROOF STATE]
proof (prove)
using this:
prod ?g A = prod ?g (A - B) * prod ?g B

goal (1 subgoal):
 1. real (prod f A) = real (prod f (A - B)) * real (prod f B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (prod f A) = real (prod f (A - B)) * real (prod f B)

goal (1 subgoal):
 1. real (prod f A) / real (prod f B) = real (prod f (A - B))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real (prod f A) = real (prod f (A - B)) * real (prod f B)

goal (1 subgoal):
 1. real (prod f A) / real (prod f B) = real (prod f (A - B))
[PROOF STEP]
have "?B \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (prod f B) \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> A
finite A
\<forall>x\<in>B. f x \<noteq> 0

goal (1 subgoal):
 1. real (prod f B) \<noteq> 0
[PROOF STEP]
by (simp add: finite_subset)
[PROOF STATE]
proof (state)
this:
real (prod f B) \<noteq> 0

goal (1 subgoal):
 1. real (prod f A) / real (prod f B) = real (prod f (A - B))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real (prod f A) = real (prod f (A - B)) * real (prod f B)
real (prod f B) \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (prod f A) = real (prod f (A - B)) * real (prod f B)
real (prod f B) \<noteq> 0

goal (1 subgoal):
 1. real (prod f A) / real (prod f B) = real (prod f (A - B))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (prod f A) / real (prod f B) = real (prod f (A - B))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rvars_pivot_eq:
  "\<lbrakk>x\<^sub>j \<in> rvars_eq eq; lhs eq \<notin> rvars_eq eq \<rbrakk> \<Longrightarrow> rvars_eq (pivot_eq eq x\<^sub>j) = {lhs eq} \<union> (rvars_eq eq - {x\<^sub>j})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x\<^sub>j \<in> rvars_eq eq; lhs eq \<notin> rvars_eq eq\<rbrakk> \<Longrightarrow> rvars_eq (pivot_eq eq x\<^sub>j) = {lhs eq} \<union> (rvars_eq eq - {x\<^sub>j})
[PROOF STEP]
using vars_pivot_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x\<^sub>j \<in> rvars_eq ?eq; lhs ?eq \<notin> rvars_eq ?eq\<rbrakk> \<Longrightarrow> let eq' = pivot_eq ?eq ?x\<^sub>j in lhs eq' = ?x\<^sub>j \<and> rvars_eq eq' = {lhs ?eq} \<union> (rvars_eq ?eq - {?x\<^sub>j})

goal (1 subgoal):
 1. \<lbrakk>x\<^sub>j \<in> rvars_eq eq; lhs eq \<notin> rvars_eq eq\<rbrakk> \<Longrightarrow> rvars_eq (pivot_eq eq x\<^sub>j) = {lhs eq} \<union> (rvars_eq eq - {x\<^sub>j})
[PROOF STEP]
by (simp add: Let_def)


[STATEMENT]
lemma (in prob_space) joint_distribution_Times_le_fst:
  "random_variable MX X \<Longrightarrow> random_variable MY Y \<Longrightarrow> A \<in> sets MX \<Longrightarrow> B \<in> sets MY
    \<Longrightarrow> emeasure (distr M (MX \<Otimes>\<^sub>M MY) (\<lambda>x. (X x, Y x))) (A \<times> B) \<le> emeasure (distr M MX X) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>random_variable MX X; random_variable MY Y; A \<in> sets MX; B \<in> sets MY\<rbrakk> \<Longrightarrow> emeasure (distr M (MX \<Otimes>\<^sub>M MY) (\<lambda>x. (X x, Y x))) (A \<times> B) \<le> emeasure (distr M MX X) A
[PROOF STEP]
by (auto simp: emeasure_distr measurable_pair_iff comp_def intro!: emeasure_mono measurable_sets)


[STATEMENT]
lemma "(\<forall>x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z) \<longrightarrow>
       (\<forall>x y z. Q x y \<longrightarrow> Q y z \<longrightarrow> Q x z) \<longrightarrow>
       (\<forall>x y. Q x y \<longrightarrow> Q y x) \<longrightarrow>  (\<forall>x y. P x y \<or> Q x y) \<longrightarrow>
       (\<forall>x y. P x y) \<or> (\<forall>x y. Q x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z) \<longrightarrow> (\<forall>x y z. Q x y \<longrightarrow> Q y z \<longrightarrow> Q x z) \<longrightarrow> (\<forall>x y. Q x y \<longrightarrow> Q y x) \<longrightarrow> (\<forall>x y. P x y \<or> Q x y) \<longrightarrow> (\<forall>x y. P x y) \<or> (\<forall>x y. Q x y)
[PROOF STEP]
by meson


[STATEMENT]
lemma is_even_4[simp]: "(4::nat) * n mod 2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_even (4 * n)
[PROOF STEP]
apply(arith)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem (in conservative) disjoint_sets_measure_density_one_tendsto_zero:
  fixes P::"'a measure" and A::"nat \<Rightarrow> 'a set"
  assumes [measurable]: "\<And>n. A n \<in> sets M"
      and "disjoint_family A"
          "absolutely_continuous M P" "sets P = sets M"
          "emeasure P (space M) \<noteq> \<infinity>"
  shows "\<exists>B. lower_asymptotic_density B = 1 \<and> (\<lambda>n. measure P (space M \<inter> (T^^n)-`(A n)) * indicator B n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B. lower_asymptotic_density B = 1 \<and> (\<lambda>n. Sigma_Algebra.measure P (space M \<inter> (T ^^ n) -` A n) * indicat_real B n) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule cesaro_imp_density_one[OF _ disjoint_sets_measure_Cesaro_tendsto_zero[OF assms]], simp)


[STATEMENT]
lemma swap_continuous:
  assumes "continuous_on (cbox (a,c) (b,d)) (\<lambda>(x,y). f x y)"
    shows "continuous_on (cbox (c,a) (d,b)) (\<lambda>(x, y). f y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox (c, a) (d, b)) (\<lambda>(x, y). f y x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on (cbox (c, a) (d, b)) (\<lambda>(x, y). f y x)
[PROOF STEP]
have "(\<lambda>(x, y). f y x) = (\<lambda>(x, y). f x y) \<circ> prod.swap"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). f y x) = (\<lambda>(x, y). f x y) \<circ> prod.swap
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>(x, y). f y x) = (\<lambda>(x, y). f x y) \<circ> prod.swap

goal (1 subgoal):
 1. continuous_on (cbox (c, a) (d, b)) (\<lambda>(x, y). f y x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>(x, y). f y x) = (\<lambda>(x, y). f x y) \<circ> prod.swap
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f y x) = (\<lambda>(x, y). f x y) \<circ> prod.swap

goal (1 subgoal):
 1. continuous_on (cbox (c, a) (d, b)) (\<lambda>(x, y). f y x)
[PROOF STEP]
apply (rule ssubst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox (c, a) (d, b)) ((\<lambda>(x, y). f x y) \<circ> prod.swap)
[PROOF STEP]
apply (rule continuous_on_compose)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on (cbox (c, a) (d, b)) prod.swap
 2. continuous_on (prod.swap ` cbox (c, a) (d, b)) (\<lambda>(x, y). f x y)
[PROOF STEP]
apply (simp add: split_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on (cbox (c, a) (d, b)) prod.swap
 2. continuous_on (prod.swap ` cbox (c, a) (d, b)) (\<lambda>(x, y). f x y)
[PROOF STEP]
apply (rule continuous_intros | simp add: assms)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
continuous_on (cbox (c, a) (d, b)) (\<lambda>(x, y). f y x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem heap_first_el:
  assumes
    "is_heap cmp heap l r"
    "transp cmp"
    "l < x" "x < r"
  shows "cmp (heap l) (heap x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmp (heap l) (heap x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_heap cmp heap l r
transp cmp
l < x
x < r

goal (1 subgoal):
 1. cmp (heap l) (heap x)
[PROOF STEP]
unfolding is_partial_heap_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x)
transp cmp
l < x
x < r

goal (1 subgoal):
 1. cmp (heap l) (heap x)
[PROOF STEP]
proof(induction x rule: strong_int_gr_induct[of l])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l < x
 2. \<And>i. \<lbrakk>l < i; \<And>j. \<lbrakk>l < j; j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < j; j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap j); \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < i; i < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. l < x
 2. \<And>i. \<lbrakk>l < i; \<And>j. \<lbrakk>l < j; j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < j; j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap j); \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < i; i < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l < x
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
l < x

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

goal (1 subgoal):
 1. \<And>i. \<lbrakk>l < i; \<And>j. \<lbrakk>l < j; j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < j; j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap j); \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < i; i < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>l < i; \<And>j. \<lbrakk>l < j; j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < j; j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap j); \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < i; i < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
case (2 i)
[PROOF STATE]
proof (state)
this:
l < i
\<lbrakk>l < ?j; ?j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < ?j; ?j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap ?j)
\<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x)
transp cmp
l < i
i < r

goal (1 subgoal):
 1. \<And>i. \<lbrakk>l < i; \<And>j. \<lbrakk>l < j; j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < j; j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap j); \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < i; i < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
have cmp_pi_i: "cmp (heap (parent l i)) (heap i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmp (heap (parent l i)) (heap i)
[PROOF STEP]
using "2.hyps" "2.prems"(1,4) parent_bounds
[PROOF STATE]
proof (prove)
using this:
l < i
\<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x)
i < r
\<lbrakk>?l < ?x; ?x < ?r\<rbrakk> \<Longrightarrow> bounded ?l ?r (parent ?l ?x)

goal (1 subgoal):
 1. cmp (heap (parent l i)) (heap i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmp (heap (parent l i)) (heap i)

goal (1 subgoal):
 1. \<And>i. \<lbrakk>l < i; \<And>j. \<lbrakk>l < j; j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < j; j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap j); \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < i; i < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmp (heap (parent l i)) (heap i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
cmp (heap (parent l i)) (heap i)

goal (1 subgoal):
 1. cmp (heap l) (heap i)
[PROOF STEP]
proof(cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>cmp (heap (parent l i)) (heap i); ?P1\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
 2. \<lbrakk>cmp (heap (parent l i)) (heap i); \<not> ?P1\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
assume "parent l i > l"
[PROOF STATE]
proof (state)
this:
l < parent l i

goal (2 subgoals):
 1. \<lbrakk>cmp (heap (parent l i)) (heap i); ?P1\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
 2. \<lbrakk>cmp (heap (parent l i)) (heap i); \<not> ?P1\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l < parent l i
[PROOF STEP]
have "cmp (heap l) (heap (parent l i))"
[PROOF STATE]
proof (prove)
using this:
l < parent l i

goal (1 subgoal):
 1. cmp (heap l) (heap (parent l i))
[PROOF STEP]
using "2.IH" "2.prems"(1,2,4) parent_upper_bound_alt
[PROOF STATE]
proof (prove)
using this:
l < parent l i
\<lbrakk>l < ?j; ?j < i; \<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x); transp cmp; l < ?j; ?j < r\<rbrakk> \<Longrightarrow> cmp (heap l) (heap ?j)
\<forall>x. bounded l r x \<longrightarrow> bounded l r (parent l x) \<longrightarrow> cmp (heap (parent l x)) (heap x)
transp cmp
i < r
?l \<le> parent ?l ?c \<Longrightarrow> parent ?l ?c < ?c

goal (1 subgoal):
 1. cmp (heap l) (heap (parent l i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmp (heap l) (heap (parent l i))

goal (2 subgoals):
 1. \<lbrakk>cmp (heap (parent l i)) (heap i); ?P1\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
 2. \<lbrakk>cmp (heap (parent l i)) (heap i); \<not> ?P1\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmp (heap l) (heap (parent l i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmp (heap l) (heap (parent l i))

goal (1 subgoal):
 1. cmp (heap l) (heap i)
[PROOF STEP]
using "2.prems"(2) cmp_pi_i transpE
[PROOF STATE]
proof (prove)
using this:
cmp (heap l) (heap (parent l i))
transp cmp
cmp (heap (parent l i)) (heap i)
\<lbrakk>transp ?r; ?r ?x ?y; ?r ?y ?z; ?r ?x ?z \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. cmp (heap l) (heap i)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
cmp (heap l) (heap i)

goal (1 subgoal):
 1. \<lbrakk>cmp (heap (parent l i)) (heap i); \<not> l < parent l i\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>cmp (heap (parent l i)) (heap i); \<not> l < parent l i\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
assume "\<not> parent l i > l"
[PROOF STATE]
proof (state)
this:
\<not> l < parent l i

goal (1 subgoal):
 1. \<lbrakk>cmp (heap (parent l i)) (heap i); \<not> l < parent l i\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> l < parent l i
[PROOF STEP]
have "parent l i = l"
[PROOF STATE]
proof (prove)
using this:
\<not> l < parent l i

goal (1 subgoal):
 1. parent l i = l
[PROOF STEP]
using "2.hyps" dual_order.order_iff_strict parent_lower_bound
[PROOF STATE]
proof (prove)
using this:
\<not> l < parent l i
l < i
(?b \<le> ?a) = (?b < ?a \<or> ?a = ?b)
(?l \<le> parent ?l ?c) = (?l < ?c)

goal (1 subgoal):
 1. parent l i = l
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
parent l i = l

goal (1 subgoal):
 1. \<lbrakk>cmp (heap (parent l i)) (heap i); \<not> l < parent l i\<rbrakk> \<Longrightarrow> cmp (heap l) (heap i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
parent l i = l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
parent l i = l

goal (1 subgoal):
 1. cmp (heap l) (heap i)
[PROOF STEP]
using cmp_pi_i
[PROOF STATE]
proof (prove)
using this:
parent l i = l
cmp (heap (parent l i)) (heap i)

goal (1 subgoal):
 1. cmp (heap l) (heap i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmp (heap l) (heap i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmp (heap l) (heap i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma group_homI[intro]:
  assumes range: "h ` (carrier g1) \<subseteq> carrier g2"
      and hom: "\<forall>x\<in>carrier g1. \<forall>y\<in>carrier g1. h (x \<otimes>\<^bsub>g1\<^esub> y) = h x \<otimes>\<^bsub>g2\<^esub> h y"
  shows "h \<in> hom g1 g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> hom g1 g2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h \<in> hom g1 g2
[PROOF STEP]
have "h \<in> carrier g1 \<rightarrow> carrier g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> carrier g1 \<rightarrow> carrier g2
[PROOF STEP]
using range
[PROOF STATE]
proof (prove)
using this:
h ` carrier g1 \<subseteq> carrier g2

goal (1 subgoal):
 1. h \<in> carrier g1 \<rightarrow> carrier g2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> carrier g1 \<rightarrow> carrier g2

goal (1 subgoal):
 1. h \<in> hom g1 g2
[PROOF STEP]
thus "h \<in> hom g1 g2"
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier g1 \<rightarrow> carrier g2

goal (1 subgoal):
 1. h \<in> hom g1 g2
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier g1 \<rightarrow> carrier g2
\<forall>x\<in>carrier g1. \<forall>y\<in>carrier g1. h (x \<otimes>\<^bsub>g1\<^esub> y) = h x \<otimes>\<^bsub>g2\<^esub> h y

goal (1 subgoal):
 1. h \<in> hom g1 g2
[PROOF STEP]
unfolding hom_def
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier g1 \<rightarrow> carrier g2
\<forall>x\<in>carrier g1. \<forall>y\<in>carrier g1. h (x \<otimes>\<^bsub>g1\<^esub> y) = h x \<otimes>\<^bsub>g2\<^esub> h y

goal (1 subgoal):
 1. h \<in> {h \<in> carrier g1 \<rightarrow> carrier g2. \<forall>x\<in>carrier g1. \<forall>y\<in>carrier g1. h (x \<otimes>\<^bsub>g1\<^esub> y) = h x \<otimes>\<^bsub>g2\<^esub> h y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> hom g1 g2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_combine:
  fixes f :: "real \<Rightarrow> 'a::banach"
  assumes "a \<le> c"
    and "c \<le> b"
    and ab: "f integrable_on {a..b}"
  shows "integral {a..c} f + integral {c..b} f = integral {a..b} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..c} f + integral {c..b} f = integral {a..b} f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral {a..c} f + integral {c..b} f = integral {a..b} f
[PROOF STEP]
have "(f has_integral integral {a..c} f) {a..c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral integral {a..c} f) {a..c}
[PROOF STEP]
using ab \<open>c \<le> b\<close> integrable_subinterval_real
[PROOF STATE]
proof (prove)
using this:
f integrable_on {a..b}
c \<le> b
\<lbrakk>?f integrable_on {?a..?b}; {?c..?d} \<subseteq> {?a..?b}\<rbrakk> \<Longrightarrow> ?f integrable_on {?c..?d}

goal (1 subgoal):
 1. (f has_integral integral {a..c} f) {a..c}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(f has_integral integral {a..c} f) {a..c}

goal (1 subgoal):
 1. integral {a..c} f + integral {c..b} f = integral {a..b} f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(f has_integral integral {a..c} f) {a..c}

goal (1 subgoal):
 1. integral {a..c} f + integral {c..b} f = integral {a..b} f
[PROOF STEP]
have "(f has_integral integral {c..b} f) {c..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral integral {c..b} f) {c..b}
[PROOF STEP]
using ab \<open>a \<le> c\<close> integrable_subinterval_real
[PROOF STATE]
proof (prove)
using this:
f integrable_on {a..b}
a \<le> c
\<lbrakk>?f integrable_on {?a..?b}; {?c..?d} \<subseteq> {?a..?b}\<rbrakk> \<Longrightarrow> ?f integrable_on {?c..?d}

goal (1 subgoal):
 1. (f has_integral integral {c..b} f) {c..b}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(f has_integral integral {c..b} f) {c..b}

goal (1 subgoal):
 1. integral {a..c} f + integral {c..b} f = integral {a..b} f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(f has_integral integral {a..c} f) {a..c}
(f has_integral integral {c..b} f) {c..b}
[PROOF STEP]
have "(f has_integral integral {a..c} f + integral {c..b} f) {a..b}"
[PROOF STATE]
proof (prove)
using this:
(f has_integral integral {a..c} f) {a..c}
(f has_integral integral {c..b} f) {c..b}

goal (1 subgoal):
 1. (f has_integral integral {a..c} f + integral {c..b} f) {a..b}
[PROOF STEP]
using \<open>a \<le> c\<close> \<open>c \<le> b\<close> has_integral_combine
[PROOF STATE]
proof (prove)
using this:
(f has_integral integral {a..c} f) {a..c}
(f has_integral integral {c..b} f) {c..b}
a \<le> c
c \<le> b
\<lbrakk>?a \<le> ?c; ?c \<le> ?b; (?f has_integral ?i) {?a..?c}; (?f has_integral ?j) {?c..?b}\<rbrakk> \<Longrightarrow> (?f has_integral ?i + ?j) {?a..?b}

goal (1 subgoal):
 1. (f has_integral integral {a..c} f + integral {c..b} f) {a..b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(f has_integral integral {a..c} f + integral {c..b} f) {a..b}

goal (1 subgoal):
 1. integral {a..c} f + integral {c..b} f = integral {a..b} f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f has_integral integral {a..c} f + integral {c..b} f) {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f has_integral integral {a..c} f + integral {c..b} f) {a..b}

goal (1 subgoal):
 1. integral {a..c} f + integral {c..b} f = integral {a..b} f
[PROOF STEP]
by (simp add: has_integral_integrable_integral)
[PROOF STATE]
proof (state)
this:
integral {a..c} f + integral {c..b} f = integral {a..b} f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma formula_signs_cases: "!!P.
  [| !! p vs . P (FAtom Pos p vs);
  !! p vs . P (FAtom Neg p vs);
  !! f1 f2  . P (FConj Pos f1 f2);
  !! f1 f2  . P (FConj Neg f1 f2);
  !! f1    . P (FAll  Pos f1);
  !! f1    . P (FAll  Neg f1) |]
  ==> P A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. \<lbrakk>\<And>p vs. P (FAtom Pos p vs); \<And>p vs. P (FAtom Neg p vs); \<And>f1 f2. P (FConj Pos f1 f2); \<And>f1 f2. P (FConj Neg f1 f2); \<And>f1. P (FAll Pos f1); \<And>f1. P (FAll Neg f1)\<rbrakk> \<Longrightarrow> P A
[PROOF STEP]
apply(induct_tac A)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>P x1 x2 x3. \<lbrakk>\<And>p vs. P (FAtom Pos p vs); \<And>p vs. P (FAtom Neg p vs); \<And>f1 f2. P (FConj Pos f1 f2); \<And>f1 f2. P (FConj Neg f1 f2); \<And>f1. P (FAll Pos f1); \<And>f1. P (FAll Neg f1)\<rbrakk> \<Longrightarrow> P (FAtom x1 x2 x3)
 2. \<And>P x1 x2 x3. \<lbrakk>\<And>p vs. P (FAtom Pos p vs); \<And>p vs. P (FAtom Neg p vs); \<And>f1 f2. P (FConj Pos f1 f2); \<And>f1 f2. P (FConj Neg f1 f2); \<And>f1. P (FAll Pos f1); \<And>f1. P (FAll Neg f1); P x2; P x3\<rbrakk> \<Longrightarrow> P (FConj x1 x2 x3)
 3. \<And>P x1 x2. \<lbrakk>\<And>p vs. P (FAtom Pos p vs); \<And>p vs. P (FAtom Neg p vs); \<And>f1 f2. P (FConj Pos f1 f2); \<And>f1 f2. P (FConj Neg f1 f2); \<And>f1. P (FAll Pos f1); \<And>f1. P (FAll Neg f1); P x2\<rbrakk> \<Longrightarrow> P (FAll x1 x2)
[PROOF STEP]
apply(rule signs.induct, force, force)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done

    \<comment> \<open>induction using nat induction, not wellfounded induction\<close>


[STATEMENT]
lemma aux_abs_int: fixes c :: int
  assumes "c \<noteq> 0"
  shows "\<bar>x\<bar> \<le> \<bar>x * c\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>x * c\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>x * c\<bar>
[PROOF STEP]
have "abs x = abs x * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> = \<bar>x\<bar> * 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = \<bar>x\<bar> * 1

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>x * c\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> = \<bar>x\<bar> * 1

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>x * c\<bar>
[PROOF STEP]
have "\<dots> \<le> abs x * abs c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> * 1 \<le> \<bar>x\<bar> * \<bar>c\<bar>
[PROOF STEP]
by (rule mult_left_mono, insert assms, auto)
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> * 1 \<le> \<bar>x\<bar> * \<bar>c\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>x * c\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> \<le> \<bar>x\<bar> * \<bar>c\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> \<le> \<bar>x\<bar> * \<bar>c\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>x * c\<bar>
[PROOF STEP]
unfolding abs_mult
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> \<le> \<bar>x\<bar> * \<bar>c\<bar>

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> \<bar>x\<bar> * \<bar>c\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<le> \<bar>x * c\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma N_less_N_1:
  assumes "n \<noteq> 1" "n \<noteq> -1"
  shows   "N n < N 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N n < N 1
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> N n < N 1
 2. n \<noteq> 0 \<Longrightarrow> N n < N 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> N n < N 1
 2. n \<noteq> 0 \<Longrightarrow> N n < N 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
obtain p where p: "prime p" "p dvd n"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; p dvd n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using prime_divisor_exists[of n] assms
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
\<lbrakk>n \<noteq> 0; \<not> is_unit n\<rbrakk> \<Longrightarrow> \<exists>b. b dvd n \<and> prime b
n \<noteq> 1
n \<noteq> - 1

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; p dvd n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
prime p
p dvd n

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> N n < N 1
 2. n \<noteq> 0 \<Longrightarrow> N n < N 1
[PROOF STEP]
hence "N n \<le> N p"
[PROOF STATE]
proof (prove)
using this:
prime p
p dvd n

goal (1 subgoal):
 1. N n \<le> N p
[PROOF STEP]
by (intro N_dvd_mono)
[PROOF STATE]
proof (state)
this:
N n \<le> N p

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> N n < N 1
 2. n \<noteq> 0 \<Longrightarrow> N n < N 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
N n \<le> N p

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> N n < N 1
 2. n \<noteq> 0 \<Longrightarrow> N n < N 1
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
prime p
p dvd n
[PROOF STEP]
have "N p < N 1"
[PROOF STATE]
proof (prove)
using this:
prime p
p dvd n

goal (1 subgoal):
 1. N p < N 1
[PROOF STEP]
using q_gt_1
[PROOF STATE]
proof (prove)
using this:
prime p
p dvd n
1 < q

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

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> N n < N 1
 2. n \<noteq> 0 \<Longrightarrow> N n < N 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
N n < N 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
N n < N 1

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

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> N n < N 1
[PROOF STEP]
qed (use q_gt_1 in \<open>auto simp: N_1\<close>)


[STATEMENT]
lemma reduced_labelling:
  shows "reduced n x \<le> n"
    and "\<forall>i<reduced n x. x i = 0"
    and "reduced n x = n \<or> x (reduced n x) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduced n x \<le> n &&& \<forall>i<reduced n x. x i = 0 &&& reduced n x = n \<or> x (reduced n x) \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. reduced n x \<le> n
 2. \<forall>i<reduced n x. x i = 0
 3. reduced n x = n \<or> x (reduced n x) \<noteq> 0
[PROOF STEP]
show "reduced n x \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduced n x \<le> n
[PROOF STEP]
unfolding reduced_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST k. k = n \<or> x k \<noteq> 0) \<le> n
[PROOF STEP]
by (rule LeastI2_wellorder[where a=n]) auto
[PROOF STATE]
proof (state)
this:
reduced n x \<le> n

goal (2 subgoals):
 1. \<forall>i<reduced n x. x i = 0
 2. reduced n x = n \<or> x (reduced n x) \<noteq> 0
[PROOF STEP]
show "\<forall>i<reduced n x. x i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<reduced n x. x i = 0
[PROOF STEP]
unfolding reduced_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<LEAST k. k = n \<or> x k \<noteq> 0. x i = 0
[PROOF STEP]
by (rule LeastI2_wellorder[where a=n]) fastforce+
[PROOF STATE]
proof (state)
this:
\<forall>i<reduced n x. x i = 0

goal (1 subgoal):
 1. reduced n x = n \<or> x (reduced n x) \<noteq> 0
[PROOF STEP]
show "reduced n x = n \<or> x (reduced n x) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduced n x = n \<or> x (reduced n x) \<noteq> 0
[PROOF STEP]
unfolding reduced_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST k. k = n \<or> x k \<noteq> 0) = n \<or> x (LEAST k. k = n \<or> x k \<noteq> 0) \<noteq> 0
[PROOF STEP]
by (rule LeastI2_wellorder[where a=n]) fastforce+
[PROOF STATE]
proof (state)
this:
reduced n x = n \<or> x (reduced n x) \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_list_Cons_nth: "sorted_list (x # xs) \<Longrightarrow> j < length xs \<Longrightarrow> x \<le> xs ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted_list (x # xs); j < length xs\<rbrakk> \<Longrightarrow> x \<le> xs ! j
[PROOF STEP]
by (induction "x # xs" arbitrary: x xs j rule: sorted_list.induct)
     (fastforce simp: nth_Cons split: nat.splits)+


[STATEMENT]
lemma Field_cardSuc_not_empty:
assumes "Card_order r"
shows "Field (cardSuc r) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field (cardSuc r) \<noteq> {}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Field (cardSuc r) = {} \<Longrightarrow> False
[PROOF STEP]
assume "Field(cardSuc r) = {}"
[PROOF STATE]
proof (state)
this:
Field (cardSuc r) = {}

goal (1 subgoal):
 1. Field (cardSuc r) = {} \<Longrightarrow> False
[PROOF STEP]
hence "|Field(cardSuc r)| \<le>o r"
[PROOF STATE]
proof (prove)
using this:
Field (cardSuc r) = {}

goal (1 subgoal):
 1. |Field (cardSuc r)| \<le>o r
[PROOF STEP]
using assms Card_order_empty[of r]
[PROOF STATE]
proof (prove)
using this:
Field (cardSuc r) = {}
Card_order r
Card_order r \<Longrightarrow> |{}| \<le>o r

goal (1 subgoal):
 1. |Field (cardSuc r)| \<le>o r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
|Field (cardSuc r)| \<le>o r

goal (1 subgoal):
 1. Field (cardSuc r) = {} \<Longrightarrow> False
[PROOF STEP]
hence "cardSuc r \<le>o r"
[PROOF STATE]
proof (prove)
using this:
|Field (cardSuc r)| \<le>o r

goal (1 subgoal):
 1. cardSuc r \<le>o r
[PROOF STEP]
using assms card_of_Field_ordIso
  cardSuc_Card_order ordIso_symmetric ordIso_ordLeq_trans
[PROOF STATE]
proof (prove)
using this:
|Field (cardSuc r)| \<le>o r
Card_order r
Card_order ?r \<Longrightarrow> |Field ?r| =o ?r
Card_order ?r \<Longrightarrow> Card_order (cardSuc ?r)
?r =o ?r' \<Longrightarrow> ?r' =o ?r
\<lbrakk>?r =o ?r'; ?r' \<le>o ?r''\<rbrakk> \<Longrightarrow> ?r \<le>o ?r''

goal (1 subgoal):
 1. cardSuc r \<le>o r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cardSuc r \<le>o r

goal (1 subgoal):
 1. Field (cardSuc r) = {} \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
cardSuc r \<le>o r

goal (1 subgoal):
 1. False
[PROOF STEP]
using cardSuc_greater not_ordLess_ordLeq assms
[PROOF STATE]
proof (prove)
using this:
cardSuc r \<le>o r
Card_order ?r \<Longrightarrow> ?r <o cardSuc ?r
?r <o ?r' \<Longrightarrow> (?r', ?r) \<notin> ordLeq
Card_order r

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma onorm_Sup_on_ball':
  includes notation_norm
  assumes \<open>r > 0\<close> and \<open>\<tau> < 1\<close>
  shows \<open>\<exists>\<xi>\<in>ball x r.  \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
text \<open>
  In the proof of Banach-Steinhaus theorem, we will use this variation of the
  lemma @{text onorm_Sup_on_ball}.

  Explanation: Let \<^term>\<open>f\<close> be a bounded operator, let \<^term>\<open>x\<close> be a point and let \<^term>\<open>r\<close> be a
  positive real number. For any real number \<^term>\<open>\<tau> < 1\<close>, there is a point \<^term>\<open>\<xi>\<close> in the open ball
  of radius \<^term>\<open>r\<close> around \<^term>\<open>x\<close> such that \<^term>\<open>\<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>\<close>.
\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
proof(cases  \<open>f = 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f = 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
 2. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f = 0

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
 2. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f = 0

goal (1 subgoal):
 1. \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
by (metis assms(1) centre_in_ball mult_zero_right norm_zero order_refl
        zero_blinfun.rep_eq)
[PROOF STATE]
proof (state)
this:
\<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<noteq> 0

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
have bdd_above_1: \<open>bdd_above ((\<lambda>t. \<parallel>(*\<^sub>v) f t\<parallel>) ` ball x r)\<close> for f::\<open>'a \<Rightarrow>\<^sub>L 'b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above ((\<lambda>t. \<parallel>f *\<^sub>v t\<parallel>) ` ball x r)
[PROOF STEP]
using assms(1) bounded_linear_image
[PROOF STATE]
proof (prove)
using this:
0 < r
\<lbrakk>bounded ?S; bounded_linear ?f\<rbrakk> \<Longrightarrow> bounded (?f ` ?S)

goal (1 subgoal):
 1. bdd_above ((\<lambda>t. \<parallel>f *\<^sub>v t\<parallel>) ` ball x r)
[PROOF STEP]
by (simp add: bounded_linear_image
        blinfun.bounded_linear_right bounded_imp_bdd_above bounded_norm_comp)
[PROOF STATE]
proof (state)
this:
bdd_above ((\<lambda>t. \<parallel>?f *\<^sub>v t\<parallel>) ` ball x r)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
have  \<open>norm f > 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<parallel>f\<parallel>
[PROOF STEP]
using \<open>f \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0

goal (1 subgoal):
 1. 0 < \<parallel>f\<parallel>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < \<parallel>f\<parallel>

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
have \<open>norm f \<le>  Sup ( (\<lambda>\<xi>.  \<parallel>(*\<^sub>v) f \<xi>\<parallel>) ` (ball x r) ) / r\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>) / r
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>) / r
[PROOF STEP]
by (simp add: onorm_Sup_on_ball)
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>) / r

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
hence \<open>r * norm f \<le>  Sup ( (\<lambda>\<xi>.  \<parallel>(*\<^sub>v) f \<xi>\<parallel>) ` (ball x r) )\<close>
[PROOF STATE]
proof (prove)
using this:
\<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>) / r

goal (1 subgoal):
 1. r * \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>)
[PROOF STEP]
using \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
\<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>) / r
0 < r

goal (1 subgoal):
 1. r * \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>)
[PROOF STEP]
by (smt divide_strict_right_mono nonzero_mult_div_cancel_left)
[PROOF STATE]
proof (state)
this:
r * \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
r * \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
have \<open>\<tau> * r * norm f < r * norm f\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> * r * \<parallel>f\<parallel> < r * \<parallel>f\<parallel>
[PROOF STEP]
using  \<open>\<tau> < 1\<close>
[PROOF STATE]
proof (prove)
using this:
\<tau> < 1

goal (1 subgoal):
 1. \<tau> * r * \<parallel>f\<parallel> < r * \<parallel>f\<parallel>
[PROOF STEP]
using \<open>0 < norm f\<close> \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
\<tau> < 1
0 < \<parallel>f\<parallel>
0 < r

goal (1 subgoal):
 1. \<tau> * r * \<parallel>f\<parallel> < r * \<parallel>f\<parallel>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<tau> * r * \<parallel>f\<parallel> < r * \<parallel>f\<parallel>

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
r * \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>)
\<tau> * r * \<parallel>f\<parallel> < r * \<parallel>f\<parallel>
[PROOF STEP]
have \<open>\<tau> * r * norm f < Sup ( (norm \<circ> ((*\<^sub>v) f)) ` (ball x r) )\<close>
[PROOF STATE]
proof (prove)
using this:
r * \<parallel>f\<parallel> \<le> (SUP \<xi>\<in>ball x r. \<parallel>f *\<^sub>v \<xi>\<parallel>)
\<tau> * r * \<parallel>f\<parallel> < r * \<parallel>f\<parallel>

goal (1 subgoal):
 1. \<tau> * r * \<parallel>f\<parallel> < Sup ((norm \<circ> (*\<^sub>v) f) ` ball x r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<tau> * r * \<parallel>f\<parallel> < Sup ((norm \<circ> (*\<^sub>v) f) ` ball x r)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<tau> * r * \<parallel>f\<parallel> < Sup ((norm \<circ> (*\<^sub>v) f) ` ball x r)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
have \<open>(norm \<circ> ( (*\<^sub>v) f)) ` (ball x r) \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm \<circ> (*\<^sub>v) f) ` ball x r \<noteq> {}
[PROOF STEP]
using \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. (norm \<circ> (*\<^sub>v) f) ` ball x r \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(norm \<circ> (*\<^sub>v) f) ` ball x r \<noteq> {}

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(norm \<circ> (*\<^sub>v) f) ` ball x r \<noteq> {}

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
have \<open>bdd_above ((norm \<circ> ( (*\<^sub>v) f)) ` (ball x r))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above ((norm \<circ> (*\<^sub>v) f) ` ball x r)
[PROOF STEP]
using bdd_above_1
[PROOF STATE]
proof (prove)
using this:
bdd_above ((\<lambda>t. \<parallel>?f *\<^sub>v t\<parallel>) ` ball x r)

goal (1 subgoal):
 1. bdd_above ((norm \<circ> (*\<^sub>v) f) ` ball x r)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x r f. \<lbrakk>\<And>f. bounded_linear f \<Longrightarrow> bdd_above ((\<lambda>t. \<parallel>f t\<parallel>) ` ball x r); bounded_linear f\<rbrakk> \<Longrightarrow> bdd_above ((norm \<circ> f) ` ball x r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bdd_above ((norm \<circ> (*\<^sub>v) f) ` ball x r)

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<tau> * r * \<parallel>f\<parallel> < Sup ((norm \<circ> (*\<^sub>v) f) ` ball x r)
(norm \<circ> (*\<^sub>v) f) ` ball x r \<noteq> {}
bdd_above ((norm \<circ> (*\<^sub>v) f) ` ball x r)
[PROOF STEP]
have \<open>\<exists>t \<in> (norm \<circ> ( (*\<^sub>v) f)) ` (ball x r). \<tau> * r * norm f < t\<close>
[PROOF STATE]
proof (prove)
using this:
\<tau> * r * \<parallel>f\<parallel> < Sup ((norm \<circ> (*\<^sub>v) f) ` ball x r)
(norm \<circ> (*\<^sub>v) f) ` ball x r \<noteq> {}
bdd_above ((norm \<circ> (*\<^sub>v) f) ` ball x r)

goal (1 subgoal):
 1. \<exists>t\<in>(norm \<circ> (*\<^sub>v) f) ` ball x r. \<tau> * r * \<parallel>f\<parallel> < t
[PROOF STEP]
by (simp add: less_cSup_iff)
[PROOF STATE]
proof (state)
this:
\<exists>t\<in>(norm \<circ> (*\<^sub>v) f) ` ball x r. \<tau> * r * \<parallel>f\<parallel> < t

goal (1 subgoal):
 1. f \<noteq> 0 \<Longrightarrow> \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>t\<in>(norm \<circ> (*\<^sub>v) f) ` ball x r. \<tau> * r * \<parallel>f\<parallel> < t

goal (1 subgoal):
 1. \<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>
[PROOF STEP]
by (smt comp_def image_iff)
[PROOF STATE]
proof (state)
this:
\<exists>\<xi>\<in>ball x r. \<tau> * r * \<parallel>f\<parallel> \<le> \<parallel>f *\<^sub>v \<xi>\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_preserves_midpoint :
  assumes "A A' ReflectL X Y" and
    "B B' ReflectL X Y" and
    "C C' ReflectL X Y" and
    "A Midpoint B C"
  shows "A' Midpoint B' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' Midpoint B' C'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A' Midpoint B' C'
[PROOF STEP]
have P1: "Bet B' A' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bet B' A' C'
[PROOF STEP]
using image_preserves_bet
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A ?A' ReflectL ?X ?Y; ?B ?B' ReflectL ?X ?Y; ?C ?C' ReflectL ?X ?Y; Bet ?A ?B ?C\<rbrakk> \<Longrightarrow> Bet ?A' ?B' ?C'

goal (1 subgoal):
 1. Bet B' A' C'
[PROOF STEP]
using assms(1) assms(2) assms(3) assms(4) midpoint_bet
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A ?A' ReflectL ?X ?Y; ?B ?B' ReflectL ?X ?Y; ?C ?C' ReflectL ?X ?Y; Bet ?A ?B ?C\<rbrakk> \<Longrightarrow> Bet ?A' ?B' ?C'
A A' ReflectL X Y
B B' ReflectL X Y
C C' ReflectL X Y
A Midpoint B C
?B Midpoint ?A ?C \<Longrightarrow> Bet ?A ?B ?C

goal (1 subgoal):
 1. Bet B' A' C'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Bet B' A' C'

goal (1 subgoal):
 1. A' Midpoint B' C'
[PROOF STEP]
have "Cong B' A' A' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong B' A' A' C'
[PROOF STEP]
by (metis Cong_perm Tarski_neutral_dimensionless.l10_10_spec Tarski_neutral_dimensionless.l7_13 Tarski_neutral_dimensionless_axioms assms(1) assms(2) assms(3) assms(4) cong_transitivity l7_3_2)
[PROOF STATE]
proof (state)
this:
Cong B' A' A' C'

goal (1 subgoal):
 1. A' Midpoint B' C'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Cong B' A' A' C'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Cong B' A' A' C'

goal (1 subgoal):
 1. A' Midpoint B' C'
[PROOF STEP]
by (simp add: Midpoint_def P1)
[PROOF STATE]
proof (state)
this:
A' Midpoint B' C'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inner_prod_eq:
  fixes i::"'a::finite"
  shows "(\<lambda>(v::'a Rvec). v \<bullet> axis i 1) = (\<lambda>(v::'a Rvec). v $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. v \<bullet> axis i 1) = (\<lambda>v. v $ i)
[PROOF STEP]
unfolding cart_eq_inner_axis axis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. v \<bullet> (\<chi>ia. if ia = i then 1 else 0)) = (\<lambda>v. v \<bullet> (\<chi>ia. if ia = i then 1 else 0))
[PROOF STEP]
by (simp add: eq_commute)


[STATEMENT]
lemma eventually_ln_at_top: "eventually (\<lambda>x. P (ln x :: real)) at_top = eventually P at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in at_top. P (ln x)) = eventually P at_top
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
assume "eventually (\<lambda>x. P (ln x :: real)) at_top"
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. P (ln x)

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
obtain x0 where x0: "\<And>x. x \<ge> x0 \<Longrightarrow> P (ln x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. P (ln x)

goal (1 subgoal):
 1. (\<And>x0. (\<And>x. x0 \<le> x \<Longrightarrow> P (ln x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (subst (asm) eventually_at_top_linorder) auto
[PROOF STATE]
proof (state)
this:
x0 \<le> ?x \<Longrightarrow> P (ln ?x)

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
x0 \<le> ?x \<Longrightarrow> P (ln ?x)

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
assume "x \<ge> ln (max 1 x0)"
[PROOF STATE]
proof (state)
this:
ln (max 1 x0) \<le> x

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
hence "exp x \<ge> max 1 x0"
[PROOF STATE]
proof (prove)
using this:
ln (max 1 x0) \<le> x

goal (1 subgoal):
 1. max 1 x0 \<le> exp x
[PROOF STEP]
by (subst (2) exp_ln[symmetric], simp, subst exp_le_cancel_iff)
[PROOF STATE]
proof (state)
this:
max 1 x0 \<le> exp x

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
hence "exp x \<ge> x0"
[PROOF STATE]
proof (prove)
using this:
max 1 x0 \<le> exp x

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

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
from x0[OF this]
[PROOF STATE]
proof (chain)
picking this:
P (ln (exp x))
[PROOF STEP]
have "P x"
[PROOF STATE]
proof (prove)
using this:
P (ln (exp x))

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

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
ln (max 1 x0) \<le> ?x2 \<Longrightarrow> P ?x2

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. P (ln x) \<Longrightarrow> eventually P at_top
 2. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
thus "eventually P at_top"
[PROOF STATE]
proof (prove)
using this:
ln (max 1 x0) \<le> ?x2 \<Longrightarrow> P ?x2

goal (1 subgoal):
 1. eventually P at_top
[PROOF STEP]
by (subst eventually_at_top_linorder) blast
[PROOF STATE]
proof (state)
this:
eventually P at_top

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
fix P :: "real \<Rightarrow> bool"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
assume  "eventually P at_top"
[PROOF STATE]
proof (state)
this:
eventually P at_top

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eventually P at_top
[PROOF STEP]
obtain x0 where x0: "\<And>x. x \<ge> x0 \<Longrightarrow> P x"
[PROOF STATE]
proof (prove)
using this:
eventually P at_top

goal (1 subgoal):
 1. (\<And>x0. (\<And>x. x0 \<le> x \<Longrightarrow> P x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (subst (asm) eventually_at_top_linorder) auto
[PROOF STATE]
proof (state)
this:
x0 \<le> ?x \<Longrightarrow> P ?x

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
x0 \<le> ?x \<Longrightarrow> P ?x

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
assume "x \<ge> exp x0"
[PROOF STATE]
proof (state)
this:
exp x0 \<le> x

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
hence "ln x \<ge> x0"
[PROOF STATE]
proof (prove)
using this:
exp x0 \<le> x

goal (1 subgoal):
 1. x0 \<le> ln x
[PROOF STEP]
by (subst ln_exp[symmetric], subst ln_le_cancel_iff)
                         (simp_all add: less_le_trans[OF exp_gt_zero])
[PROOF STATE]
proof (state)
this:
x0 \<le> ln x

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
from x0[OF this]
[PROOF STATE]
proof (chain)
picking this:
P (ln x)
[PROOF STEP]
have "P (ln x)"
[PROOF STATE]
proof (prove)
using this:
P (ln x)

goal (1 subgoal):
 1. P (ln x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P (ln x)

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
exp x0 \<le> ?x2 \<Longrightarrow> P (ln ?x2)

goal (1 subgoal):
 1. eventually P at_top \<Longrightarrow> \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
thus "eventually (\<lambda>x. P (ln x)) at_top"
[PROOF STATE]
proof (prove)
using this:
exp x0 \<le> ?x2 \<Longrightarrow> P (ln ?x2)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. P (ln x)
[PROOF STEP]
by (subst eventually_at_top_linorder) blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. P (ln x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvd_repr:
  fixes a b :: nat
  shows "a dvd b \<longleftrightarrow> (\<exists>x. x * a = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a dvd b) = (\<exists>x. x * a = b)
[PROOF STEP]
using dvd_class.dvd_def
[PROOF STATE]
proof (prove)
using this:
(?b dvd ?a) = (\<exists>k. ?a = ?b * k)

goal (1 subgoal):
 1. (a dvd b) = (\<exists>x. x * a = b)
[PROOF STEP]
by auto


[STATEMENT]
lemma differenceset_commute [simp]:
  shows "minusset (differenceset B A) = differenceset A B "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minusset (differenceset B A) = differenceset A B
[PROOF STEP]
by (metis diff_minus_set minus_minusset sumset_Int_carrier_eq(1) sumset_commute)


[STATEMENT]
lemma vec_to_iarray_rows: "vec_to_iarray` (rows A) = rows_iarray (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` rows A = rows_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding rows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` {row i A |i. i \<in> UNIV} = rows_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding rows_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` {row i A |i. i \<in> UNIV} = {row_iarray i (matrix_to_iarray A) |i. i \<in> {..<nrows_iarray (matrix_to_iarray A)}}
[PROOF STEP]
apply (auto simp add: vec_to_iarray_row to_nat_less_card nrows_eq_card_rows)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < CARD('c) \<Longrightarrow> row_iarray i (matrix_to_iarray A) \<in> vec_to_iarray ` {uu_. \<exists>i. uu_ = row i A}
[PROOF STEP]
by (unfold image_def, auto, metis from_nat_not_eq vec_to_iarray_row)


[STATEMENT]
lemma arc_to_block_sym: "arc_to_ends G e1 = (u, v) \<Longrightarrow> arc_to_ends G e2 = (v, u) \<Longrightarrow>
  arc_to_block e1 = arc_to_block e2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>arc_to_ends G e1 = (u, v); arc_to_ends G e2 = (v, u)\<rbrakk> \<Longrightarrow> arc_to_block e1 = arc_to_block e2
[PROOF STEP]
by (simp add: arc_to_block_def arc_to_ends_def insert_commute)


[STATEMENT]
lemma orthogonal_lvsum:
    "\<lbrakk>finite s; \<And>x. x \<in> s \<Longrightarrow> orthogonal (f x) y\<rbrakk> \<Longrightarrow> orthogonal (sum f s) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite s; \<And>x. x \<in> s \<Longrightarrow> orthogonal (f x) y\<rbrakk> \<Longrightarrow> orthogonal (sum f s) y
[PROOF STEP]
by (induction s rule: finite_induct) (auto simp: orthogonal_clauses)


[STATEMENT]
lemma free_vars_cexpr_subst_val_aux:
    "free_vars (cexpr_subst_val_aux x e v) = (\<lambda>y. if y \<ge> x then Suc y else y) -` free_vars e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. free_vars (cexpr_subst_val_aux x e v) = (\<lambda>y. if x \<le> y then Suc y else y) -` free_vars e
[PROOF STEP]
by (induction e arbitrary: x) (auto simp: insert_var_def split: if_split_asm)