[STATEMENT]
lemma scale_pos_left:
  assumes "c > 0"
  shows "vNM_utility outcomes relation (\<lambda>x. c * u x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vNM_utility outcomes relation (\<lambda>x. c * u x)
[PROOF STEP]
proof(standard, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
 2. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
 2. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
[PROOF STEP]
using vNM_utility_axioms vNM_utility_def
[PROOF STATE]
proof (prove)
using this:
vNM_utility outcomes relation u
vNM_utility ?outcomes ?relation ?u \<equiv> ?relation \<subseteq> \<P> ?outcomes \<times> \<P> ?outcomes \<and> (\<forall>p q. p \<in> \<P> ?outcomes \<longrightarrow> q \<in> \<P> ?outcomes \<longrightarrow> p \<succeq>[?relation] q = (measure_pmf.expectation q ?u \<le> measure_pmf.expectation p ?u))

goal (1 subgoal):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
relation \<subseteq> \<P> outcomes \<times> \<P> outcomes

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
case (2 p q)
[PROOF STATE]
proof (state)
this:
p \<in> \<P> outcomes
q \<in> \<P> outcomes

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have "q \<in> lotteries_on outcomes" and "p \<in> lotteries_on outcomes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<in> \<P> outcomes &&& p \<in> \<P> outcomes
[PROOF STEP]
using "2"(2)
[PROOF STATE]
proof (prove)
using this:
q \<in> \<P> outcomes

goal (1 subgoal):
 1. q \<in> \<P> outcomes &&& p \<in> \<P> outcomes
[PROOF STEP]
by (simp add: fnt "2"(1))+
[PROOF STATE]
proof (state)
this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes
[PROOF STEP]
have *: "p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)"
[PROOF STATE]
proof (prove)
using this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes

goal (1 subgoal):
 1. p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)
[PROOF STEP]
using expected_utility_weak_preference[of p q] assms
[PROOF STATE]
proof (prove)
using this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes
\<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z))
0 < c

goal (1 subgoal):
 1. p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have dist_c: "(\<Sum>z\<in>outcomes. (pmf q z) * (c * u z)) = c * (\<Sum>z\<in>outcomes. (pmf q z) * (u z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
[PROOF STEP]
using pos_distrib_left[of c q] assms
[PROOF STATE]
proof (prove)
using this:
0 < c \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
0 < c

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have dist_c': "(\<Sum>z\<in>outcomes. (pmf p z) * (c * u z)) = c * (\<Sum>z\<in>outcomes. (pmf p z) * (u z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using pos_distrib_left[of c p] assms
[PROOF STATE]
proof (prove)
using this:
0 < c \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)
0 < c

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have "p \<succeq> q \<longleftrightarrow> ((\<Sum>z\<in>outcomes. (pmf q z) * (c * u z)) \<le> (\<Sum>z\<in>outcomes. (pmf p z) * (c * u z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))
[PROOF STEP]
proof (rule iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<succeq> q \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
 2. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
assume "p \<succeq> q"
[PROOF STATE]
proof (state)
this:
p \<succeq> q

goal (2 subgoals):
 1. p \<succeq> q \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
 2. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<succeq> q
[PROOF STEP]
have "(\<Sum>z\<in>outcomes. pmf q z * (u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (u z))"
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using utility_ge
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q
?p \<succeq> ?q \<Longrightarrow> measure_pmf.expectation ?q u \<le> measure_pmf.expectation ?p u

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using "2"(1) "2"(2) sum_equals_pmf_expectation
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q
?p \<succeq> ?q \<Longrightarrow> measure_pmf.expectation ?q u \<le> measure_pmf.expectation ?p u
p \<in> \<P> outcomes
q \<in> \<P> outcomes
?p \<in> \<P> outcomes \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf ?p z * u z) = measure_pmf.expectation ?p u

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (2 subgoals):
 1. p \<succeq> q \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
 2. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
show "(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
[PROOF STEP]
using dist_c dist_c'
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
(\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
assume "(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))"
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
[PROOF STEP]
have "(\<Sum>z\<in>outcomes. pmf q z * (u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (u z))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using "2"(1) mult_le_cancel_iff2 assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
p \<in> \<P> outcomes
(0::?'a) < ?z \<Longrightarrow> (?z * ?x \<le> ?z * ?y) = (?x \<le> ?y)
0 < c

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
by (simp add: dist_c dist_c')
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
show "p \<succeq> q"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. p \<succeq> q
[PROOF STEP]
using "2"(2) assms "2"(1)
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
q \<in> \<P> outcomes
0 < c
p \<in> \<P> outcomes

goal (1 subgoal):
 1. p \<succeq> q
[PROOF STEP]
by (simp add: * sum_equals_pmf_expectation)
[PROOF STATE]
proof (state)
this:
p \<succeq> q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))

goal (1 subgoal):
 1. p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
by (simp add: "*" assms)
[PROOF STATE]
proof (state)
this:
p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_summable_on_reindex:
  assumes "(\<lambda>x. f (g x)) abs_summable_on A"
  shows   "f abs_summable_on (g ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
define g' where "g' = inv_into A g"
[PROOF STATE]
proof (state)
this:
g' = inv_into A g

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (g x)) abs_summable_on A
[PROOF STEP]
have "(\<lambda>x. f (g x)) abs_summable_on (g' ` g ` A)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (g x)) abs_summable_on A

goal (1 subgoal):
 1. (\<lambda>x. f (g x)) abs_summable_on g' ` g ` A
[PROOF STEP]
by (rule abs_summable_on_subset) (auto simp: g'_def inv_into_into)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x)) abs_summable_on g' ` g ` A

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x)) abs_summable_on g' ` g ` A

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
have "?this \<longleftrightarrow> (\<lambda>x. f (g (g' x))) abs_summable_on (g ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) abs_summable_on g' ` g ` A) = ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A)
[PROOF STEP]
unfolding g'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) abs_summable_on inv_into A g ` g ` A) = ((\<lambda>x. f (g (inv_into A g x))) abs_summable_on g ` A)
[PROOF STEP]
by (intro abs_summable_on_reindex_bij_betw [symmetric] inj_on_imp_bij_betw inj_on_inv_into) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g x)) abs_summable_on g' ` g ` A) = ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A)

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g x)) abs_summable_on g' ` g ` A) = ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A)

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
have "\<dots> \<longleftrightarrow> f abs_summable_on (g ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A) = (f abs_summable_on g ` A)
[PROOF STEP]
by (intro abs_summable_on_cong refl) (auto simp: g'_def f_inv_into_f)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g (g' x))) abs_summable_on g ` A) = (f abs_summable_on g ` A)

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f abs_summable_on g ` A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f abs_summable_on g ` A

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f abs_summable_on g ` A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_pos[intro]: "0 < n!"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n!
[PROOF STEP]
apply(induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < 0!
 2. \<And>n. 0 < n! \<Longrightarrow> 0 < Suc n!
[PROOF STEP]
apply(auto simp: fac.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mem_samp_primes_gt_2:
  shows "x \<in> set_spmf sample_primes \<Longrightarrow> x > 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set_spmf sample_primes \<Longrightarrow> 2 < x
[PROOF STEP]
apply (simp add: finite_prime_set sample_primes_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> prime_set \<Longrightarrow> 2 < x
[PROOF STEP]
using prime_set_ass
[PROOF STATE]
proof (prove)
using this:
prime_set \<subseteq> {x. prime x \<and> 2 < x}

goal (1 subgoal):
 1. x \<in> prime_set \<Longrightarrow> 2 < x
[PROOF STEP]
by blast


[STATEMENT]
lemma map_of_tabulate:
  "map_of (map (\<lambda>x. (x, f x)) xs) x \<noteq> None \<longleftrightarrow> x \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_of (map (\<lambda>x. (x, f x)) xs) x \<noteq> None) = (x \<in> set xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma s2r_union_hom: "s2r (A \<union> B) = s2r A \<union> s2r B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s2r (A \<union> B) = s2r A \<union> s2r B
[PROOF STEP]
by (simp add: Id_on_def)


[STATEMENT]
lemma n_diamond_star_induct_sup:
  "|x>n(y) \<squnion> n(z) \<le> n(y) \<Longrightarrow> |x\<^sup>\<star>>n(z) \<le> n(y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. | x > n y \<squnion> n z \<le> n y \<Longrightarrow> | x\<^sup>\<star> > n z \<le> n y
[PROOF STEP]
by (simp add: diamond_x_n n_dist_sup n_star_induct_sup)


[STATEMENT]
lemma eventually_nonzero_inverse [eventually_nonzero_simps]:
  "eventually_nonzero F (\<lambda>x. inverse (f x)) \<longleftrightarrow> eventually_nonzero F f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonzero F (\<lambda>x. inverse (f x)) = eventually_nonzero F f
[PROOF STEP]
unfolding eventually_nonzero_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. inverse (f x) \<noteq> (0::'b)) = (\<forall>\<^sub>F x in F. f x \<noteq> (0::'b))
[PROOF STEP]
by simp


[STATEMENT]
lemma quasi_transD: "\<lbrakk> x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; quasi_trans r \<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; quasi_trans r\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z
[PROOF STEP]
unfolding quasi_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; \<forall>x y z. x \<^bsub>r\<^esub>\<prec> y \<and> y \<^bsub>r\<^esub>\<prec> z \<longrightarrow> x \<^bsub>r\<^esub>\<prec> z\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_Collect_eq:
  fixes f g :: "'a::topological_space \<Rightarrow> 'b::t2_space"
  assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
  shows "closed {x. f x = g x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. f x = g x}
[PROOF STEP]
using open_Collect_neq[OF f g]
[PROOF STATE]
proof (prove)
using this:
open {x. f x \<noteq> g x}

goal (1 subgoal):
 1. closed {x. f x = g x}
[PROOF STEP]
by (simp add: closed_def Collect_neg_eq)


[STATEMENT]
lemma coeff_sym_mpoly_monom_of_set_eq_0:
  assumes "finite X" "Y \<subseteq> X" "card Y \<noteq> k"
  shows   "MPoly_Type.coeff (sym_mpoly X k) (monom_of_set Y) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (sym_mpoly X k) (monom_of_set Y) = (0::'a)
[PROOF STEP]
using assms finite_subset[of _ X]
[PROOF STATE]
proof (prove)
using this:
finite X
Y \<subseteq> X
card Y \<noteq> k
\<lbrakk>?A \<subseteq> X; finite X\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. MPoly_Type.coeff (sym_mpoly X k) (monom_of_set Y) = (0::'a)
[PROOF STEP]
by (auto simp: coeff_sym_mpoly)


[STATEMENT]
lemma index_non_zero_implies_no_group:
  assumes "ps \<subseteq> \<V>"
    and  "card ps = 2"
    and "\<B> index ps = \<Lambda>"
  shows "size {#b \<in>#  mset_set \<G> . ps \<subseteq> b#} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
have "\<And> G . G \<in> \<G> \<Longrightarrow>  \<not> ps \<subseteq> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>G. G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> G
[PROOF STEP]
using index_not_zero_impl_diff_group assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?ps \<subseteq> \<V>; card ?ps = 2; int (\<B> index ?ps) = \<Lambda>; ?G \<in> \<G>\<rbrakk> \<Longrightarrow> \<not> ?ps \<subseteq> ?G
ps \<subseteq> \<V>
card ps = 2
int (\<B> index ps) = \<Lambda>

goal (1 subgoal):
 1. \<And>G. G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G

goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G
[PROOF STEP]
have "{#b \<in>#  mset_set \<G> . ps \<subseteq> b#} = {#}"
[PROOF STATE]
proof (prove)
using this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G

goal (1 subgoal):
 1. filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}
[PROOF STEP]
using filter_mset_empty_if_finite_and_filter_set_empty
[PROOF STATE]
proof (prove)
using this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G
\<lbrakk>{x \<in> ?X. ?P x} = {}; finite ?X\<rbrakk> \<Longrightarrow> filter_mset ?P (mset_set ?X) = {#}

goal (1 subgoal):
 1. filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}

goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}

goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma harm_expand:
  "harm 0 = 0"
  "harm (Suc 0) = 1"
  "harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. harm 0 = (0::'a) &&& harm (Suc 0) = (1::'b) &&& harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
have "numeral n = Suc (pred_numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral n = Suc (pred_numeral n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
numeral n = Suc (pred_numeral n)

goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
numeral n = Suc (pred_numeral n)

goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
have "harm \<dots> = harm (pred_numeral n) + inverse (numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. harm (Suc (pred_numeral n)) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
by (subst harm_Suc, subst numeral_eq_Suc[symmetric]) simp
[PROOF STATE]
proof (state)
this:
harm (Suc (pred_numeral n)) = harm (pred_numeral n) + inverse (numeral n)

goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
show "harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)"
[PROOF STATE]
proof (prove)
using this:
harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)

goal (1 subgoal):
 1. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)

goal (2 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
[PROOF STEP]
qed (simp_all add: harm_def)


[STATEMENT]
lemma sigma0[simp]: "sigma(0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma 0 = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma mapM_None:
  "mapM f xs = None \<longleftrightarrow> (\<exists>x\<in>set xs. f x = None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mapM f xs = None) = (\<exists>x\<in>set xs. f x = None)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (mapM f [] = None) = (\<exists>x\<in>set []. f x = None)
 2. \<And>a xs. (mapM f xs = None) = (\<exists>x\<in>set xs. f x = None) \<Longrightarrow> (mapM f (a # xs) = None) = (\<exists>x\<in>set (a # xs). f x = None)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
(mapM f xs = None) = (\<exists>x\<in>set xs. f x = None)

goal (2 subgoals):
 1. (mapM f [] = None) = (\<exists>x\<in>set []. f x = None)
 2. \<And>a xs. (mapM f xs = None) = (\<exists>x\<in>set xs. f x = None) \<Longrightarrow> (mapM f (a # xs) = None) = (\<exists>x\<in>set (a # xs). f x = None)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(mapM f xs = None) = (\<exists>x\<in>set xs. f x = None)

goal (1 subgoal):
 1. (mapM f (x # xs) = None) = (\<exists>x\<in>set (x # xs). f x = None)
[PROOF STEP]
by (cases "f x", simp, cases "mapM f xs", auto)
[PROOF STATE]
proof (state)
this:
(mapM f (x # xs) = None) = (\<exists>x\<in>set (x # xs). f x = None)

goal (1 subgoal):
 1. (mapM f [] = None) = (\<exists>x\<in>set []. f x = None)
[PROOF STEP]
qed simp


[STATEMENT]
lemma quat_inner_i_left [simp]: "inner \<i> x = Im1 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> \<bullet> x = Im1 x
[PROOF STEP]
unfolding inner_quat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat.Re \<i> * quat.Re x + Im1 \<i> * Im1 x + Im2 \<i> * Im2 x + Im3 \<i> * Im3 x = Im1 x
[PROOF STEP]
by simp


[STATEMENT]
lemma poly_eval_map_indets: "poly_eval a (map_indets g p) = poly_eval (a \<circ> g) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_eval a (map_indets g p) = poly_eval (a \<circ> g) p
[PROOF STEP]
by (simp add: poly_eval_def poly_subst_map_indets comp_def)
      (simp add: poly_subst_def lookup_sum lookup_times_zero subst_pp_def lookup_prod_zero
          lookup_power_zero flip: times_monomial_left)


[STATEMENT]
lemma chain_union_closed':
  assumes \<open>is_chain f\<close> and \<open>(\<forall>n. f n \<in> C)\<close> and \<open>\<forall>S' \<in> C. \<forall>S \<subseteq> S'. S \<in> C\<close>
    and \<open>finite S'\<close> and \<open>S' \<subseteq> (\<Union>n. f n)\<close>
  shows \<open>S' \<in> C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
note \<open>finite S'\<close> and \<open>S' \<subseteq> (\<Union>n. f n)\<close>
[PROOF STATE]
proof (state)
this:
finite S'
S' \<subseteq> \<Union> (range f)

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S'
S' \<subseteq> \<Union> (range f)
[PROOF STEP]
obtain n where \<open>S' \<subseteq> f n\<close>
[PROOF STATE]
proof (prove)
using this:
finite S'
S' \<subseteq> \<Union> (range f)

goal (1 subgoal):
 1. (\<And>n. S' \<subseteq> f n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using chain_index \<open>is_chain f\<close>
[PROOF STATE]
proof (prove)
using this:
finite S'
S' \<subseteq> \<Union> (range f)
\<lbrakk>is_chain ?f; finite ?F; ?F \<subseteq> \<Union> (range ?f)\<rbrakk> \<Longrightarrow> \<exists>n. ?F \<subseteq> ?f n
is_chain f

goal (1 subgoal):
 1. (\<And>n. S' \<subseteq> f n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S' \<subseteq> f n

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S' \<subseteq> f n

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
have \<open>f n \<in> C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n \<in> C
[PROOF STEP]
using \<open>\<forall>n. f n \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n \<in> C

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

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S' \<subseteq> f n
f n \<in> C
[PROOF STEP]
show \<open>S' \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
S' \<subseteq> f n
f n \<in> C

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
using \<open>\<forall>S' \<in> C. \<forall>S \<subseteq> S'. S \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
S' \<subseteq> f n
f n \<in> C
\<forall>S'\<in>C. \<forall>S\<subseteq>S'. S \<in> C

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S' \<in> C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_list_filter_list_of_pdevs_of_list:
  fixes xs::"'a::comm_monoid_add list"
  assumes "\<And>x. x \<in> set xs \<Longrightarrow> x \<noteq> 0"
  shows "sum_list (filter p (map snd (list_of_pdevs (pdevs_of_list xs)))) = sum_list (filter p xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (filter p (map snd (list_of_pdevs (pdevs_of_list xs)))) = sum_list (filter p xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> ?x \<noteq> (0::'a)

goal (1 subgoal):
 1. sum_list (filter p (map snd (list_of_pdevs (pdevs_of_list xs)))) = sum_list (filter p xs)
[PROOF STEP]
by (auto simp: list_of_pdevs_pdevs_of_list_eq rev_filter[symmetric])


[STATEMENT]
lemma isCont_cot: "sin x \<noteq> 0 \<Longrightarrow> isCont cot x"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin x \<noteq> (0::'a) \<Longrightarrow> isCont cot x
[PROOF STEP]
by (rule DERIV_cot [THEN DERIV_isCont])


[STATEMENT]
lemma absolutely_integrable_scaleR_right:
  assumes "f absolutely_integrable_on S"
  shows "(\<lambda>x. f x *\<^sub>R c) absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x *\<^sub>R c) absolutely_integrable_on S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. f x *\<^sub>R c) absolutely_integrable_on S
[PROOF STEP]
by blast


[STATEMENT]
lemma i_expand_nth_0_upto_k_minus_1_if: "
  \<lbrakk> n = t * k + i; i < k \<rbrakk> \<Longrightarrow>
  (f \<odot>\<^sub>i k) n = (if i = 0 then f t else \<NoMsg>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n = t * k + i; i < k\<rbrakk> \<Longrightarrow> (f \<odot> k) n = (if i = 0 then f t else NoMsg)
[PROOF STEP]
by (simp add: i_expand_nth_if)


[STATEMENT]
lemma vars_in_right_only:
  "x \<in> vars q \<Longrightarrow> x \<notin> vars p \<Longrightarrow> x \<in> vars (p+q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> vars q; x \<notin> vars p\<rbrakk> \<Longrightarrow> x \<in> vars (p + q)
[PROOF STEP]
unfolding  vars_def keys_def plus_mpoly.rep_eq lookup_plus_fun
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of q)); x \<notin> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p))\<rbrakk> \<Longrightarrow> x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p + mapping_of q))
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>x \<notin> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p)); xa \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of q); x \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) xa\<rbrakk> \<Longrightarrow> x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p + mapping_of q))
[PROOF STEP]
subgoal for xa
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p)); xa \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of q); x \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) xa\<rbrakk> \<Longrightarrow> x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p + mapping_of q))
[PROOF STEP]
by (auto simp: vars_def keys_def plus_mpoly.rep_eq
      lookup_plus_fun intro!: exI[of _ xa] dest!: spec[of _ xa])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma circline_type_zero_card_eq1:
  assumes "circline_type H = 0"
  shows "\<exists> z. circline_set H = {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
have "\<exists> z. on_circline H z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. on_circline H z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
circline_type H = 0

goal (1 subgoal):
 1. \<exists>z. on_circline H z
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
fix H
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
assume hh: "hermitean H \<and> H \<noteq> mat_zero"
[PROOF STATE]
proof (state)
this:
hermitean H \<and> H \<noteq> mat_zero

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
obtain A B C D where HH: "H = (A, B, C, D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A B C D. H = (A, B, C, D) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases H) auto
[PROOF STATE]
proof (state)
this:
H = (A, B, C, D)

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
hence "C = cnj B" "is_real A" "is_real D"
[PROOF STATE]
proof (prove)
using this:
H = (A, B, C, D)

goal (1 subgoal):
 1. C = cnj B &&& is_real A &&& is_real D
[PROOF STEP]
using hh hermitean_elems[of A B C D]
[PROOF STATE]
proof (prove)
using this:
H = (A, B, C, D)
hermitean H \<and> H \<noteq> mat_zero
hermitean (A, B, C, D) \<Longrightarrow> is_real A
hermitean (A, B, C, D) \<Longrightarrow> is_real D
hermitean (A, B, C, D) \<Longrightarrow> B = cnj C
hermitean (A, B, C, D) \<Longrightarrow> cnj B = C

goal (1 subgoal):
 1. C = cnj B &&& is_real A &&& is_real D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C = cnj B
is_real A
is_real D

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
assume "circline_type_cmat H = 0"
[PROOF STATE]
proof (state)
this:
circline_type_cmat H = 0

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
hence "mat_det H = 0"
[PROOF STATE]
proof (prove)
using this:
circline_type_cmat H = 0

goal (1 subgoal):
 1. mat_det H = 0
[PROOF STEP]
by (simp add: complex_eq_if_Re_eq hh mat_det_hermitean_real sgn_eq_0_iff)
[PROOF STATE]
proof (state)
this:
mat_det H = 0

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
hence "A*D = B*C"
[PROOF STATE]
proof (prove)
using this:
mat_det H = 0

goal (1 subgoal):
 1. A * D = B * C
[PROOF STEP]
using HH
[PROOF STATE]
proof (prove)
using this:
mat_det H = 0
H = (A, B, C, D)

goal (1 subgoal):
 1. A * D = B * C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * D = B * C

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
show "Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
proof (cases "A \<noteq> 0 \<or> B \<noteq> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<noteq> 0 \<or> B \<noteq> 0 \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
 2. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A \<noteq> 0 \<or> B \<noteq> 0

goal (2 subgoals):
 1. A \<noteq> 0 \<or> B \<noteq> 0 \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
 2. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0 \<or> B \<noteq> 0

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
using HH \<open>A*D = B*C\<close>
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0 \<or> B \<noteq> 0
H = (A, B, C, D)
A * D = B * C

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
by (rule_tac x="(-B, A)" in bexI) (auto simp add: Let_def vec_cnj_def field_simps)
[PROOF STATE]
proof (state)
this:
Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)

goal (1 subgoal):
 1. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (A \<noteq> 0 \<or> B \<noteq> 0)

goal (1 subgoal):
 1. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (A \<noteq> 0 \<or> B \<noteq> 0)

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
using HH \<open>C = cnj B\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (A \<noteq> 0 \<or> B \<noteq> 0)
H = (A, B, C, D)
C = cnj B

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
by (rule_tac x="(1, 0)" in bexI) (simp_all add: Let_def vec_cnj_def)
[PROOF STATE]
proof (state)
this:
Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>z. on_circline H z

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. on_circline H z
[PROOF STEP]
obtain z where "on_circline H z"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. on_circline H z

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

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
obtain M where "moebius_pt M z = 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. moebius_pt M z = 0\<^sub>h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_moebius_1[of z]
[PROOF STATE]
proof (prove)
using this:
\<exists>M. moebius_pt M z = ?w1.0

goal (1 subgoal):
 1. (\<And>M. moebius_pt M z = 0\<^sub>h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt M z = 0\<^sub>h

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
hence "0\<^sub>h \<in> circline_set (moebius_circline M H)"
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z = 0\<^sub>h

goal (1 subgoal):
 1. 0\<^sub>h \<in> circline_set (moebius_circline M H)
[PROOF STEP]
using on_circline_moebius_circline_I[OF \<open>on_circline H z\<close>, of M]
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z = 0\<^sub>h
on_circline (moebius_circline M H) (moebius_pt M z)

goal (1 subgoal):
 1. 0\<^sub>h \<in> circline_set (moebius_circline M H)
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z = 0\<^sub>h
on_circline (moebius_circline M H) (moebius_pt M z)

goal (1 subgoal):
 1. 0\<^sub>h \<in> Collect (on_circline (moebius_circline M H))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0\<^sub>h \<in> circline_set (moebius_circline M H)

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
hence "circline_set (moebius_circline M H) = {0\<^sub>h}"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> circline_set (moebius_circline M H)

goal (1 subgoal):
 1. circline_set (moebius_circline M H) = {0\<^sub>h}
[PROOF STEP]
using circline_type_zero_card_eq1_0[of "moebius_circline M H"] \<open>circline_type H = 0\<close>
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> circline_set (moebius_circline M H)
\<lbrakk>circline_type (moebius_circline M H) = 0; 0\<^sub>h \<in> circline_set (moebius_circline M H)\<rbrakk> \<Longrightarrow> circline_set (moebius_circline M H) = {0\<^sub>h}
circline_type H = 0

goal (1 subgoal):
 1. circline_set (moebius_circline M H) = {0\<^sub>h}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
circline_set (moebius_circline M H) = {0\<^sub>h}

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
hence "circline_set H = {z}"
[PROOF STATE]
proof (prove)
using this:
circline_set (moebius_circline M H) = {0\<^sub>h}

goal (1 subgoal):
 1. circline_set H = {z}
[PROOF STEP]
using \<open>moebius_pt M z = 0\<^sub>h\<close>
[PROOF STATE]
proof (prove)
using this:
circline_set (moebius_circline M H) = {0\<^sub>h}
moebius_pt M z = 0\<^sub>h

goal (1 subgoal):
 1. circline_set H = {z}
[PROOF STEP]
using bij_moebius_pt[of M] bij_image_singleton[of "moebius_pt M" "circline_set H" _ z]
[PROOF STATE]
proof (prove)
using this:
circline_set (moebius_circline M H) = {0\<^sub>h}
moebius_pt M z = 0\<^sub>h
bij (moebius_pt M)
\<lbrakk>moebius_pt M ` circline_set H = {?b}; moebius_pt M z = ?b; bij (moebius_pt M)\<rbrakk> \<Longrightarrow> circline_set H = {z}

goal (1 subgoal):
 1. circline_set H = {z}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
circline_set H = {z}

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
circline_set H = {z}

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z. circline_set H = {z}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_boolean_algebra_generator_subset:
  assumes "A \<in> gen_boolean_algebra S As"
  assumes "As \<subseteq> Bs"
  shows "A \<in> gen_boolean_algebra S Bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply(rule gen_boolean_algebra.induct[of A S As])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. A \<in> gen_boolean_algebra S As
 2. S \<in> gen_boolean_algebra S Bs
 3. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 4. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 5. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
A \<in> gen_boolean_algebra S As

goal (5 subgoals):
 1. A \<in> gen_boolean_algebra S As
 2. S \<in> gen_boolean_algebra S Bs
 3. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 4. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 5. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. S \<in> gen_boolean_algebra S Bs
 2. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 3. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 4. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply (simp add: gen_boolean_algebra.intros(1); fail)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 2. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 3. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply (meson Set.basic_monos(7) assms(2) gen_boolean_algebra.intros(2))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 2. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
using gen_boolean_algebra.intros(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> gen_boolean_algebra ?S ?B; ?C \<in> gen_boolean_algebra ?S ?B\<rbrakk> \<Longrightarrow> ?A \<union> ?C \<in> gen_boolean_algebra ?S ?B

goal (2 subgoals):
 1. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 2. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
using gen_boolean_algebra.intros(4)
[PROOF STATE]
proof (prove)
using this:
?A \<in> gen_boolean_algebra ?S ?B \<Longrightarrow> ?S - ?A \<in> gen_boolean_algebra ?S ?B

goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
by blast


[STATEMENT]
lemma limpt_sequential_inj:
  fixes x :: "'a::metric_space"
  shows "x islimpt S \<longleftrightarrow>
         (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> inj f \<and> (f \<longlongrightarrow> x) sequentially)"
         (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = (\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
x islimpt S

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x islimpt S
[PROOF STEP]
have "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e"
[PROOF STATE]
proof (prove)
using this:
x islimpt S

goal (1 subgoal):
 1. \<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e
[PROOF STEP]
by (force simp: islimpt_approachable)
[PROOF STATE]
proof (state)
this:
\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e
[PROOF STEP]
obtain y where y: "\<And>e. e>0 \<Longrightarrow> y e \<in> S \<and> y e \<noteq> x \<and> dist (y e) x < e"
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e

goal (1 subgoal):
 1. (\<And>y. (\<And>e. 0 < e \<Longrightarrow> y e \<in> S \<and> y e \<noteq> x \<and> dist (y e) x < e) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> y ?e \<in> S \<and> y ?e \<noteq> x \<and> dist (y ?e) x < ?e

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
define f where "f \<equiv> rec_nat (y 1) (\<lambda>n fn. y (min (inverse(2 ^ (Suc n))) (dist fn x)))"
[PROOF STATE]
proof (state)
this:
f \<equiv> rec_nat (y 1) (\<lambda>n fn. y (min (inverse (2 ^ Suc n)) (dist fn x)))

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
have [simp]: "f 0 = y 1"
               "f(Suc n) = y (min (inverse(2 ^ (Suc n))) (dist (f n) x))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f 0 = y 1 &&& f (Suc n) = y (min (inverse (2 ^ Suc n)) (dist (f n) x))
[PROOF STEP]
by (simp_all add: f_def)
[PROOF STATE]
proof (state)
this:
f 0 = y 1
f (Suc ?n) = y (min (inverse (2 ^ Suc ?n)) (dist (f ?n) x))

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
have f: "f n \<in> S \<and> (f n \<noteq> x) \<and> dist (f n) x < inverse(2 ^ n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)
 2. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)
 2. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)
[PROOF STEP]
by (simp add: y)
[PROOF STATE]
proof (state)
this:
f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)

goal (1 subgoal):
 1. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)

goal (1 subgoal):
 1. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)

goal (1 subgoal):
 1. f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
apply (auto simp: y)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f n \<in> S; f n \<noteq> x; dist (f n) x < inverse (2 ^ n)\<rbrakk> \<Longrightarrow> dist (y (min (inverse (2 ^ n) / 2) (dist (f n) x))) x * 2 < inverse (2 ^ n)
[PROOF STEP]
by (metis half_gt_zero_iff inverse_positive_iff_positive less_divide_eq_numeral1(1) min_less_iff_conj y zero_less_dist_iff zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ?n \<in> S \<and> f ?n \<noteq> x \<and> dist (f ?n) x < inverse (2 ^ ?n)

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
proof (rule_tac x=f in exI, intro conjI allI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. f n \<in> S - {x}
 2. inj f
 3. f \<longlonglongrightarrow> x
[PROOF STEP]
show "\<And>n. f n \<in> S - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. f n \<in> S - {x}
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f ?n \<in> S \<and> f ?n \<noteq> x \<and> dist (f ?n) x < inverse (2 ^ ?n)

goal (1 subgoal):
 1. \<And>n. f n \<in> S - {x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f ?n \<in> S - {x}

goal (2 subgoals):
 1. inj f
 2. f \<longlonglongrightarrow> x
[PROOF STEP]
have "dist (f n) x < dist (f m) x" if "m < n" for m n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m < n

goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m < 0 \<Longrightarrow> dist (f 0) x < dist (f m) x
 2. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
m < 0

goal (2 subgoals):
 1. m < 0 \<Longrightarrow> dist (f 0) x < dist (f m) x
 2. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m < 0

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

goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n
[PROOF STEP]
consider "m < n" | "m = n"
[PROOF STATE]
proof (prove)
using this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n

goal (1 subgoal):
 1. \<lbrakk>m < n \<Longrightarrow> thesis; m = n \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n
(?m < Suc ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. \<lbrakk>m < n \<Longrightarrow> thesis; m = n \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>m < n \<Longrightarrow> ?thesis; m = n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>m < n \<Longrightarrow> ?thesis; m = n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>m < n \<Longrightarrow> ?thesis; m = n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
assume "m < n"
[PROOF STATE]
proof (state)
this:
m < n

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
have "dist (f(Suc n)) x = dist (y (min (inverse(2 ^ (Suc n))) (dist (f n) x))) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f (Suc n)) x = dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x = dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x = dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
have "\<dots> < dist (f n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x < dist (f n) x
[PROOF STEP]
by (metis dist_pos_lt f min.strict_order_iff min_less_iff_conj y)
[PROOF STATE]
proof (state)
this:
dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x < dist (f n) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x < dist (f n) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
have "\<dots> < dist (f m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
using Suc.IH \<open>m < n\<close>
[PROOF STATE]
proof (prove)
using this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < n

goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dist (f n) x < dist (f m) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (f (Suc n)) x < dist (f m) x

goal (1 subgoal):
 1. dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x < dist (f m) x

goal (1 subgoal):
 1. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
assume "m = n"
[PROOF STATE]
proof (state)
this:
m = n

goal (1 subgoal):
 1. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m = n

goal (1 subgoal):
 1. dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
by simp (metis dist_pos_lt f half_gt_zero_iff inverse_positive_iff_positive min_less_iff_conj y zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x < dist (f m) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x < dist (f m) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?m < ?n \<Longrightarrow> dist (f ?n) x < dist (f ?m) x

goal (2 subgoals):
 1. inj f
 2. f \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?m < ?n \<Longrightarrow> dist (f ?n) x < dist (f ?m) x
[PROOF STEP]
show "inj f"
[PROOF STATE]
proof (prove)
using this:
?m < ?n \<Longrightarrow> dist (f ?n) x < dist (f ?m) x

goal (1 subgoal):
 1. inj f
[PROOF STEP]
by (metis less_irrefl linorder_injI)
[PROOF STATE]
proof (state)
this:
inj f

goal (1 subgoal):
 1. f \<longlonglongrightarrow> x
[PROOF STEP]
show "f \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> x
[PROOF STEP]
apply (rule tendstoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F xa in sequentially. dist (f xa) x < e
[PROOF STEP]
apply (rule_tac c="nat (ceiling(1/e))" in eventually_sequentiallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e xa. \<lbrakk>0 < e; nat \<lceil>1 / e\<rceil> \<le> xa\<rbrakk> \<Longrightarrow> dist (f xa) x < e
[PROOF STEP]
apply (rule less_trans [OF f [THEN conjunct2, THEN conjunct2]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e x. \<lbrakk>0 < e; nat \<lceil>1 / e\<rceil> \<le> x\<rbrakk> \<Longrightarrow> inverse (2 ^ x) < e
[PROOF STEP]
apply (simp add: field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e x. \<lbrakk>0 < e; 1 \<le> e * real x\<rbrakk> \<Longrightarrow> 1 < e * 2 ^ x
[PROOF STEP]
by (meson le_less_trans mult_less_cancel_left not_le of_nat_less_two_power)
[PROOF STATE]
proof (state)
this:
f \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. x islimpt S
[PROOF STEP]
by (fastforce simp add: islimpt_approachable lim_sequentially)
[PROOF STATE]
proof (state)
this:
x islimpt S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_lub_simps[simp]:
    "fun_lub lub {} = (\<lambda>x. lub {})"
    "fun_lub lub {f} = (\<lambda>x. lub {f x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fun_lub lub {} = (\<lambda>x. lub {}) &&& fun_lub lub {f} = (\<lambda>x. lub {f x})
[PROOF STEP]
unfolding fun_lub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. lub {y. \<exists>f\<in>{}. y = f x}) = (\<lambda>x. lub {}) &&& (\<lambda>x. lub {y. \<exists>f\<in>{f}. y = f x}) = (\<lambda>x. lub {f x})
[PROOF STEP]
by auto


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

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* first, obtain a composable reducer machine Red *)
[PROOF STATE]
proof (state)
this:
turing_reducible A B
turing_decidable B

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
from \<open>turing_reducible A B\<close>
[PROOF STATE]
proof (chain)
picking this:
turing_reducible A B
[PROOF STEP]
have "\<exists>Red. composable_tm0 Red \<and>
               (\<forall>nl::nat list. \<exists>ml::nat list. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B))"
[PROOF STATE]
proof (prove)
using this:
turing_reducible A B

goal (1 subgoal):
 1. \<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
by (rule turing_reducible_A_B_imp_composable_reducer_ex)
[PROOF STATE]
proof (state)
this:
\<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
obtain Red where
    w_RedTM: "composable_tm0 Red \<and>
               (\<forall>nl::nat list. \<exists>ml::nat list. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B))"
[PROOF STATE]
proof (prove)
using this:
\<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. (\<And>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* second, obtain a decider DB for problem B *)
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
from \<open>turing_decidable B\<close>
[PROOF STATE]
proof (chain)
picking this:
turing_decidable B
[PROOF STEP]
have "(\<exists>D. (\<forall>nl::nat list.
           (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl (1::nat))
         \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl (0::nat))
       ))"
[PROOF STATE]
proof (prove)
using this:
turing_decidable B

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
unfolding turing_decidable_unfolded_into_TMC_yields_conditions
[PROOF STATE]
proof (prove)
using this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
obtain DB where
    w_DB: "(\<forall>nl.
           (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl (1::nat))
         \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl (0::nat))
       )"
[PROOF STATE]
proof (prove)
using this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)

goal (1 subgoal):
 1. (\<And>DB. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* third, define the composed machine DA = Red |+| DB that is able to decide A *)
[PROOF STATE]
proof (state)
this:
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
define DA where "DA = Red |+| DB"
[PROOF STATE]
proof (state)
this:
DA = Red |+| DB

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* now, go for the main part of the proof *)
[PROOF STATE]
proof (state)
this:
DA = Red |+| DB

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
show "turing_decidable A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. turing_decidable A
[PROOF STEP]
unfolding turing_decidable_unfolded_into_TMC_yields_conditions
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
have "\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl (1::nat)) \<and>
                 (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl (0::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
proof (rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
fix nl
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
show "(nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl (1::nat)) \<and>
              (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl (0::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1
 2. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
show "nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
assume "nl \<in> A"
[PROOF STATE]
proof (state)
this:
nl \<in> A

goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
from \<open>nl \<in> A\<close> and w_RedTM
[PROOF STATE]
proof (chain)
picking this:
nl \<in> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
obtain ml where w_ml: "composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B)"
[PROOF STATE]
proof (prove)
using this:
nl \<in> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. (\<And>ml. composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
with \<open>nl \<in> A\<close> w_DB
[PROOF STATE]
proof (chain)
picking this:
nl \<in> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
[PROOF STEP]
have "TMC_yields_num_res (Red |+| DB) nl  (1::nat)"
[PROOF STATE]
proof (prove)
using this:
nl \<in> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 1
[PROOF STEP]
using TMC_yields_num_res_Hoare_plus_halt
[PROOF STATE]
proof (prove)
using this:
nl \<in> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
\<lbrakk>TMC_yields_num_list_res ?tm1.0 ?nl ?r1.0; TMC_yields_num_res ?tm2.0 ?r1.0 ?r2.0; composable_tm0 ?tm1.0\<rbrakk> \<Longrightarrow> TMC_yields_num_res (?tm1.0 |+| ?tm2.0) ?nl ?r2.0

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
TMC_yields_num_res (Red |+| DB) nl 1

goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
TMC_yields_num_res (Red |+| DB) nl 1
[PROOF STEP]
show "TMC_yields_num_res DA nl 1"
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 1

goal (1 subgoal):
 1. TMC_yields_num_res DA nl 1
[PROOF STEP]
using DA_def
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 1
DA = Red |+| DB

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1

goal (1 subgoal):
 1. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
show "nl \<notin> A \<longrightarrow>  TMC_yields_num_res DA nl 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
assume "nl \<notin> A"
[PROOF STATE]
proof (state)
this:
nl \<notin> A

goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
from \<open>nl \<notin> A\<close> and w_RedTM
[PROOF STATE]
proof (chain)
picking this:
nl \<notin> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
obtain ml where w_ml: "composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B)"
[PROOF STATE]
proof (prove)
using this:
nl \<notin> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. (\<And>ml. composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
with \<open>nl \<notin> A\<close> w_DB
[PROOF STATE]
proof (chain)
picking this:
nl \<notin> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
[PROOF STEP]
have "TMC_yields_num_res (Red |+| DB) nl  (0::nat)"
[PROOF STATE]
proof (prove)
using this:
nl \<notin> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 0
[PROOF STEP]
using TMC_yields_num_res_Hoare_plus_halt
[PROOF STATE]
proof (prove)
using this:
nl \<notin> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
\<lbrakk>TMC_yields_num_list_res ?tm1.0 ?nl ?r1.0; TMC_yields_num_res ?tm2.0 ?r1.0 ?r2.0; composable_tm0 ?tm1.0\<rbrakk> \<Longrightarrow> TMC_yields_num_res (?tm1.0 |+| ?tm2.0) ?nl ?r2.0

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
TMC_yields_num_res (Red |+| DB) nl 0

goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
TMC_yields_num_res (Red |+| DB) nl 0
[PROOF STEP]
show "TMC_yields_num_res DA nl 0"
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 0

goal (1 subgoal):
 1. TMC_yields_num_res DA nl 0
[PROOF STEP]
using DA_def
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 0
DA = Red |+| DB

goal (1 subgoal):
 1. TMC_yields_num_res DA nl 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
TMC_yields_num_res DA nl 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
show "\<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma locally_connected_sphere:
  fixes a :: "'a::euclidean_space"
  shows "locally connected(sphere a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected (sphere a r)
[PROOF STEP]
using ANR_imp_locally_connected ANR_sphere
[PROOF STATE]
proof (prove)
using this:
ANR ?S \<Longrightarrow> locally connected ?S
ANR (sphere ?a ?r)

goal (1 subgoal):
 1. locally connected (sphere a r)
[PROOF STEP]
by blast


[STATEMENT]
lemma set_of_mkt_bal_l:
  "\<lbrakk> avl l; avl r \<rbrakk> \<Longrightarrow>
  set_of (mkt_bal_l n l r) = Set.insert n (set_of l \<union> set_of r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>avl l; avl r\<rbrakk> \<Longrightarrow> set_of (mkt_bal_l n l r) = Set.insert n (set_of l \<union> set_of r)
[PROOF STEP]
by (auto simp: mkt_def split:tree.splits)


[STATEMENT]
lemma Rep_combine_matrix[simp]: "f 0 0 = 0 \<Longrightarrow> Rep_matrix (combine_matrix f A B) j i = f (Rep_matrix A j i) (Rep_matrix B j i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'b) (0::'c) = (0::'a) \<Longrightarrow> Rep_matrix (combine_matrix f A B) j i = f (Rep_matrix A j i) (Rep_matrix B j i)
[PROOF STEP]
by(simp add: combine_matrix_def)


[STATEMENT]
lemma degree_sum_le_Max:
  "finite F \<Longrightarrow> degree (sum f F) \<le> Max ((\<lambda>x. degree (f x))`F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite F \<Longrightarrow> degree (sum f F) \<le> (MAX x\<in>F. degree (f x))
[PROOF STEP]
by (intro degree_sum_le) (auto intro!: Max.coboundedI)


[STATEMENT]
lemma rot_diamond_cube_boundary_valid:
  assumes "(k,\<gamma>)\<in>boundary (rot_diamond_cube)"
  shows "valid_path \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
using d_gt_0 swap_valid_boundaries diamond_cube_boundary_valid
[PROOF STATE]
proof (prove)
using this:
0 < d
\<lbrakk>\<forall>(k, \<gamma>)\<in>boundary ?C. valid_path \<gamma>; (?k, ?\<gamma>) \<in> boundary (prod.swap \<circ> ?C \<circ> prod.swap)\<rbrakk> \<Longrightarrow> valid_path ?\<gamma>
(?k, ?\<gamma>) \<in> boundary diamond_cube \<Longrightarrow> valid_path ?\<gamma>

goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
using assms diamond_cube_is_type_I rot_diamond_cube_def
[PROOF STATE]
proof (prove)
using this:
0 < d
\<lbrakk>\<forall>(k, \<gamma>)\<in>boundary ?C. valid_path \<gamma>; (?k, ?\<gamma>) \<in> boundary (prod.swap \<circ> ?C \<circ> prod.swap)\<rbrakk> \<Longrightarrow> valid_path ?\<gamma>
(?k, ?\<gamma>) \<in> boundary diamond_cube \<Longrightarrow> valid_path ?\<gamma>
(k, \<gamma>) \<in> boundary rot_diamond_cube
typeI_twoCube diamond_cube
rot_diamond_cube = prod.swap \<circ> diamond_cube \<circ> prod.swap

goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
by fastforce