[STATEMENT]
lemma has_derivative_powr[derivative_intros]:
  assumes g[derivative_intros]: "(g has_derivative g') (at x within X)"
    and f[derivative_intros]:"(f has_derivative f') (at x within X)"
  assumes pos: "0 < g x" and "x \<in> X"
  shows "((\<lambda>x. g x powr f x::real) has_derivative (\<lambda>h. (g x powr f x) * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g x powr f x) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. g x powr f x) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
have "\<forall>\<^sub>F x in at x within X. g x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at x within X. 0 < g x
[PROOF STEP]
by (rule order_tendstoD[OF _ pos])
      (rule has_derivative_continuous[OF g, unfolded continuous_within])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at x within X. 0 < g x

goal (1 subgoal):
 1. ((\<lambda>x. g x powr f x) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at x within X. 0 < g x
[PROOF STEP]
obtain d where "d > 0" and pos': "\<And>x'. x' \<in> X \<Longrightarrow> dist x' x < d \<Longrightarrow> 0 < g x'"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at x within X. 0 < g x

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>x'. \<lbrakk>x' \<in> X; dist x' x < d\<rbrakk> \<Longrightarrow> 0 < g x'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using pos
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at x within X. 0 < g x
0 < g x

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>x'. \<lbrakk>x' \<in> X; dist x' x < d\<rbrakk> \<Longrightarrow> 0 < g x'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_at
[PROOF STATE]
proof (prove)
using this:
\<exists>d>0. \<forall>xa\<in>X. xa \<noteq> x \<and> dist xa x < d \<longrightarrow> 0 < g xa
0 < g x

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>x'. \<lbrakk>x' \<in> X; dist x' x < d\<rbrakk> \<Longrightarrow> 0 < g x'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < d
\<lbrakk>?x' \<in> X; dist ?x' x < d\<rbrakk> \<Longrightarrow> 0 < g ?x'

goal (1 subgoal):
 1. ((\<lambda>x. g x powr f x) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
have "((\<lambda>x. exp (f x * ln (g x))) has_derivative
    (\<lambda>h. (g x powr f x) * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (f x * ln (g x))) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
using pos
[PROOF STATE]
proof (prove)
using this:
0 < g x

goal (1 subgoal):
 1. ((\<lambda>x. exp (f x * ln (g x))) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: field_split_simps powr_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (f x * ln (g x))) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)

goal (1 subgoal):
 1. ((\<lambda>x. g x powr f x) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. exp (f x * ln (g x))) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. exp (f x * ln (g x))) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)

goal (1 subgoal):
 1. ((\<lambda>x. g x powr f x) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)
[PROOF STEP]
by (rule has_derivative_transform_within[OF _ \<open>d > 0\<close> \<open>x \<in> X\<close>]) (auto simp: powr_def dest: pos')
[PROOF STATE]
proof (state)
this:
((\<lambda>x. g x powr f x) has_derivative (\<lambda>h. g x powr f x * (f' h * ln (g x) + g' h * f x / g x))) (at x within X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_disc_fix_transitive:
  assumes in_disc: "u \<in> unit_disc" and "u' \<in> unit_disc"
  shows "\<exists> M. unit_disc_fix M \<and> moebius_pt M u = u'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'
[PROOF STEP]
have "\<forall> u \<in> unit_disc. \<exists> M. unit_disc_fix M \<and> moebius_pt M u = u'" (is "?P u'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'
[PROOF STEP]
proof (rule wlog_zero)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. u' \<in> unit_disc
 2. \<And>a u. \<lbrakk>u \<in> unit_disc; cmod a < 1; \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = u
 3. \<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h
[PROOF STEP]
show "u' \<in> unit_disc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u' \<in> unit_disc
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
u' \<in> unit_disc

goal (2 subgoals):
 1. \<And>a u. \<lbrakk>u \<in> unit_disc; cmod a < 1; \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = u
 2. \<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a u. \<lbrakk>u \<in> unit_disc; cmod a < 1; \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = u
 2. \<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h
[PROOF STEP]
show "?P 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h
[PROOF STEP]
by (simp add: ex_unit_disc_fix_mapping_u_to_zero)
[PROOF STATE]
proof (state)
this:
\<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h

goal (1 subgoal):
 1. \<And>a u. \<lbrakk>u \<in> unit_disc; cmod a < 1; \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a u. \<lbrakk>u \<in> unit_disc; cmod a < 1; \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = u
[PROOF STEP]
fix a u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a u. \<lbrakk>u \<in> unit_disc; cmod a < 1; \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = u
[PROOF STEP]
assume "cmod a < 1" and *: "?P (moebius_pt (blaschke a) u)"
[PROOF STATE]
proof (state)
this:
cmod a < 1
\<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = moebius_pt (blaschke a) u

goal (1 subgoal):
 1. \<And>a u. \<lbrakk>u \<in> unit_disc; cmod a < 1; \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> \<forall>ua\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M ua = u
[PROOF STEP]
show "?P u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. u \<in> unit_disc \<Longrightarrow> \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u
[PROOF STEP]
fix u'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. u \<in> unit_disc \<Longrightarrow> \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u
[PROOF STEP]
assume "u' \<in> unit_disc"
[PROOF STATE]
proof (state)
this:
u' \<in> unit_disc

goal (1 subgoal):
 1. \<And>u. u \<in> unit_disc \<Longrightarrow> \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u' \<in> unit_disc
[PROOF STEP]
obtain M' where "unit_disc_fix M'" "moebius_pt M' u' = moebius_pt (blaschke a) u"
[PROOF STATE]
proof (prove)
using this:
u' \<in> unit_disc

goal (1 subgoal):
 1. (\<And>M'. \<lbrakk>unit_disc_fix M'; moebius_pt M' u' = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
u' \<in> unit_disc
\<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = moebius_pt (blaschke a) u

goal (1 subgoal):
 1. (\<And>M'. \<lbrakk>unit_disc_fix M'; moebius_pt M' u' = moebius_pt (blaschke a) u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unit_disc_fix M'
moebius_pt M' u' = moebius_pt (blaschke a) u

goal (1 subgoal):
 1. \<And>u. u \<in> unit_disc \<Longrightarrow> \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u
[PROOF STEP]
thus "\<exists>M. unit_disc_fix M \<and> moebius_pt M u' = u"
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M'
moebius_pt M' u' = moebius_pt (blaschke a) u

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u' = u
[PROOF STEP]
using \<open>cmod a < 1\<close> blaschke_unit_disc_fix[of a]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M'
moebius_pt M' u' = moebius_pt (blaschke a) u
cmod a < 1
cmod a < 1 \<Longrightarrow> unit_disc_fix (blaschke a)

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u' = u
[PROOF STEP]
using unit_disc_fix_moebius_comp[of "- blaschke a" "M'"]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M'
moebius_pt M' u' = moebius_pt (blaschke a) u
cmod a < 1
cmod a < 1 \<Longrightarrow> unit_disc_fix (blaschke a)
\<lbrakk>unit_disc_fix (- blaschke a); unit_disc_fix M'\<rbrakk> \<Longrightarrow> unit_disc_fix (moebius_comp (- blaschke a) M')

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u' = u
[PROOF STEP]
using unit_disc_fix_moebius_inv[of "blaschke a"]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M'
moebius_pt M' u' = moebius_pt (blaschke a) u
cmod a < 1
cmod a < 1 \<Longrightarrow> unit_disc_fix (blaschke a)
\<lbrakk>unit_disc_fix (- blaschke a); unit_disc_fix M'\<rbrakk> \<Longrightarrow> unit_disc_fix (moebius_comp (- blaschke a) M')
unit_disc_fix (blaschke a) \<Longrightarrow> unit_disc_fix (moebius_inv (blaschke a))

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u' = u
[PROOF STEP]
by (rule_tac x="(- (blaschke a)) + M'" in exI, simp)
[PROOF STATE]
proof (state)
this:
\<exists>M. unit_disc_fix M \<and> moebius_pt M u' = u

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>u\<in>unit_disc. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'
u \<in> unit_disc
u' \<in> unit_disc

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>M. unit_disc_fix M \<and> moebius_pt M u = u'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lens_plus_eq_left: "\<lbrakk> X \<bowtie> Z; X \<approx>\<^sub>L Y \<rbrakk> \<Longrightarrow> X +\<^sub>L Z \<approx>\<^sub>L Y +\<^sub>L Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<bowtie> Z; X \<approx>\<^sub>L Y\<rbrakk> \<Longrightarrow> X +\<^sub>L Z \<approx>\<^sub>L Y +\<^sub>L Z
[PROOF STEP]
by (meson lens_equiv_def lens_plus_mono_left sublens_pres_indep)


[STATEMENT]
lemma analz_fset_set (*[simp]*):
  "\<not>(\<exists> K . Key K \<in> analz (FS`ls))
    \<Longrightarrow> analz (FS`ls) =  (FS`ls) \<union> (\<Union>l \<in> ls. analz (fset l)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>K. Key K \<in> analz (FS ` ls) \<Longrightarrow> analz (FS ` ls) = FS ` ls \<union> (\<Union>l\<in>ls. analz (fset l))
[PROOF STEP]
apply (rule equalityI, rule subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<nexists>K. Key K \<in> analz (FS ` ls); x \<in> analz (FS ` ls)\<rbrakk> \<Longrightarrow> x \<in> FS ` ls \<union> (\<Union>l\<in>ls. analz (fset l))
 2. \<nexists>K. Key K \<in> analz (FS ` ls) \<Longrightarrow> FS ` ls \<union> (\<Union>l\<in>ls. analz (fset l)) \<subseteq> analz (FS ` ls)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>K. Key K \<notin> analz (FS ` ls); l \<in> ls; x \<in> analz (fset l)\<rbrakk> \<Longrightarrow> x \<in> analz (FS ` ls)
[PROOF STEP]
using FS_analz image_subset_iff analz_increasing analz_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>FS ?l \<in> analz ?H; fset ?l \<subseteq> analz ?H \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
(?f ` ?A \<subseteq> ?B) = (\<forall>x\<in>?A. ?f x \<in> ?B)
?H \<subseteq> analz ?H
\<lbrakk>?X \<in> analz ?G; ?G \<subseteq> analz ?H\<rbrakk> \<Longrightarrow> ?X \<in> analz ?H

goal (1 subgoal):
 1. \<And>x l. \<lbrakk>\<forall>K. Key K \<notin> analz (FS ` ls); l \<in> ls; x \<in> analz (fset l)\<rbrakk> \<Longrightarrow> x \<in> analz (FS ` ls)
[PROOF STEP]
by metis


[STATEMENT]
lemma separating_hyperplane_closed_compact:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S"
    and "closed S"
    and "convex T"
    and "compact T"
    and "T \<noteq> {}"
    and "S \<inter> T = {}"
  shows "\<exists>a b. (\<forall>x\<in>S. inner a x < b) \<and> (\<forall>x\<in>T. inner a x > b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
obtain b where b: "b > 0" "\<forall>x\<in>T. norm x \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 < b; \<forall>x\<in>T. norm x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using compact_imp_bounded[OF assms(4)]
[PROOF STATE]
proof (prove)
using this:
bounded T

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 < b; \<forall>x\<in>T. norm x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bounded_pos
[PROOF STATE]
proof (prove)
using this:
\<exists>b>0. \<forall>x\<in>T. norm x \<le> b

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 < b; \<forall>x\<in>T. norm x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < b
\<forall>x\<in>T. norm x \<le> b

goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
obtain z :: 'a where z: "norm z = b + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. norm z = b + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using vector_choose_size[of "b + 1"] and b(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> b + 1; \<And>x. norm x = b + 1 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
0 < b

goal (1 subgoal):
 1. (\<And>z. norm z = b + 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm z = b + 1

goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm z = b + 1
[PROOF STEP]
have "z \<notin> T"
[PROOF STATE]
proof (prove)
using this:
norm z = b + 1

goal (1 subgoal):
 1. z \<notin> T
[PROOF STEP]
using b(2)[THEN bspec[where x=z]]
[PROOF STATE]
proof (prove)
using this:
norm z = b + 1
z \<in> T \<Longrightarrow> norm z \<le> b

goal (1 subgoal):
 1. z \<notin> T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<notin> T

goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<notin> T
[PROOF STEP]
obtain a b where ab: "inner a z < b" "\<forall>x\<in>T. b < inner a x"
[PROOF STATE]
proof (prove)
using this:
z \<notin> T

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<bullet> z < b; \<forall>x\<in>T. b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using separating_hyperplane_closed_point[OF assms(3) compact_imp_closed[OF assms(4)], of z]
[PROOF STATE]
proof (prove)
using this:
z \<notin> T
z \<notin> T \<Longrightarrow> \<exists>a b. a \<bullet> z < b \<and> (\<forall>x\<in>T. b < a \<bullet> x)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<bullet> z < b; \<forall>x\<in>T. b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<bullet> z < b
\<forall>x\<in>T. b < a \<bullet> x

goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<bullet> z < b
\<forall>x\<in>T. b < a \<bullet> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<bullet> z < b
\<forall>x\<in>T. b < a \<bullet> x

goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
a \<bullet> z < b
\<forall>x\<in>T. b < a \<bullet> x
S = {}

goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain y where "y \<in> S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>y. y \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
obtain a b where "0 < b" and \<section>: "\<And>x. x \<in> (\<Union>x\<in> S. \<Union>y \<in> T. {x - y}) \<Longrightarrow> b < inner a x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b a. \<lbrakk>0 < b; \<And>x. x \<in> (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) \<Longrightarrow> b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using separating_hyperplane_closed_point[OF convex_differences[OF assms(1,3)], of 0]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closed (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}); (0::'a) \<notin> (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})\<rbrakk> \<Longrightarrow> \<exists>a b. a \<bullet> (0::'a) < b \<and> (\<forall>x\<in>\<Union>x\<in>S. \<Union>y\<in>T. {x - y}. b < a \<bullet> x)

goal (1 subgoal):
 1. (\<And>b a. \<lbrakk>0 < b; \<And>x. x \<in> (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) \<Longrightarrow> b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using closed_compact_differences assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closed (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}); (0::'a) \<notin> (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})\<rbrakk> \<Longrightarrow> \<exists>a b. a \<bullet> (0::'a) < b \<and> (\<forall>x\<in>\<Union>x\<in>S. \<Union>y\<in>T. {x - y}. b < a \<bullet> x)
\<lbrakk>closed ?S; compact ?T\<rbrakk> \<Longrightarrow> closed (\<Union>x\<in>?S. \<Union>y\<in>?T. {x - y})
convex S
closed S
convex T
compact T
T \<noteq> {}
S \<inter> T = {}

goal (1 subgoal):
 1. (\<And>b a. \<lbrakk>0 < b; \<And>x. x \<in> (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) \<Longrightarrow> b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < b
?x \<in> (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) \<Longrightarrow> b < a \<bullet> ?x

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
have ab: "b + inner a y < inner a x" if "x\<in>S" "y\<in>T" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b + a \<bullet> y < a \<bullet> x
[PROOF STEP]
using \<section> [of "x-y"] that
[PROOF STATE]
proof (prove)
using this:
x - y \<in> (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) \<Longrightarrow> b < a \<bullet> (x - y)
x \<in> S
y \<in> T

goal (1 subgoal):
 1. b + a \<bullet> y < a \<bullet> x
[PROOF STEP]
by (auto simp add: inner_diff_right less_diff_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> S; ?y \<in> T\<rbrakk> \<Longrightarrow> b + a \<bullet> ?y < a \<bullet> ?x

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
define k where "k = (SUP x\<in>T. a \<bullet> x)"
[PROOF STATE]
proof (state)
this:
k = Sup ((\<bullet>) a ` T)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
have "k + b / 2 < a \<bullet> x" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k + b / 2 < a \<bullet> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k + b / 2 < a \<bullet> x
[PROOF STEP]
have "k \<le> inner a x - b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> a \<bullet> x - b
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup ((\<bullet>) a ` T) \<le> a \<bullet> x - b
[PROOF STEP]
using \<open>T \<noteq> {}\<close> ab that
[PROOF STATE]
proof (prove)
using this:
T \<noteq> {}
\<lbrakk>?x \<in> S; ?y \<in> T\<rbrakk> \<Longrightarrow> b + a \<bullet> ?y < a \<bullet> ?x
x \<in> S

goal (1 subgoal):
 1. Sup ((\<bullet>) a ` T) \<le> a \<bullet> x - b
[PROOF STEP]
by (fastforce intro: cSUP_least)
[PROOF STATE]
proof (state)
this:
k \<le> a \<bullet> x - b

goal (1 subgoal):
 1. k + b / 2 < a \<bullet> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<le> a \<bullet> x - b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<le> a \<bullet> x - b

goal (1 subgoal):
 1. k + b / 2 < a \<bullet> x
[PROOF STEP]
using \<open>0 < b\<close>
[PROOF STATE]
proof (prove)
using this:
k \<le> a \<bullet> x - b
0 < b

goal (1 subgoal):
 1. k + b / 2 < a \<bullet> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k + b / 2 < a \<bullet> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> k + b / 2 < a \<bullet> ?x

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> k + b / 2 < a \<bullet> ?x

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
have "- (k + b / 2) < - a \<bullet> x" if "x \<in> T" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (k + b / 2) < - a \<bullet> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (k + b / 2) < - a \<bullet> x
[PROOF STEP]
have "inner a x - b / 2 < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<bullet> x - b / 2 < k
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<bullet> x - b / 2 < Sup ((\<bullet>) a ` T)
[PROOF STEP]
proof (subst less_cSUP_iff)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. T \<noteq> {}
 2. bdd_above ((\<bullet>) a ` T)
 3. \<exists>xa\<in>T. a \<bullet> x - b / 2 < a \<bullet> xa
[PROOF STEP]
show "T \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<noteq> {}
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
T \<noteq> {}

goal (2 subgoals):
 1. bdd_above ((\<bullet>) a ` T)
 2. \<exists>xa\<in>T. a \<bullet> x - b / 2 < a \<bullet> xa
[PROOF STEP]
show "bdd_above ((\<bullet>) a ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above ((\<bullet>) a ` T)
[PROOF STEP]
using ab[rule_format, of y] \<open>y \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>y \<in> S; ?y \<in> T\<rbrakk> \<Longrightarrow> b + a \<bullet> ?y < a \<bullet> y
y \<in> S

goal (1 subgoal):
 1. bdd_above ((\<bullet>) a ` T)
[PROOF STEP]
by (intro bdd_aboveI2[where M="inner a y - b"]) (auto simp: field_simps intro: less_imp_le)
[PROOF STATE]
proof (state)
this:
bdd_above ((\<bullet>) a ` T)

goal (1 subgoal):
 1. \<exists>xa\<in>T. a \<bullet> x - b / 2 < a \<bullet> xa
[PROOF STEP]
show "\<exists>y\<in>T. a \<bullet> x - b / 2 < a \<bullet> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>T. a \<bullet> x - b / 2 < a \<bullet> y
[PROOF STEP]
using \<open>0 < b\<close> that
[PROOF STATE]
proof (prove)
using this:
0 < b
x \<in> T

goal (1 subgoal):
 1. \<exists>y\<in>T. a \<bullet> x - b / 2 < a \<bullet> y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>T. a \<bullet> x - b / 2 < a \<bullet> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<bullet> x - b / 2 < k

goal (1 subgoal):
 1. - (k + b / 2) < - a \<bullet> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<bullet> x - b / 2 < k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<bullet> x - b / 2 < k

goal (1 subgoal):
 1. - (k + b / 2) < - a \<bullet> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (k + b / 2) < - a \<bullet> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> T \<Longrightarrow> - (k + b / 2) < - a \<bullet> ?x

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x \<in> S \<Longrightarrow> k + b / 2 < a \<bullet> ?x
?x \<in> T \<Longrightarrow> - (k + b / 2) < - a \<bullet> ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> k + b / 2 < a \<bullet> ?x
?x \<in> T \<Longrightarrow> - (k + b / 2) < - a \<bullet> ?x

goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
by (metis inner_minus_left neg_less_iff_less)
[PROOF STATE]
proof (state)
this:
\<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma orthogonal_currentD_SAT: "\<lbrakk> orthogonal_current \<Gamma> f S; x \<in> S \<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>orthogonal_current \<Gamma> f S; x \<in> S\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> f
[PROOF STEP]
by(auto elim!: orthogonal_current.cases intro: SAT.intros)


[STATEMENT]
lemma dtail_f_alt:
  assumes "P = (\<lambda>xs. wf_darcs (Node r xs))"
      and "Q = (\<lambda>(t1,e1) b. e \<in> darcs t1)"
      and "R = (\<lambda>(t1,e1) b. dtail t1 def)"
    shows "(\<lambda>(t1,e1) b. if (t1,e1) \<notin> fset xs \<or> e \<notin> darcs t1\<or> \<not>wf_darcs (Node r xs)
            then b else dtail t1 def)
          = (\<lambda>a b. if a \<notin> fset xs \<or> \<not> Q a b \<or> \<not> P xs then b else R a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(t1, e1) b. if (t1, e1) \<notin> fset xs \<or> e \<notin> darcs t1 \<or> \<not> wf_darcs (Node r xs) then b else dtail t1 def) = (\<lambda>a b. if a \<notin> fset xs \<or> \<not> Q a b \<or> \<not> P xs then b else R a b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P = (\<lambda>xs. wf_darcs (Node r xs))
Q = (\<lambda>(t1, e1) b. e \<in> darcs t1)
R = (\<lambda>(t1, e1) b. dtail t1 def)

goal (1 subgoal):
 1. (\<lambda>(t1, e1) b. if (t1, e1) \<notin> fset xs \<or> e \<notin> darcs t1 \<or> \<not> wf_darcs (Node r xs) then b else dtail t1 def) = (\<lambda>a b. if a \<notin> fset xs \<or> \<not> Q a b \<or> \<not> P xs then b else R a b)
[PROOF STEP]
by fast


[STATEMENT]
lemma mset_union_subset: "A+B \<subseteq># C \<Longrightarrow> A\<subseteq>#C \<and> B\<subseteq>#(C::'a multiset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B \<subseteq># C \<Longrightarrow> A \<subseteq># C \<and> B \<subseteq># C
[PROOF STEP]
by (auto dest: mset_le_decr_left)


[STATEMENT]
lemma S_K2_empty: "S \<inter> K2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> K2 = {}
[PROOF STEP]
unfolding S_def and K2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. conic_sgn p = 0} \<inter> {p. conic_sgn p < 0} = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma uniform_limit_integral:
  fixes f::"'a \<Rightarrow> 'b::ordered_euclidean_space \<Rightarrow> 'c::banach"
  assumes u: "uniform_limit {a..b} f g F"
  assumes c: "\<And>n. continuous_on {a..b} (f n)"
  assumes [simp]: "F \<noteq> bot"
  obtains I J where
    "\<And>n. (f n has_integral I n) {a..b}"
    "(g has_integral J) {a..b}"
    "(I \<longlongrightarrow> J) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>\<And>n. (f n has_integral I n) {a..b}; (g has_integral J) {a..b}; (I \<longlongrightarrow> J) F\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis interval_cbox assms uniform_limit_integral_cbox)


[STATEMENT]
lemma isomorphic_reduced_homology_by_contractible:
   "\<lbrakk>contractible_space(subtopology X S); topspace X \<inter> S \<noteq> {}\<rbrakk>
      \<Longrightarrow> reduced_homology_group p X \<cong> relative_homology_group p X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>contractible_space (subtopology X S); topspace X \<inter> S \<noteq> {}\<rbrakk> \<Longrightarrow> reduced_homology_group p X \<cong> relative_homology_group p X S
[PROOF STEP]
using is_isoI iso_reduced_homology_by_contractible
[PROOF STATE]
proof (prove)
using this:
?h \<in> Group.iso ?G ?H \<Longrightarrow> ?G \<cong> ?H
\<lbrakk>contractible_space (subtopology ?X ?S); topspace ?X \<inter> ?S \<noteq> {}\<rbrakk> \<Longrightarrow> hom_induced ?p ?X {} ?X ?S id \<in> Group.iso (reduced_homology_group ?p ?X) (relative_homology_group ?p ?X ?S)

goal (1 subgoal):
 1. \<lbrakk>contractible_space (subtopology X S); topspace X \<inter> S \<noteq> {}\<rbrakk> \<Longrightarrow> reduced_homology_group p X \<cong> relative_homology_group p X S
[PROOF STEP]
by blast


[STATEMENT]
lemma has_integral_cos_nx:
  "((\<lambda>x. cos(real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
 2. n \<noteq> 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
 2. n \<noteq> 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
using has_integral_const_real [of "1::real" "-pi" pi]
[PROOF STATE]
proof (prove)
using this:
n = 0
((\<lambda>x. 1) has_integral content {- pi..pi} *\<^sub>R 1) {- pi..pi}

goal (1 subgoal):
 1. ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
have "((\<lambda>x. cos (n * x)) has_integral (sin (n * pi)/n - sin (n * - pi)/n)) {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. cos (real_of_int n * x)) has_integral sin (real_of_int n * pi) / real_of_int n - sin (real_of_int n * - pi) / real_of_int n) {- pi..pi}
[PROOF STEP]
proof (rule fundamental_theorem_of_calculus)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - pi \<le> pi
 2. \<And>x. x \<in> {- pi..pi} \<Longrightarrow> ((\<lambda>a. sin (real_of_int n * a) / real_of_int n) has_vector_derivative cos (real_of_int n * x)) (at x within {- pi..pi})
[PROOF STEP]
show "((\<lambda>x. sin (n * x) / n) has_vector_derivative cos (n * x)) (at x within {-pi..pi})"
      if "x \<in> {-pi..pi}"
      for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sin (real_of_int n * x) / real_of_int n) has_vector_derivative cos (real_of_int n * x)) (at x within {- pi..pi})
[PROOF STEP]
using that False
[PROOF STATE]
proof (prove)
using this:
x \<in> {- pi..pi}
n \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>x. sin (real_of_int n * x) / real_of_int n) has_vector_derivative cos (real_of_int n * x)) (at x within {- pi..pi})
[PROOF STEP]
unfolding has_vector_derivative_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {- pi..pi}
n \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>x. sin (real_of_int n * x) / real_of_int n) has_derivative (\<lambda>xa. xa *\<^sub>R cos (real_of_int n * x))) (at x within {- pi..pi})
[PROOF STEP]
by (intro derivative_eq_intros | force)+
[PROOF STATE]
proof (state)
this:
?x \<in> {- pi..pi} \<Longrightarrow> ((\<lambda>x. sin (real_of_int n * x) / real_of_int n) has_vector_derivative cos (real_of_int n * ?x)) (at ?x within {- pi..pi})

goal (1 subgoal):
 1. - pi \<le> pi
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. cos (real_of_int n * x)) has_integral sin (real_of_int n * pi) / real_of_int n - sin (real_of_int n * - pi) / real_of_int n) {- pi..pi}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
((\<lambda>x. cos (real_of_int n * x)) has_integral sin (real_of_int n * pi) / real_of_int n - sin (real_of_int n * - pi) / real_of_int n) {- pi..pi}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
((\<lambda>x. cos (real_of_int n * x)) has_integral sin (real_of_int n * pi) / real_of_int n - sin (real_of_int n * - pi) / real_of_int n) {- pi..pi}

goal (1 subgoal):
 1. ((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. cos (real_of_int n * x)) has_integral (if n = 0 then 2 * pi else 0)) {- pi..pi}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_image_subset_topspace: "pathin X g \<Longrightarrow> g ` ({0..1}) \<subseteq> topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathin X g \<Longrightarrow> g ` {0..1} \<subseteq> topspace X
[PROOF STEP]
by (force simp: pathin_def continuous_map)


[STATEMENT]
lemma ln_primefact:
  assumes "n \<noteq> (0::nat)"
  shows   "ln n = (\<Sum>d=1..n. if primepow d \<and> d dvd n then ln (aprimedivisor d) else 0)"
          (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
have "?rhs = (\<Sum>d\<in>{x \<in> {1..n}. primepow x \<and> x dvd n}. ln (real (aprimedivisor d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0) = (\<Sum>d\<in>{x \<in> {1..n}. primepow x \<and> x dvd n}. ln (real (aprimedivisor d)))
[PROOF STEP]
unfolding primepow_factors_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0) = (\<Sum>d\<in>{x \<in> {1..n}. primepow x \<and> x dvd n}. ln (real (aprimedivisor d)))
[PROOF STEP]
by (subst sum.inter_filter [symmetric]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0) = (\<Sum>d\<in>{x \<in> {1..n}. primepow x \<and> x dvd n}. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0) = (\<Sum>d\<in>{x \<in> {1..n}. primepow x \<and> x dvd n}. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
have "{x \<in> {1..n}. primepow x \<and> x dvd n} = primepow_factors n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> {1..n}. primepow x \<and> x dvd n} = primepow_factors n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. {x \<in> {1..n}. primepow x \<and> x dvd n} = primepow_factors n
[PROOF STEP]
by (auto simp: primepow_factors_def dest: dvd_imp_le primepow_gt_Suc_0)
[PROOF STATE]
proof (state)
this:
{x \<in> {1..n}. primepow x \<and> x dvd n} = primepow_factors n

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0) = (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d)))
[PROOF STEP]
have *: "(\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = ?rhs"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0) = (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
from in_prime_factors_imp_prime prime_gt_0_nat
[PROOF STATE]
proof (chain)
picking this:
?p \<in># prime_factorization ?x \<Longrightarrow> prime ?p
prime ?p \<Longrightarrow> 0 < ?p
[PROOF STEP]
have pf_pos: "\<And>p. p\<in>#prime_factorization n \<Longrightarrow> p > 0"
[PROOF STATE]
proof (prove)
using this:
?p \<in># prime_factorization ?x \<Longrightarrow> prime ?p
prime ?p \<Longrightarrow> 0 < ?p

goal (1 subgoal):
 1. \<And>p. p \<in># prime_factorization n \<Longrightarrow> 0 < p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?p \<in># prime_factorization n \<Longrightarrow> 0 < ?p

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
from ln_msetprod[of "prime_factorization n", OF pf_pos] assms
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in># prime_factorization n \<Longrightarrow> x \<in># prime_factorization n) \<Longrightarrow> (\<Sum>p\<in>#prime_factorization n. ln (real p)) = ln (\<Prod>\<^sub># (image_mset real (prime_factorization n)))
n \<noteq> 0
[PROOF STEP]
have "ln n = (\<Sum>p\<in>#prime_factorization n. ln p)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in># prime_factorization n \<Longrightarrow> x \<in># prime_factorization n) \<Longrightarrow> (\<Sum>p\<in>#prime_factorization n. ln (real p)) = ln (\<Prod>\<^sub># (image_mset real (prime_factorization n)))
n \<noteq> 0

goal (1 subgoal):
 1. ln (real n) = (\<Sum>p\<in>#prime_factorization n. ln (real p))
[PROOF STEP]
by (simp add: of_nat_prod_mset)
[PROOF STATE]
proof (state)
this:
ln (real n) = (\<Sum>p\<in>#prime_factorization n. ln (real p))

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (real n) = (\<Sum>p\<in>#prime_factorization n. ln (real p))

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
from * sum_prime_factorization_conv_sum_primepow_factors[of n ln, OF assms(1)]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
(\<Sum>q\<in>primepow_factors n. ln (real (aprimedivisor q))) = (\<Sum>p\<in>#prime_factorization n. ln (real p))
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
(\<Sum>q\<in>primepow_factors n. ln (real (aprimedivisor q))) = (\<Sum>p\<in>#prime_factorization n. ln (real p))

goal (1 subgoal):
 1. (\<Sum>p\<in>#prime_factorization n. ln (real p)) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>p\<in>#prime_factorization n. ln (real p)) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)

goal (1 subgoal):
 1. ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ln (real n) = (\<Sum>d = 1..n. if primepow d \<and> d dvd n then ln (real (aprimedivisor d)) else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upper_triangular'I[intro] :
  "(\<And>i j. j<dim_col A \<Longrightarrow> j < i \<Longrightarrow> i < dim_row A \<Longrightarrow> A $$ (i,j) = 0) \<Longrightarrow> upper_triangular' A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>j < dim_col A; j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)) \<Longrightarrow> upper_triangular' A
[PROOF STEP]
unfolding upper_triangular'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>j < dim_col A; j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)) \<Longrightarrow> \<forall>i<dim_row A. \<forall>j<dim_col A. j < i \<longrightarrow> A $$ (i, j) = (0::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma conv_le_abs_conv_abscissa: "conv_abscissa f \<le> abs_conv_abscissa f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_abscissa f \<le> abs_conv_abscissa f
[PROOF STEP]
unfolding conv_abscissa_def abs_conv_abscissa_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF s\<in>Collect (fds_converges f). ereal (s \<bullet> (1::'b))) \<le> (INF s\<in>Collect (fds_abs_converges f). ereal (s \<bullet> (1::'b)))
[PROOF STEP]
by (intro INF_superset_mono) auto


[STATEMENT]
lemma tendsto_arsinh [tendsto_intros]: "(f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. arsinh (f x)) \<longlongrightarrow> arsinh a) F"
  for f :: "_ \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. arsinh (f x)) \<longlongrightarrow> arsinh a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_arsinh])


[STATEMENT]
lemma integral_nonneg_eq_0_iff_AE:
  fixes f :: "_ \<Rightarrow> real"
  assumes f[measurable]: "integrable M f" and nonneg: "AE x in M. 0 \<le> f x"
  shows "integral\<^sup>L M f = 0 \<longleftrightarrow> (AE x in M. f x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral\<^sup>L M f = 0) = (AE x in M. f x = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integral\<^sup>L M f = 0 \<Longrightarrow> AE x in M. f x = 0
 2. AE x in M. f x = 0 \<Longrightarrow> integral\<^sup>L M f = 0
[PROOF STEP]
assume "integral\<^sup>L M f = 0"
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M f = 0

goal (2 subgoals):
 1. integral\<^sup>L M f = 0 \<Longrightarrow> AE x in M. f x = 0
 2. AE x in M. f x = 0 \<Longrightarrow> integral\<^sup>L M f = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>L M f = 0
[PROOF STEP]
have "integral\<^sup>N M f = 0"
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L M f = 0

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>M = 0
[PROOF STEP]
using nn_integral_eq_integral[OF f nonneg]
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L M f = 0
\<integral>\<^sup>+ x. ennreal (f x) \<partial>M = ennreal (integral\<^sup>L M f)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>M = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>M = 0

goal (2 subgoals):
 1. integral\<^sup>L M f = 0 \<Longrightarrow> AE x in M. f x = 0
 2. AE x in M. f x = 0 \<Longrightarrow> integral\<^sup>L M f = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>M = 0
[PROOF STEP]
have "AE x in M. ennreal (f x) \<le> 0"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>M = 0

goal (1 subgoal):
 1. AE x in M. ennreal (f x) \<le> 0
[PROOF STEP]
by (simp add: nn_integral_0_iff_AE)
[PROOF STATE]
proof (state)
this:
AE x in M. ennreal (f x) \<le> 0

goal (2 subgoals):
 1. integral\<^sup>L M f = 0 \<Longrightarrow> AE x in M. f x = 0
 2. AE x in M. f x = 0 \<Longrightarrow> integral\<^sup>L M f = 0
[PROOF STEP]
with nonneg
[PROOF STATE]
proof (chain)
picking this:
AE x in M. 0 \<le> f x
AE x in M. ennreal (f x) \<le> 0
[PROOF STEP]
show "AE x in M. f x = 0"
[PROOF STATE]
proof (prove)
using this:
AE x in M. 0 \<le> f x
AE x in M. ennreal (f x) \<le> 0

goal (1 subgoal):
 1. AE x in M. f x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. f x = 0

goal (1 subgoal):
 1. AE x in M. f x = 0 \<Longrightarrow> integral\<^sup>L M f = 0
[PROOF STEP]
qed (auto simp add: integral_eq_zero_AE)


[STATEMENT]
lemma UP_a_comm:
  assumes R: "p \<in> carrier P" "q \<in> carrier P"
  shows "p \<oplus>\<^bsub>P\<^esub> q = q \<oplus>\<^bsub>P\<^esub> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<oplus>\<^bsub>P\<^esub> q = q \<oplus>\<^bsub>P\<^esub> p
[PROOF STEP]
by (rule up_eqI, simp add: a_comm R, simp_all add: R)


[STATEMENT]
lemma Range_rel_restrict:
  "Range (rel_restrict R A) \<subseteq> Range R - A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range (rel_restrict R A) \<subseteq> Range R - A
[PROOF STEP]
unfolding rel_restrict_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range {(v, w). (v, w) \<in> R \<and> v \<notin> A \<and> w \<notin> A} \<subseteq> Range R - A
[PROOF STEP]
by auto


[STATEMENT]
lemma is_pr_Hom_rev:
  "is_pr_Hom \<phi> A B \<Longrightarrow> is_pr_Hom \<phi> (rev ` A) (rev ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pr_Hom \<phi> A B \<Longrightarrow> is_pr_Hom \<phi> (rev ` A) (rev ` B)
[PROOF STEP]
apply(auto simp add: is_pr_Hom_def quotient_def Image_def Iso_def rev_map[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>(\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))}) = (\<Union>x\<in>B. {Collect ((\<cong>) x)}); xa \<in> A\<rbrakk> \<Longrightarrow> \<exists>x\<in>B. map \<phi> xa \<cong> x
 2. \<And>xa. \<lbrakk>(\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))}) = (\<Union>x\<in>B. {Collect ((\<cong>) x)}); xa \<in> B\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. xa \<cong> map \<phi> x
[PROOF STEP]
apply(erule equalityE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>xa \<in> A; (\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))}) \<subseteq> (\<Union>x\<in>B. {Collect ((\<cong>) x)}); (\<Union>x\<in>B. {Collect ((\<cong>) x)}) \<subseteq> (\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))})\<rbrakk> \<Longrightarrow> \<exists>x\<in>B. map \<phi> xa \<cong> x
 2. \<And>xa. \<lbrakk>(\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))}) = (\<Union>x\<in>B. {Collect ((\<cong>) x)}); xa \<in> B\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. xa \<cong> map \<phi> x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>(\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))}) = (\<Union>x\<in>B. {Collect ((\<cong>) x)}); xa \<in> B\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. xa \<cong> map \<phi> x
[PROOF STEP]
apply(erule equalityE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa \<in> B; (\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))}) \<subseteq> (\<Union>x\<in>B. {Collect ((\<cong>) x)}); (\<Union>x\<in>B. {Collect ((\<cong>) x)}) \<subseteq> (\<Union>x\<in>A. {Collect ((\<cong>) (map \<phi> x))})\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. xa \<cong> map \<phi> x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma steps_image:
  assumes "finite A" "mono_on A g" "inj_on g A"
  shows "steps A (f \<circ> g) l u v = steps (g ` A) f l u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. steps A (f \<circ> g) l u v = steps (g ` A) f l u v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. steps A (f \<circ> g) l u v = steps (g ` A) f l u v
[PROOF STEP]
have "(sorted_list_of_set (g ` A)) = map g (sorted_list_of_set A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (g ` A) = map g (sorted_list_of_set A)
[PROOF STEP]
using sorted_list_of_set_image assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mono_on ?A ?g; inj_on ?g ?A\<rbrakk> \<Longrightarrow> sorted_list_of_set (?g ` ?A) = map ?g (sorted_list_of_set ?A)
finite A
mono_on A g
inj_on g A

goal (1 subgoal):
 1. sorted_list_of_set (g ` A) = map g (sorted_list_of_set A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (g ` A) = map g (sorted_list_of_set A)

goal (1 subgoal):
 1. steps A (f \<circ> g) l u v = steps (g ` A) f l u v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (g ` A) = map g (sorted_list_of_set A)

goal (1 subgoal):
 1. steps A (f \<circ> g) l u v = steps (g ` A) f l u v
[PROOF STEP]
have "rev \<dots> = map g (rev (sorted_list_of_set A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (map g (sorted_list_of_set A)) = map g (rev (sorted_list_of_set A))
[PROOF STEP]
using rev_map
[PROOF STATE]
proof (prove)
using this:
rev (map ?f ?xs) = map ?f (rev ?xs)

goal (1 subgoal):
 1. rev (map g (sorted_list_of_set A)) = map g (rev (sorted_list_of_set A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rev (map g (sorted_list_of_set A)) = map g (rev (sorted_list_of_set A))

goal (1 subgoal):
 1. steps A (f \<circ> g) l u v = steps (g ` A) f l u v
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rev (sorted_list_of_set (g ` A)) = map g (rev (sorted_list_of_set A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rev (sorted_list_of_set (g ` A)) = map g (rev (sorted_list_of_set A))

goal (1 subgoal):
 1. steps A (f \<circ> g) l u v = steps (g ` A) f l u v
[PROOF STEP]
by (simp add: steps_lsteps lsteps_comp_map)
[PROOF STATE]
proof (state)
this:
steps A (f \<circ> g) l u v = steps (g ` A) f l u v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma automgroupTr1:"\<lbrakk>Group G; gbij\<^bsub>G,G\<^esub> f; gbij\<^bsub>G,G\<^esub> g; gbij\<^bsub>G,G\<^esub> h\<rbrakk> \<Longrightarrow>
                        (h \<circ>\<^bsub>G\<^esub> g) \<circ>\<^bsub>G\<^esub> f =  h \<circ>\<^bsub>G\<^esub> (g \<circ>\<^bsub>G\<^esub> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; gbij\<^bsub>G,G\<^esub> f; gbij\<^bsub>G,G\<^esub> g; gbij\<^bsub>G,G\<^esub> h\<rbrakk> \<Longrightarrow> h \<circ>\<^bsub>G\<^esub> g \<circ>\<^bsub>G\<^esub> f = h \<circ>\<^bsub>G\<^esub> (g \<circ>\<^bsub>G\<^esub> f)
[PROOF STEP]
apply (simp add:cmpghom_def,
       unfold gbijec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; gsurj\<^bsub>G,G\<^esub> f \<and> ginj\<^bsub>G,G\<^esub> f; gsurj\<^bsub>G,G\<^esub> g \<and> ginj\<^bsub>G,G\<^esub> g; gsurj\<^bsub>G,G\<^esub> h \<and> ginj\<^bsub>G,G\<^esub> h\<rbrakk> \<Longrightarrow> compose (carrier G) (compose (carrier G) h g) f = compose (carrier G) h (compose (carrier G) g f)
[PROOF STEP]
apply (frule conjunct1, rotate_tac 2, frule conjunct1,
        rotate_tac 1, frule conjunct1, fold gbijec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>gbij\<^bsub>G,G\<^esub> h; gsurj\<^bsub>G,G\<^esub> f; Group G; gbij\<^bsub>G,G\<^esub> f; gsurj\<^bsub>G,G\<^esub> g; gbij\<^bsub>G,G\<^esub> g; gsurj\<^bsub>G,G\<^esub> h\<rbrakk> \<Longrightarrow> compose (carrier G) (compose (carrier G) h g) f = compose (carrier G) h (compose (carrier G) g f)
[PROOF STEP]
apply (simp add:gsurjec_def, (erule conjE)+,
        frule gHom_func[of "G" "G" "f"], assumption+,
        frule gHom_func[of "G" "G" "g"], assumption+,
        frule gHom_func[of "G" "G" "h"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>gbij\<^bsub>G,G\<^esub> h; Group G; gbij\<^bsub>G,G\<^esub> f; gbij\<^bsub>G,G\<^esub> g; f \<in> gHom G G; surj_to f (carrier G) (carrier G); g \<in> gHom G G; surj_to g (carrier G) (carrier G); h \<in> gHom G G; surj_to h (carrier G) (carrier G); f \<in> carrier G \<rightarrow> carrier G; g \<in> carrier G \<rightarrow> carrier G; h \<in> carrier G \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> compose (carrier G) (compose (carrier G) h g) f = compose (carrier G) h (compose (carrier G) g f)
[PROOF STEP]
apply (simp add:compose_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma l8: "fact (p - 1) = \<Prod> S1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (p - 1) = \<Prod>S1
[PROOF STEP]
using l7[of "p - 1"] S1_def p_minus_1_int
[PROOF STATE]
proof (prove)
using this:
fact (p - 1) = \<Prod>{0<..int (p - 1)}
S1 = {0<..int p - 1}
int (p - 1) = int p - 1

goal (1 subgoal):
 1. fact (p - 1) = \<Prod>S1
[PROOF STEP]
by presburger


[STATEMENT]
lemma fine_division_exists_real:
  fixes a b :: real
  assumes "gauge g"
  obtains p where "p tagged_division_of {a .. b}" "g fine p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p tagged_division_of {a..b}; g fine p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms box_real(2) fine_division_exists)


[STATEMENT]
lemma conv_radius_zero [simp]: "conv_radius (\<lambda>_. 0) = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>_. 0::'a) = \<infinity>
[PROOF STEP]
by (auto simp: conv_radius_def zero_ereal_def [symmetric] Limsup_const)


[STATEMENT]
lemma (in complete_measure) AE_iff_null_sets: "(AE x in M. P x) \<longleftrightarrow> {x\<in>space M. \<not> P x} \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere M P = ({x \<in> space M. \<not> P x} \<in> null_sets M)
[PROOF STEP]
unfolding eventually_ae_filter
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bex (null_sets M) ((\<subseteq>) {x \<in> space M. \<not> P x}) = ({x \<in> space M. \<not> P x} \<in> null_sets M)
[PROOF STEP]
by (auto intro: complete2)


[STATEMENT]
lemma segment_eq_compose:
  fixes a :: "'a :: real_vector"
  shows "(\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) = (\<lambda>x. a + x) o (\<lambda>u. u *\<^sub>R (b - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) = (+) a \<circ> (\<lambda>u. u *\<^sub>R (b - a))
[PROOF STEP]
by (simp add: o_def algebra_simps)


[STATEMENT]
lemma lm086:
  assumes "x \<notin> X"
  shows  "(\<Union> f\<in>injections X Y. {f \<union> {(x, y)} | y . y \<in> Y-Range f}) \<subseteq>
          injections ({x} \<union> X) Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
using assms lm072 injections_def lm073 lm070
[PROOF STATE]
proof (prove)
using this:
x \<notin> X
\<lbrakk>?f \<in> injectionsUniverse; ?x \<notin> Domain ?f; ?A \<inter> Range ?f = {}\<rbrakk> \<Longrightarrow> {?f \<union> {(?x, y)} |y. y \<in> ?A} \<subseteq> injectionsUniverse
injections ?X ?Y = {R. Domain R = ?X \<and> Range R \<subseteq> ?Y \<and> runiq R \<and> runiq (R\<inverse>)}
injections ?X ?Y = totalRels ?X ?Y \<inter> injectionsUniverse
{?R \<union> {(?x, y)} |y. y \<in> ?A} \<subseteq> totalRels ({?x} \<union> Domain ?R) (?A \<union> Range ?R)

goal (1 subgoal):
 1. (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
assume "f \<in> injections X Y"
[PROOF STATE]
proof (state)
this:
f \<in> injections X Y

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> injections X Y
[PROOF STEP]
have
    0: "f \<in> injectionsUniverse & x \<notin> Domain f & Domain f = X & Range f \<subseteq> Y"
[PROOF STATE]
proof (prove)
using this:
f \<in> injections X Y

goal (1 subgoal):
 1. f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> injections X Y
x \<notin> X

goal (1 subgoal):
 1. f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y
[PROOF STEP]
unfolding injections_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}
x \<notin> X

goal (1 subgoal):
 1. f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y
[PROOF STEP]
have "f \<in> injectionsUniverse"
[PROOF STATE]
proof (prove)
using this:
f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y

goal (1 subgoal):
 1. f \<in> injectionsUniverse
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
f \<in> injectionsUniverse

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f \<in> injectionsUniverse

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
have "x \<notin> Domain f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> Domain f
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y

goal (1 subgoal):
 1. x \<notin> Domain f
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
x \<notin> Domain f

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<notin> Domain f

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
have
    1: "(Y-Range f) \<inter> Range f = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Y - Range f) \<inter> Range f = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(Y - Range f) \<inter> Range f = {}

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f \<in> injectionsUniverse
x \<notin> Domain f
(Y - Range f) \<inter> Range f = {}
[PROOF STEP]
have "{f \<union> {(x, y)} | y . y \<in> (Y-Range f)} \<subseteq> injectionsUniverse"
[PROOF STATE]
proof (prove)
using this:
f \<in> injectionsUniverse
x \<notin> Domain f
(Y - Range f) \<inter> Range f = {}

goal (1 subgoal):
 1. {f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> injectionsUniverse
[PROOF STEP]
by (rule lm072)
[PROOF STATE]
proof (state)
this:
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> injectionsUniverse

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> injectionsUniverse

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
have "{f \<union> {(x, y)} | y . y \<in> (Y-Range f)} \<subseteq> totalRels ({x} \<union> X) Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> totalRels ({x} \<union> X) Y
[PROOF STEP]
using lm070 0
[PROOF STATE]
proof (prove)
using this:
{?R \<union> {(?x, y)} |y. y \<in> ?A} \<subseteq> totalRels ({?x} \<union> Domain ?R) (?A \<union> Range ?R)
f \<in> injectionsUniverse \<and> x \<notin> Domain f \<and> Domain f = X \<and> Range f \<subseteq> Y

goal (1 subgoal):
 1. {f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> totalRels ({x} \<union> X) Y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> totalRels ({x} \<union> X) Y

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> injectionsUniverse
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> totalRels ({x} \<union> X) Y
[PROOF STEP]
have "{f \<union> {(x, y)} | y . y \<in> (Y-Range f)} \<subseteq>
                     injectionsUniverse \<inter> totalRels ({x}\<union>X) Y"
[PROOF STATE]
proof (prove)
using this:
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> injectionsUniverse
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> totalRels ({x} \<union> X) Y

goal (1 subgoal):
 1. {f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> injectionsUniverse \<inter> totalRels ({x} \<union> X) Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f \<union> {(x, y)} |y. y \<in> Y - Range f} \<subseteq> injectionsUniverse \<inter> totalRels ({x} \<union> X) Y

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?f2 \<in> injections X Y \<Longrightarrow> {?f2 \<union> {(x, y)} |y. y \<in> Y - Range ?f2} \<subseteq> injectionsUniverse \<inter> totalRels ({x} \<union> X) Y

goal (1 subgoal):
 1. \<lbrakk>x \<notin> X; \<And>f x A. \<lbrakk>f \<in> injectionsUniverse; x \<notin> Domain f; A \<inter> Range f = {}\<rbrakk> \<Longrightarrow> {f \<union> {(x, y)} |y. y \<in> A} \<subseteq> injectionsUniverse; \<And>X Y. injections X Y = {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}; \<And>X Y. injections X Y = totalRels X Y \<inter> injectionsUniverse; \<And>R x A. {R \<union> {(x, y)} |y. y \<in> A} \<subseteq> totalRels ({x} \<union> Domain R) (A \<union> Range R)\<rbrakk> \<Longrightarrow> (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?f2 \<in> injections X Y \<Longrightarrow> {?f2 \<union> {(x, y)} |y. y \<in> Y - Range ?f2} \<subseteq> injectionsUniverse \<inter> totalRels ({x} \<union> X) Y

goal (1 subgoal):
 1. (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
using lm008
[PROOF STATE]
proof (prove)
using this:
?f2 \<in> injections X Y \<Longrightarrow> {?f2 \<union> {(x, y)} |y. y \<in> Y - Range ?f2} \<subseteq> injectionsUniverse \<inter> totalRels ({x} \<union> X) Y
injections ?X ?Y = totalRels ?X ?Y \<inter> injectionsUniverse

goal (1 subgoal):
 1. (\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y
[PROOF STEP]
unfolding injections_def
[PROOF STATE]
proof (prove)
using this:
?f2 \<in> {R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)} \<Longrightarrow> {?f2 \<union> {(x, y)} |y. y \<in> Y - Range ?f2} \<subseteq> injectionsUniverse \<inter> totalRels ({x} \<union> X) Y
{R. Domain R = ?X \<and> Range R \<subseteq> ?Y \<and> runiq R \<and> runiq (R\<inverse>)} = totalRels ?X ?Y \<inter> injectionsUniverse

goal (1 subgoal):
 1. (\<Union>f\<in>{R. Domain R = X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> {R. Domain R = {x} \<union> X \<and> Range R \<subseteq> Y \<and> runiq R \<and> runiq (R\<inverse>)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>f\<in>injections X Y. {f \<union> {(x, y)} |y. y \<in> Y - Range f}) \<subseteq> injections ({x} \<union> X) Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIMSEQ_le_const: "X \<longlonglongrightarrow> x \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. a \<le> X n \<Longrightarrow> a \<le> x"
  for a x :: "'a::linorder_topology"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<longlonglongrightarrow> x; \<exists>N. \<forall>n\<ge>N. a \<le> X n\<rbrakk> \<Longrightarrow> a \<le> x
[PROOF STEP]
by (simp add: eventually_at_top_linorder tendsto_lowerbound)


[STATEMENT]
lemma hnorm_hyperpow: "\<And>(x::'a::{real_normed_div_algebra} star) n. hnorm (x pow n) = hnorm x pow n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. hnorm (x pow n) = hnorm x pow n
[PROOF STEP]
by transfer (rule norm_power)


[STATEMENT]
lemma finite_enumerate_Diff_singleton:
  fixes S :: "'a::wellorder set"
  assumes "finite S" and i: "i < card S" "enumerate S i < x"
  shows "enumerate (S - {x}) i = enumerate S i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < card S
wellorder_class.enumerate S i < x

goal (1 subgoal):
 1. wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i
[PROOF STEP]
proof (induction i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>0 < card S; wellorder_class.enumerate S 0 < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) 0 = wellorder_class.enumerate S 0
 2. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < card S
wellorder_class.enumerate S 0 < x

goal (2 subgoals):
 1. \<lbrakk>0 < card S; wellorder_class.enumerate S 0 < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) 0 = wellorder_class.enumerate S 0
 2. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
have "(LEAST i. i \<in> S \<and> i\<noteq>x) = (LEAST i. i \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST i. i \<in> S \<and> i \<noteq> x) = (LEAST i. i \<in> S)
[PROOF STEP]
proof (rule Least_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (LEAST i. i \<in> S) \<in> S \<and> (LEAST i. i \<in> S) \<noteq> x
 2. \<And>y. y \<in> S \<and> y \<noteq> x \<Longrightarrow> (LEAST i. i \<in> S) \<le> y
[PROOF STEP]
have "\<exists>t. t \<in> S \<and> t\<noteq>x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t. t \<in> S \<and> t \<noteq> x
[PROOF STEP]
using 0 \<open>finite S\<close> finite_enumerate_in_set
[PROOF STATE]
proof (prove)
using this:
0 < card S
wellorder_class.enumerate S 0 < x
finite S
\<lbrakk>finite ?S; ?n < card ?S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate ?S ?n \<in> ?S

goal (1 subgoal):
 1. \<exists>t. t \<in> S \<and> t \<noteq> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>t. t \<in> S \<and> t \<noteq> x

goal (2 subgoals):
 1. (LEAST i. i \<in> S) \<in> S \<and> (LEAST i. i \<in> S) \<noteq> x
 2. \<And>y. y \<in> S \<and> y \<noteq> x \<Longrightarrow> (LEAST i. i \<in> S) \<le> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>t. t \<in> S \<and> t \<noteq> x
[PROOF STEP]
show "(LEAST i. i \<in> S) \<in> S \<and> (LEAST i. i \<in> S) \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
\<exists>t. t \<in> S \<and> t \<noteq> x

goal (1 subgoal):
 1. (LEAST i. i \<in> S) \<in> S \<and> (LEAST i. i \<in> S) \<noteq> x
[PROOF STEP]
by (metis "0.prems"(2) LeastI enumerate_0 not_less_Least)
[PROOF STATE]
proof (state)
this:
(LEAST i. i \<in> S) \<in> S \<and> (LEAST i. i \<in> S) \<noteq> x

goal (1 subgoal):
 1. \<And>y. y \<in> S \<and> y \<noteq> x \<Longrightarrow> (LEAST i. i \<in> S) \<le> y
[PROOF STEP]
qed (simp add: Least_le)
[PROOF STATE]
proof (state)
this:
(LEAST i. i \<in> S \<and> i \<noteq> x) = (LEAST i. i \<in> S)

goal (2 subgoals):
 1. \<lbrakk>0 < card S; wellorder_class.enumerate S 0 < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) 0 = wellorder_class.enumerate S 0
 2. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(LEAST i. i \<in> S \<and> i \<noteq> x) = (LEAST i. i \<in> S)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(LEAST i. i \<in> S \<and> i \<noteq> x) = (LEAST i. i \<in> S)

goal (1 subgoal):
 1. wellorder_class.enumerate (S - {x}) 0 = wellorder_class.enumerate S 0
[PROOF STEP]
by (auto simp: enumerate_0)
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate (S - {x}) 0 = wellorder_class.enumerate S 0

goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i
Suc i < card S
wellorder_class.enumerate S (Suc i) < x

goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i
Suc i < card S
wellorder_class.enumerate S (Suc i) < x
[PROOF STEP]
have x: "enumerate S i < x"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i
Suc i < card S
wellorder_class.enumerate S (Suc i) < x

goal (1 subgoal):
 1. wellorder_class.enumerate S i < x
[PROOF STEP]
by (meson enumerate_step finite_enumerate_step less_trans)
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate S i < x

goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
have cardSx: "Suc i < card (S - {x})" and "i < card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc i < card (S - {x}) &&& i < card S
[PROOF STEP]
using Suc \<open>finite S\<close> card_Diff_singleton_if[of S] finite_enumerate_Ex
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i
Suc i < card S
wellorder_class.enumerate S (Suc i) < x
finite S
card (S - {?x}) = (if ?x \<in> S then card S - 1 else card S)
\<lbrakk>finite ?S; ?s \<in> ?S\<rbrakk> \<Longrightarrow> \<exists>n<card ?S. wellorder_class.enumerate ?S n = ?s

goal (1 subgoal):
 1. Suc i < card (S - {x}) &&& i < card S
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
Suc i < card (S - {x})
i < card S

goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
have "(LEAST s. s \<in> S \<and> s\<noteq>x \<and> enumerate (S - {x}) i < s) = (LEAST s. s \<in> S \<and> enumerate S i < s)"
       (is "_ = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST s. s \<in> S \<and> s \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < s) = (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)
[PROOF STEP]
proof (intro Least_equality conjI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<in> S
 2. (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<noteq> x
 3. wellorder_class.enumerate (S - {x}) i < (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)
 4. \<And>y. y \<in> S \<and> y \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < y \<Longrightarrow> (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<le> y
[PROOF STEP]
show "?r \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<in> S
[PROOF STEP]
by (metis (lifting) LeastI Suc.prems(1) assms(1) finite_enumerate_in_set finite_enumerate_step)
[PROOF STATE]
proof (state)
this:
(LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<in> S

goal (3 subgoals):
 1. (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<noteq> x
 2. wellorder_class.enumerate (S - {x}) i < (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)
 3. \<And>y. y \<in> S \<and> y \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < y \<Longrightarrow> (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<le> y
[PROOF STEP]
show "?r \<noteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<noteq> x
[PROOF STEP]
using Suc.prems not_less_Least [of _ "\<lambda>t. t \<in> S \<and> enumerate S i < t"]
       \<open>finite S\<close> finite_enumerate_in_set finite_enumerate_step
[PROOF STATE]
proof (prove)
using this:
Suc i < card S
wellorder_class.enumerate S (Suc i) < x
?k < (LEAST x. x \<in> S \<and> wellorder_class.enumerate S i < x) \<Longrightarrow> \<not> (?k \<in> S \<and> wellorder_class.enumerate S i < ?k)
finite S
\<lbrakk>finite ?S; ?n < card ?S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate ?S ?n \<in> ?S
\<lbrakk>finite ?S; Suc ?n < card ?S\<rbrakk> \<Longrightarrow> wellorder_class.enumerate ?S ?n < wellorder_class.enumerate ?S (Suc ?n)

goal (1 subgoal):
 1. (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<noteq> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<noteq> x

goal (2 subgoals):
 1. wellorder_class.enumerate (S - {x}) i < (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)
 2. \<And>y. y \<in> S \<and> y \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < y \<Longrightarrow> (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<le> y
[PROOF STEP]
show "enumerate (S - {x}) i < ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wellorder_class.enumerate (S - {x}) i < (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)
[PROOF STEP]
by (metis (full_types) Suc.IH Suc.prems(1) \<open>i < card S\<close> enumerate_Suc'' enumerate_step finite_enumerate_Suc'' finite_enumerate_step x)
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate (S - {x}) i < (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)

goal (1 subgoal):
 1. \<And>y. y \<in> S \<and> y \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < y \<Longrightarrow> (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<le> y
[PROOF STEP]
show "\<And>y. y \<in> S \<and> y \<noteq> x \<and> enumerate (S - {x}) i < y \<Longrightarrow> ?r \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> S \<and> y \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < y \<Longrightarrow> (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<le> y
[PROOF STEP]
by (simp add: Least_le Suc.IH \<open>i < card S\<close> x)
[PROOF STATE]
proof (state)
this:
?y \<in> S \<and> ?y \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < ?y \<Longrightarrow> (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s) \<le> ?y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(LEAST s. s \<in> S \<and> s \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < s) = (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)

goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i; Suc i < card S; wellorder_class.enumerate S (Suc i) < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(LEAST s. s \<in> S \<and> s \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < s) = (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(LEAST s. s \<in> S \<and> s \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < s) = (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)

goal (1 subgoal):
 1. wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
using Suc assms
[PROOF STATE]
proof (prove)
using this:
(LEAST s. s \<in> S \<and> s \<noteq> x \<and> wellorder_class.enumerate (S - {x}) i < s) = (LEAST s. s \<in> S \<and> wellorder_class.enumerate S i < s)
\<lbrakk>i < card S; wellorder_class.enumerate S i < x\<rbrakk> \<Longrightarrow> wellorder_class.enumerate (S - {x}) i = wellorder_class.enumerate S i
Suc i < card S
wellorder_class.enumerate S (Suc i) < x
finite S
i < card S
wellorder_class.enumerate S i < x

goal (1 subgoal):
 1. wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)
[PROOF STEP]
by (simp add: finite_enumerate_Suc'' cardSx)
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate (S - {x}) (Suc i) = wellorder_class.enumerate S (Suc i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_nth_one: "fds_nth 1 = (\<lambda>n. if n = 1 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth 1 = (\<lambda>n. if n = 1 then 1::'a else (0::'a))
[PROOF STEP]
by (simp add: one_fds_def fds_nth_fds fun_eq_iff)


[STATEMENT]
lemma PiE_ext: "\<lbrakk>x \<in> PiE k s; y \<in> PiE k s; \<And>i. i \<in> k \<Longrightarrow> x i = y i\<rbrakk> \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> Pi\<^sub>E k s; y \<in> Pi\<^sub>E k s; \<And>i. i \<in> k \<Longrightarrow> x i = y i\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis ext PiE_E)


[STATEMENT]
lemma OV_inv2_finite_obs_set:
   "s \<in> OV_inv2 \<Longrightarrow> finite (vote_set (obsv_state.obs s) Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> OV_inv2 \<Longrightarrow> finite (vote_set (obsv_state.obs s) Q)
[PROOF STEP]
apply(drule OV_inv2_finite_map_graph)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (map_graph (\<lambda>(x, y). obsv_state.obs s x y)) \<Longrightarrow> finite (vote_set (obsv_state.obs s) Q)
[PROOF STEP]
apply(clarsimp simp add: map_graph_def fun_graph_def vote_set_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {((a, b), y) |a b y. Some y = obsv_state.obs s a b} \<Longrightarrow> finite {uu_. \<exists>a r v. uu_ = (r, v) \<and> Some v = obsv_state.obs s r a \<and> a \<in> Q}
[PROOF STEP]
apply(erule finite_surj[where f="\<lambda>((r, a), v). (r, v)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {uu_. \<exists>a r v. uu_ = (r, v) \<and> Some v = obsv_state.obs s r a \<and> a \<in> Q} \<subseteq> (\<lambda>((r, a), v). (r, v)) ` {((a, b), y) |a b y. Some y = obsv_state.obs s a b}
[PROOF STEP]
by(force simp add: image_def)