[STATEMENT]
lemma compact_imp_seq_compact:
  fixes U :: "'a :: first_countable_topology set"
  assumes "compact U"
  shows "seq_compact U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_compact U
[PROOF STEP]
unfolding seq_compact_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. (\<forall>n. f n \<in> U) \<longrightarrow> (\<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
fix X :: "nat \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
assume "\<forall>n. X n \<in> U"
[PROOF STATE]
proof (state)
this:
\<forall>n. X n \<in> U

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. X n \<in> U
[PROOF STEP]
have "eventually (\<lambda>x. x \<in> U) (filtermap X sequentially)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. X n \<in> U

goal (1 subgoal):
 1. \<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
[PROOF STEP]
by (auto simp: eventually_filtermap)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "filtermap X sequentially \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap X sequentially \<noteq> bot
[PROOF STEP]
by (simp add: trivial_limit_def eventually_filtermap)
[PROOF STATE]
proof (state)
this:
filtermap X sequentially \<noteq> bot

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
filtermap X sequentially \<noteq> bot
[PROOF STEP]
obtain x where "x \<in> U" and x: "inf (nhds x) (filtermap X sequentially) \<noteq> bot" (is "?F \<noteq> _")
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
filtermap X sequentially \<noteq> bot

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> U; inf (nhds x) (filtermap X sequentially) \<noteq> bot\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>compact U\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<in> U
filtermap X sequentially \<noteq> bot
compact U

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> U; inf (nhds x) (filtermap X sequentially) \<noteq> bot\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: compact_filter)
[PROOF STATE]
proof (state)
this:
x \<in> U
inf (nhds x) (filtermap X sequentially) \<noteq> bot

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
from countable_basis_at_decseq[of x]
[PROOF STATE]
proof (chain)
picking this:
(\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> S\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain A where A:
      "\<And>i. open (A i)"
      "\<And>i. x \<in> A i"
      "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
[PROOF STATE]
proof (prove)
using this:
(\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> S\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
open (A ?i)
x \<in> A ?i
\<lbrakk>open ?S; x \<in> ?S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> ?S

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
define s where "s n i = (SOME j. i < j \<and> X j \<in> A (Suc n))" for n i
[PROOF STATE]
proof (state)
this:
s ?n ?i = (SOME j. ?i < j \<and> X j \<in> A (Suc ?n))

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
s ?n ?i = (SOME j. ?i < j \<and> X j \<in> A (Suc ?n))

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
fix n i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "\<exists>a. i < a \<and> X a \<in> A (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a>i. X a \<in> A (Suc n)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<exists>a>i. X a \<in> A (Suc n))"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>a>i. X a \<in> A (Suc n))

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>a>i. X a \<in> A (Suc n))
[PROOF STEP]
have "\<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>a>i. X a \<in> A (Suc n))

goal (1 subgoal):
 1. \<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc i \<le> ?a \<Longrightarrow> X ?a \<notin> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc i \<le> ?a \<Longrightarrow> X ?a \<notin> A (Suc n)
[PROOF STEP]
have "eventually (\<lambda>x. x \<notin> A (Suc n)) (filtermap X sequentially)"
[PROOF STATE]
proof (prove)
using this:
Suc i \<le> ?a \<Longrightarrow> X ?a \<notin> A (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)
[PROOF STEP]
by (auto simp: eventually_filtermap eventually_sequentially)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
have "eventually (\<lambda>x. x \<in> A (Suc n)) (nhds x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)
[PROOF STEP]
using A(1,2)[of "Suc n"]
[PROOF STATE]
proof (prove)
using this:
open (A (Suc n))
x \<in> A (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)
[PROOF STEP]
by (auto simp: eventually_nhds)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)
\<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)
[PROOF STEP]
have "eventually (\<lambda>x. False) ?F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in filtermap X sequentially. x \<notin> A (Suc n)
\<forall>\<^sub>F x in nhds x. x \<in> A (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False
[PROOF STEP]
by (auto simp: eventually_inf)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False

goal (1 subgoal):
 1. \<not> (\<exists>a>i. X a \<in> A (Suc n)) \<Longrightarrow> False
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
inf (nhds x) (filtermap X sequentially) \<noteq> bot
\<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
inf (nhds x) (filtermap X sequentially) \<noteq> bot
\<forall>\<^sub>F x in inf (nhds x) (filtermap X sequentially). False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>a>i. X a \<in> A (Suc n)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a>i. X a \<in> A (Suc n)
[PROOF STEP]
have "i < s n i" "X (s n i) \<in> A (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>a>i. X a \<in> A (Suc n)

goal (1 subgoal):
 1. i < s n i &&& X (s n i) \<in> A (Suc n)
[PROOF STEP]
unfolding s_def
[PROOF STATE]
proof (prove)
using this:
\<exists>a>i. X a \<in> A (Suc n)

goal (1 subgoal):
 1. i < (SOME j. i < j \<and> X j \<in> A (Suc n)) &&& X (SOME j. i < j \<and> X j \<in> A (Suc n)) \<in> A (Suc n)
[PROOF STEP]
by (auto intro: someI2_ex)
[PROOF STATE]
proof (state)
this:
i < s n i
X (s n i) \<in> A (Suc n)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < s ?n2 ?i2
X (s ?n2 ?i2) \<in> A (Suc ?n2)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
note s = this
[PROOF STATE]
proof (state)
this:
?i2 < s ?n2 ?i2
X (s ?n2 ?i2) \<in> A (Suc ?n2)

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
define r where "r = rec_nat (s 0 0) s"
[PROOF STATE]
proof (state)
this:
r = rec_nat (s 0 0) s

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "strict_mono r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono r
[PROOF STEP]
by (auto simp: r_def s strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
strict_mono r

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
strict_mono r

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
have "(\<lambda>n. X (r n)) \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. X (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
assume "open S" "x \<in> S"
[PROOF STATE]
proof (state)
this:
open S
x \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
with A(3)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>open ?S; x \<in> ?S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> ?S
open S
x \<in> S
[PROOF STEP]
have "eventually (\<lambda>i. A i \<subseteq> S) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open ?S; x \<in> ?S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> ?S
open S
x \<in> S

goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. A i \<subseteq> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
assume "Suc 0 \<le> i"
[PROOF STATE]
proof (state)
this:
Suc 0 \<le> i

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc 0 \<le> i
[PROOF STEP]
have "X (r i) \<in> A i"
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> i

goal (1 subgoal):
 1. X (r i) \<in> A i
[PROOF STEP]
by (cases i) (simp_all add: r_def s)
[PROOF STATE]
proof (state)
this:
X (r i) \<in> A i

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Suc 0 \<le> ?i2 \<Longrightarrow> X (r ?i2) \<in> A ?i2

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc 0 \<le> ?i2 \<Longrightarrow> X (r ?i2) \<in> A ?i2
[PROOF STEP]
have "eventually (\<lambda>i. X (r i) \<in> A i) sequentially"
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> ?i2 \<Longrightarrow> X (r ?i2) \<in> A ?i2

goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. X (r i) \<in> A i
[PROOF STEP]
by (auto simp: eventually_sequentially)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. X (r i) \<in> A i

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; x \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. X (r x) \<in> S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S
\<forall>\<^sub>F i in sequentially. X (r i) \<in> A i
[PROOF STEP]
show "eventually (\<lambda>i. X (r i) \<in> S) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F i in sequentially. A i \<subseteq> S
\<forall>\<^sub>F i in sequentially. X (r i) \<in> A i

goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. X (r i) \<in> S
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in sequentially. X (r i) \<in> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<And>f. \<forall>n. f n \<in> U \<Longrightarrow> \<exists>l\<in>U. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
strict_mono r
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
show "\<exists>x \<in> U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
using this:
strict_mono r
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>x\<in>U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x
[PROOF STEP]
using \<open>x \<in> U\<close>
[PROOF STATE]
proof (prove)
using this:
strict_mono r
(\<lambda>n. X (r n)) \<longlonglongrightarrow> x
x \<in> U

goal (1 subgoal):
 1. \<exists>x\<in>U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x
[PROOF STEP]
by (auto simp: convergent_def comp_def)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>U. \<exists>r. strict_mono r \<and> (X \<circ> r) \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_times_le_abs: "- (err * B) \<le> \<bar>B\<bar>" if "-1 \<le> err" "err \<le> 1" for err::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
have [simp]: "abs err \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>err\<bar> \<le> 1
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
- 1 \<le> err
err \<le> 1

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

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
have "- (err * B) \<le> abs (- err * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (err * B) \<le> \<bar>- err * B\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (err * B) \<le> \<bar>- err * B\<bar>

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (err * B) \<le> \<bar>- err * B\<bar>

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
have "\<dots> \<le> abs B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>- err * B\<bar> \<le> \<bar>B\<bar>
[PROOF STEP]
by (auto simp: abs_mult intro!: mult_left_le_one_le)
[PROOF STATE]
proof (state)
this:
\<bar>- err * B\<bar> \<le> \<bar>B\<bar>

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

goal (1 subgoal):
 1. - (err * B) \<le> \<bar>B\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (err * B) \<le> \<bar>B\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ftranclD:
  "(x, y) |\<in>| R|\<^sup>+| \<Longrightarrow> \<exists>z. (x, z) |\<in>| R \<and> (z = y \<or> (z, y) |\<in>| R|\<^sup>+|)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) |\<in>| R|\<^sup>+| \<Longrightarrow> \<exists>z. (x, z) |\<in>| R \<and> (z = y \<or> (z, y) |\<in>| R|\<^sup>+|)
[PROOF STEP]
by (induct rule: ftrancl_induct) (auto, meson ftrancl_into_trancl)


[STATEMENT]
lemma insert_list_length[simp]:
  assumes "sorted_less ks"
  shows "length (insert_list k ks) = length ks + (if k \<in> set ks then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (insert_list k ks) = length ks + (if k \<in> set ks then 0 else 1)
[PROOF STEP]
using insert_list_req
[PROOF STATE]
proof (prove)
using this:
sorted_less ?ks \<Longrightarrow> isin_list ?x ?ks = (?x \<in> set ?ks)
sorted_less ?ks \<Longrightarrow> insert_list ?x ?ks = ins_list ?x ?ks
sorted_less ?ks \<Longrightarrow> delete_list ?x ?ks = del_list ?x ?ks

goal (1 subgoal):
 1. length (insert_list k ks) = length ks + (if k \<in> set ks then 0 else 1)
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma cblinfun_blinfun_transfer_compose[cblinfun_blinfun_transfer]:
  includes lifting_syntax
  shows "(blinfun_cblinfun_eq ===> blinfun_cblinfun_eq ===> blinfun_cblinfun_eq) (o\<^sub>L) (o\<^sub>C\<^sub>L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (blinfun_cblinfun_eq ===> blinfun_cblinfun_eq ===> blinfun_cblinfun_eq) (o\<^sub>L) (o\<^sub>C\<^sub>L)
[PROOF STEP]
unfolding rel_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. blinfun_cblinfun_eq x y \<longrightarrow> (\<forall>xa ya. blinfun_cblinfun_eq xa ya \<longrightarrow> blinfun_cblinfun_eq (x o\<^sub>L xa) (y o\<^sub>C\<^sub>L ya))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{f. bounded_linear f}. \<forall>y\<in>{f. bounded_clinear f}. x = y \<longrightarrow> (\<forall>xa\<in>{f. bounded_linear f}. \<forall>ya\<in>{f. bounded_clinear f}. xa = ya \<longrightarrow> x \<circ> xa = y \<circ> ya)
[PROOF STEP]
by auto


[STATEMENT]
lemma ring_id_pow_closed:
"(ring_id)[^]\<^bsub>Fun Zp\<^esub> (n::nat) \<in> carrier (Fun Zp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_id [^]\<^bsub>function_ring (carrier Zp) Zp\<^esub> n \<in> carrier (function_ring (carrier Zp) Zp)
[PROOF STEP]
by (simp add: function_ring_is_monoid monoid.nat_pow_closed)


[STATEMENT]
lemma embed_measure_count_space':
    "inj_on f A \<Longrightarrow> embed_measure (count_space A) f = count_space (f`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<Longrightarrow> embed_measure (count_space A) f = count_space (f ` A)
[PROOF STEP]
apply (subst distr_bij_count_space[of f A "f`A", symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on f A \<Longrightarrow> bij_betw f A (f ` A)
 2. inj_on f A \<Longrightarrow> embed_measure (count_space A) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply (simp add: inj_on_def bij_betw_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<Longrightarrow> embed_measure (count_space A) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply (subst embed_measure_eq_distr')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on f A \<Longrightarrow> inj_on f (space (count_space A))
 2. inj_on f A \<Longrightarrow> distr (count_space A) (embed_measure (count_space A) f) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<Longrightarrow> distr (count_space A) (embed_measure (count_space A) f) f = distr (count_space A) (count_space (f ` A)) f
[PROOF STEP]
apply(auto 4 3 intro!: measure_eqI imageI simp add: sets_embed_measure' subset_image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> emeasure (distr (count_space A) (embed_measure (count_space A) f) f) (f ` Aa) = emeasure (distr (count_space A) (count_space (f ` A)) f) (f ` Aa)
[PROOF STEP]
apply (subst (1 2) emeasure_distr)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f \<in> count_space A \<rightarrow>\<^sub>M count_space (f ` A)
 2. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f ` Aa \<in> sets (count_space (f ` A))
 3. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f \<in> count_space A \<rightarrow>\<^sub>M embed_measure (count_space A) f
 4. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> f ` Aa \<in> sets (embed_measure (count_space A) f)
 5. \<And>Aa. \<lbrakk>inj_on f A; Aa \<subseteq> A\<rbrakk> \<Longrightarrow> emeasure (count_space A) (f -` f ` Aa \<inter> space (count_space A)) = emeasure (count_space A) (f -` f ` Aa \<inter> space (count_space A))
[PROOF STEP]
apply (auto simp: space_embed_measure sets_embed_measure')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma left_null_space_eq_null_space_transpose: "left_null_space A = null_space (transpose A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_null_space A = null_space (Finite_Cartesian_Product.transpose A)
[PROOF STEP]
unfolding null_space_def left_null_space_def transpose_vector
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. Finite_Cartesian_Product.transpose A *v x = 0} = {x. Finite_Cartesian_Product.transpose A *v x = 0}
[PROOF STEP]
..


[STATEMENT]
lemma lg_maxr: "\<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow>
                      rec_exec rec_lg [x, y] = Maxr lgR [x, y] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec rec_lg [x, y] = Maxr lgR [x, y] x
[PROOF STEP]
proof(simp add: rec_exec.simps rec_lg_def Let_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
assume h: "Suc 0 < x" "Suc 0 < y"
[PROOF STATE]
proof (state)
this:
Suc 0 < x
Suc 0 < y

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
let ?rR = "(Cn 3 rec_le [Cn 3 rec_power
               [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
have "rec_exec (rec_maxr ?rR) ([x, y] @ [x])
              = Maxr ((\<lambda> args. 0 < rec_exec ?rR args)) [x, y] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
[PROOF STEP]
proof(rule Maxr_lemma)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primerec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))
[PROOF STEP]
show "primerec (Cn 3 rec_le [Cn 3 rec_power
              [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primerec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))
[PROOF STEP]
apply(auto simp: numeral_3_eq_3)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
primerec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) (Suc (length [x, y]))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
have "Maxr lgR [x, y] x = Maxr ((\<lambda> args. 0 < rec_exec ?rR args)) [x, y] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
[PROOF STEP]
apply(simp add: rec_exec.simps power_lemma)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Maxr lgR [x, y] x = Maxr (\<lambda>args. args ! Suc 0 ^ args ! 2 \<le> args ! 0) [x, y] x
[PROOF STEP]
apply(simp add: Maxr.simps lgR.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
[PROOF STEP]
show "rec_exec (rec_maxr ?rR) [x, y, x] = Maxr lgR [x, y] x"
[PROOF STATE]
proof (prove)
using this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) ([x, y] @ [x]) = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x
Maxr lgR [x, y] x = Maxr (\<lambda>args. 0 < rec_exec (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0]) args) [x, y] x

goal (1 subgoal):
 1. rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rec_exec (rec_maxr (Cn 3 rec_le [Cn 3 rec_power [recf.id 3 (Suc 0), recf.id 3 2], recf.id 3 0])) [x, y, x] = Maxr lgR [x, y] x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma MULT[import_const "*" : times]:
  "(\<forall>n :: nat. (id 0) * n = id 0) \<and> (\<forall>m n. (Suc m) * n = (m * n) + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. id 0 * n = id 0) \<and> (\<forall>m n. Suc m * n = m * n + n)
[PROOF STEP]
by simp


[STATEMENT]
lemma same_level_path_number_Calls_eq_number_Returns:
  "\<lbrakk>same_level_path as; \<forall>a \<in> set as. valid_edge a\<rbrakk> \<Longrightarrow>
  length [a\<leftarrow>as. \<exists>Q r p fs. kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs] = length [a\<leftarrow>as. \<exists>Q p f. kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>same_level_path as; \<forall>a\<in>set as. valid_edge a\<rbrakk> \<Longrightarrow> length (filter (\<lambda>a. \<exists>Q r p fs. kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs) as) = length (filter (\<lambda>a. \<exists>Q p f. kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f) as)
[PROOF STEP]
by(fastforce dest:slpa_number_Calls_eq_number_Returns simp:same_level_path_def)


[STATEMENT]
lemma uMult_left_commute: "a *\<^sub># (b *\<^sub># c) = b *\<^sub># (a *\<^sub># c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *\<^sub># (b *\<^sub># c) = b *\<^sub># (a *\<^sub># c)
[PROOF STEP]
unfolding uMult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>a\<cdot>((\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>b\<cdot>c) = (\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>b\<cdot>((\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>a\<cdot>c)
[PROOF STEP]
by simp


[STATEMENT]
lemma limitin_atin_self:
   "limitin Y f (f a) (atin X a) \<longleftrightarrow>
        f a \<in> topspace Y \<and>
        (a \<in> topspace X
         \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V
                  \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` U \<subseteq> V)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limitin Y f (f a) (atin X a) = (f a \<in> topspace Y \<and> (a \<in> topspace X \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` U \<subseteq> V))))
[PROOF STEP]
unfolding limitin_atin
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f a \<in> topspace Y \<and> (a \<in> topspace X \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` (U - {a}) \<subseteq> V)))) = (f a \<in> topspace Y \<and> (a \<in> topspace X \<longrightarrow> (\<forall>V. openin Y V \<and> f a \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> a \<in> U \<and> f ` U \<subseteq> V))))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Rel2Mon_if:
  "Rel2Mon {(s, t). if b s then (s, t) \<in> Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c)) else s = t} \<sigma> =
  (if b \<sigma> then Rel2Mon (Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c))) \<sigma> else Some ((), \<sigma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rel2Mon {(s, t). if b s then (s, t) \<in> Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c)) else s = t} \<sigma> = (if b \<sigma> then Rel2Mon (Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c))) \<sigma> else Some ((), \<sigma>))
[PROOF STEP]
by (simp add: Rel2Mon_def)


[STATEMENT]
lemma SET046_5:
 "(\<forall>Y X. ~(element(X::'a,a) & element(X::'a,Y) & element(Y::'a,X))) &
  (\<forall>X. element(X::'a,f(X)) | element(X::'a,a)) &
  (\<forall>X. element(f(X),X) | element(X::'a,a)) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>Y X. \<not> (element (X, a) \<and> element (X, Y) \<and> element (Y, X))) \<and> (\<forall>X. element (X, f X) \<or> element (X, a)) \<and> (\<forall>X. element (f X, X) \<or> element (X, a)) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma [code]: "m < n \<longleftrightarrow> integer_of_natural m < integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m < n) = (integer_of_natural m < integer_of_natural n)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma fps_lcm:
  assumes [simp]: "f \<noteq> 0" "g \<noteq> 0"
  shows   "lcm f g = fps_X ^ max (subdegree f) (subdegree g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
let ?m = "max (subdegree f) (subdegree g)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
show "lcm f g = fps_X ^ ?m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm f g = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
proof (rule sym, rule lcmI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. \<And>d. \<lbrakk>f dvd d; g dvd d\<rbrakk> \<Longrightarrow> fps_X ^ max (subdegree f) (subdegree g) dvd d
 4. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. \<And>d. \<lbrakk>f dvd d; g dvd d\<rbrakk> \<Longrightarrow> fps_X ^ max (subdegree f) (subdegree g) dvd d
 4. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
assume "f dvd d" "g dvd d"
[PROOF STATE]
proof (state)
this:
f dvd d
g dvd d

goal (4 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. \<And>d. \<lbrakk>f dvd d; g dvd d\<rbrakk> \<Longrightarrow> fps_X ^ max (subdegree f) (subdegree g) dvd d
 4. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
thus "fps_X ^ ?m dvd d"
[PROOF STATE]
proof (prove)
using this:
f dvd d
g dvd d

goal (1 subgoal):
 1. fps_X ^ max (subdegree f) (subdegree g) dvd d
[PROOF STEP]
by (cases "d = 0") (simp_all add: fps_dvd_iff)
[PROOF STATE]
proof (state)
this:
fps_X ^ max (subdegree f) (subdegree g) dvd d

goal (3 subgoals):
 1. f dvd fps_X ^ max (subdegree f) (subdegree g)
 2. g dvd fps_X ^ max (subdegree f) (subdegree g)
 3. normalize (fps_X ^ max (subdegree f) (subdegree g)) = fps_X ^ max (subdegree f) (subdegree g)
[PROOF STEP]
qed (simp_all add: fps_dvd_iff)
[PROOF STATE]
proof (state)
this:
lcm f g = fps_X ^ max (subdegree f) (subdegree g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Peirce: \<open>\<turnstile> ((p \<rightarrow> q) \<rightarrow> p) \<rightarrow> p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> ((p \<rightarrow> q) \<rightarrow> p) \<rightarrow> p
[PROOF STEP]
using MP PR Simp Swap Tran
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<turnstile> ?p \<rightarrow> ?q; \<turnstile> ?p\<rbrakk> \<Longrightarrow> \<turnstile> ?q
\<turnstile> (?p \<rightarrow> ?q) \<rightarrow> ?p \<Longrightarrow> \<turnstile> ?p
\<turnstile> ?p \<rightarrow> ?q \<rightarrow> ?p
\<turnstile> (?p \<rightarrow> ?q \<rightarrow> ?r) \<rightarrow> ?q \<rightarrow> ?p \<rightarrow> ?r
\<turnstile> (?p \<rightarrow> ?q) \<rightarrow> (?q \<rightarrow> ?r) \<rightarrow> ?p \<rightarrow> ?r

goal (1 subgoal):
 1. \<turnstile> ((p \<rightarrow> q) \<rightarrow> p) \<rightarrow> p
[PROOF STEP]
by meson


[STATEMENT]
theorem "~ (\<forall>j (i::int). j \<le> i --> (\<exists>x y. 0 \<le> x & 0 \<le> y & 3 * x + 5 * y = i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>j i. j \<le> i \<longrightarrow> (\<exists>x y. 0 \<le> x \<and> 0 \<le> y \<and> 3 * x + 5 * y = i))
[PROOF STEP]
by presburger


[STATEMENT]
lemma injective_into_1d_imp_open_map_UNIV:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes "open T" "continuous_on S f" "inj_on f S" "T \<subseteq> S"
    shows "open (f ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` T)
[PROOF STEP]
apply (rule invariance_of_domain_gen [OF \<open>open T\<close>])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on T f
 2. inj_on f T
 3. DIM(real) \<le> DIM('a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
open T
continuous_on S f
inj_on f S
T \<subseteq> S

goal (3 subgoals):
 1. continuous_on T f
 2. inj_on f T
 3. DIM(real) \<le> DIM('a)
[PROOF STEP]
apply (auto simp: elim: continuous_on_subset subset_inj_on)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_nat_neq_iff_word:
      "x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a) \<Longrightarrow>
         (((of_nat x)::('a::len) word) \<noteq> of_nat y) = (x \<noteq> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a) \<Longrightarrow> (word_of_nat x \<noteq> word_of_nat y) = (x \<noteq> y)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y\<rbrakk> \<Longrightarrow> x \<noteq> y
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y\<rbrakk> \<Longrightarrow> word_of_nat x \<noteq> word_of_nat y
[PROOF STEP]
apply (case_tac "x = y")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y; x = y\<rbrakk> \<Longrightarrow> x \<noteq> y
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<noteq> y
 3. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y\<rbrakk> \<Longrightarrow> word_of_nat x \<noteq> word_of_nat y
[PROOF STEP]
apply (subst (asm) of_nat_eq_iff[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>of_nat (x mod 2 ^ LENGTH('a)) \<noteq> of_nat (y mod 2 ^ LENGTH('a)); word_of_nat x \<noteq> word_of_nat y; x = y\<rbrakk> \<Longrightarrow> x \<noteq> y
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); word_of_nat x \<noteq> word_of_nat y; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<noteq> y
 3. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y\<rbrakk> \<Longrightarrow> word_of_nat x \<noteq> word_of_nat y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (case_tac "((of_nat x)::('a::len) word) = of_nat y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y; word_of_nat x = word_of_nat y\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y; word_of_nat x \<noteq> word_of_nat y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod 2 ^ LENGTH('a) \<noteq> y mod 2 ^ LENGTH('a); x \<noteq> y; word_of_nat x = word_of_nat y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (metis unat_of_nat)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem "(\<forall>(y::int). 3 dvd y) ==> \<forall>(x::int). b < x --> a \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. 3 dvd y \<Longrightarrow> \<forall>x>b. a \<le> x
[PROOF STEP]
by presburger


[STATEMENT]
lemma sum_pos_ex_elem_pos: "(0::int) < (\<Sum>m\<in>M. f m) \<Longrightarrow> \<exists>m\<in>M. 0 < f m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sum f M \<Longrightarrow> \<exists>m\<in>M. 0 < f m
[PROOF STEP]
by (meson not_le sum_nonpos)


[STATEMENT]
lemma hypnat_infinite_has_nonstandard_iff: "infinite A \<longleftrightarrow> hypnat_of_nat ` A < *s* A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite A = (hypnat_of_nat ` A \<subset> *s* A)
[PROOF STEP]
by (metis finite_starsetNat_iff hypnat_infinite_has_nonstandard nless_le)


[STATEMENT]
lemma Legendre_p_eq_2[simp]: "Legendre a 2 = a mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Legendre a 2 = a mod 2
[PROOF STEP]
by (clarsimp simp: Legendre_def QuadRes_def cong_iff_dvd_diff) presburger


[STATEMENT]
lemma dims_A':
shows "dim_row (A' ws) = prod_list (nths (Tensor.dims (A ws)) {n. even n})"
and "dim_col (A' ws) = prod_list (nths (Tensor.dims (A ws)) {n. odd n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (A' ws) = prod_list (nths (dims (A ws)) (Collect even)) &&& dim_col (A' ws) = prod_list (nths (dims (A ws)) {n. odd n})
[PROOF STEP]
unfolding A'_def matricize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (prod_list (nths (dims (A ws)) (Collect even))) (prod_list (nths (dims (A ws)) (- Collect even))) (\<lambda>(r, c). lookup (A ws) (weave (Collect even) (digit_encode (nths (dims (A ws)) (Collect even)) r) (digit_encode (nths (dims (A ws)) (- Collect even)) c)))) = prod_list (nths (dims (A ws)) (Collect even)) &&& dim_col (mat (prod_list (nths (dims (A ws)) (Collect even))) (prod_list (nths (dims (A ws)) (- Collect even))) (\<lambda>(r, c). lookup (A ws) (weave (Collect even) (digit_encode (nths (dims (A ws)) (Collect even)) r) (digit_encode (nths (dims (A ws)) (- Collect even)) c)))) = prod_list (nths (dims (A ws)) {n. odd n})
[PROOF STEP]
by (simp_all add: A_def Collect_neg_eq)


[STATEMENT]
lemma ereal_max_0: "max 0 (ereal r) = ereal (max 0 r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max 0 (ereal r) = ereal (max 0 r)
[PROOF STEP]
by (auto simp: zero_ereal_def)


[STATEMENT]
theorem (in abelian_group_hom) A_FactGroup_iso_set:
  "h ` carrier G = carrier H
   \<Longrightarrow> (\<lambda>X. the_elem (h`X)) \<in> iso (G A_Mod (a_kernel G H h)) (add_monoid H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` carrier G = carrier H \<Longrightarrow> (\<lambda>X. the_elem (h ` X)) \<in> Group.iso (G A_Mod a_kernel G H h) (add_monoid H)
[PROOF STEP]
by (rule group_hom.FactGroup_iso_set[OF a_group_hom,
    folded a_kernel_def A_FactGroup_def, simplified ring_record_simps])


[STATEMENT]
lemma "[12, mod 10, 4] = {12, 22, 32, 42, 52}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [ 12, mod 10, 4 ] = {12, 22, 32, 42, 52}
[PROOF STEP]
apply (simp only: iMODb_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<dots>4] \<otimes> 10 \<oplus> 12 = {12, 22, 32, 42, 52}
[PROOF STEP]
apply (simp add: iT_defs iT_Mult_def iT_Plus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. n + 12) ` (\<lambda>n. n * 10) ` {..4} = {12, 22, 32, 42, 52}
[PROOF STEP]
apply (simp add: atMost_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4} = {12, 22, 32, 42, 52}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>x xa xb. \<lbrakk>xb * 10 + 12 \<noteq> 12; xb * 10 + 12 \<noteq> 22; xb * 10 + 12 \<noteq> 32; xb * 10 + 12 \<noteq> 42; xb * 10 + 12 \<notin> {}; xb \<le> 4\<rbrakk> \<Longrightarrow> xb * 10 + 12 = 52
 2. \<And>x. 12 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 3. \<And>x. 22 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 4. \<And>x. 32 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 5. \<And>x. 42 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
 6. \<And>x. 52 \<in> (\<lambda>x. x + 12) ` (\<lambda>x. x * 10) ` {x. x \<le> 4}
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ChiPlus_ChiRel_NoCycle_2 [rule_format]:
 "\<lbrakk> (T,S) \<in> ChiPlus A\<rbrakk> \<Longrightarrow>  (S,T) \<in> (ChiRel A) \<longrightarrow>
   (insert S (insert T ({U. (T,U) \<in> ChiPlus A \<and> (U,S) \<in> ChiPlus A})))  \<inter> (ChiRel A `` {S}) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> ChiPlus A \<Longrightarrow> (S, T) \<in> ChiRel A \<longrightarrow> insert S (insert T {U. (T, U) \<in> ChiPlus A \<and> (U, S) \<in> ChiPlus A}) \<inter> ChiRel A `` {S} \<noteq> {}
[PROOF STEP]
apply (unfold ChiPlus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (S, T) \<in> ChiRel A \<longrightarrow> insert S (insert T {U. (T, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}
[PROOF STEP]
apply (rule_tac a="T" and b="S" and r="(ChiRel A)" in converse_trancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (T, S) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, S) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}
 3. \<And>y z. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, S) \<in> (ChiRel A)\<^sup>+; (S, z) \<in> ChiRel A \<longrightarrow> insert S (insert z {U. (z, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {S} \<noteq> {}
[PROOF STEP]
apply (unfold Image_def Int_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (T, S) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, S) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> {x \<in> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {y. \<exists>x\<in>{S}. (x, y) \<in> ChiRel A}} \<noteq> {}
 3. \<And>y z. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, S) \<in> (ChiRel A)\<^sup>+; (S, z) \<in> ChiRel A \<longrightarrow> {x \<in> insert S (insert z {U. (z, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {y. \<exists>x\<in>{S}. (x, y) \<in> ChiRel A}} \<noteq> {}\<rbrakk> \<Longrightarrow> (S, y) \<in> ChiRel A \<longrightarrow> {x \<in> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {y. \<exists>x\<in>{S}. (x, y) \<in> ChiRel A}} \<noteq> {}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma JHS_Tr1_1:"\<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> (f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s)) = f (r - Suc 0) \<inter> g (s - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule r_s_div_s [of "r" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule r_s_mod_s [of "r" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> f (Suc ((r * s - Suc 0) div s)) \<diamondop>\<^bsub>G\<^esub> f ((r * s - Suc 0) div s) \<inter> g ((r * s - Suc 0) mod s) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> f r \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (subst Group.compseriesTr3 [of "G" "r" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule Group.compseriesTr0 [of "G" "r" "f" "r - Suc 0"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0\<rbrakk> \<Longrightarrow> r - Suc 0 \<le> r
 2. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (simp add:less_mem_of_Nset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule Group.compseriesTr0 [of "G" "s" "g" "s - Suc 0"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) \<rbrakk> \<Longrightarrow> s - Suc 0 \<le> s
 2. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) ; G \<guillemotright> g (s - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (simp add:less_mem_of_Nset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) ; G \<guillemotright> g (s - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (frule Group.inter_sgs [of "G" "f (r - (Suc 0))" "g (s - Suc 0)"],
                                                          assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; 0 < r; 0 < s; compseries G r f; compseries G s g; (r * s - Suc 0) div s = r - Suc 0; (r * s - Suc 0) mod s = s - Suc 0; G \<guillemotright> f (r - Suc 0) ; G \<guillemotright> g (s - Suc 0) ; G \<guillemotright> f (r - Suc 0) \<inter> g (s - Suc 0) \<rbrakk> \<Longrightarrow> {\<one>\<^bsub>G\<^esub>} \<diamondop>\<^bsub>G\<^esub> f (r - Suc 0) \<inter> g (s - Suc 0) = f (r - Suc 0) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (rule Group.s_top_l_unit, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sinh_conv_sin: "sinh z = -\<i> * sin (\<i>*z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sinh z = - \<i> * sin (\<i> * z)
[PROOF STEP]
by (simp add: sinh_field_def sin_i_times exp_minus)


[STATEMENT]
lemma upper_bound3:
  fixes b::nat
    and v::int
      defines "x \<equiv> - (2 ^ (b - 1)) + (v + 2 ^ (b - 1)) mod 2 ^ b"
    assumes "b>0"
    shows "x < 2^(b-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ (b - 1)
[PROOF STEP]
using upper_bound2 assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?b; ?c < 2 ^ ?b; 0 \<le> ?c\<rbrakk> \<Longrightarrow> ?c - 2 ^ (?b - 1) < 2 ^ (?b - 1)
x \<equiv> - (2 ^ (b - 1)) + (v + 2 ^ (b - 1)) mod 2 ^ b
0 < b

goal (1 subgoal):
 1. x < 2 ^ (b - 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma filter_sup_symmetric:
  "filter_sup F G = filter_sup G F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup F G = filter_sup G F
[PROOF STEP]
unfolding filter_sup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z. \<exists>x\<in>F. \<exists>y\<in>G. x \<sqinter> y \<le> z} = {z. \<exists>x\<in>G. \<exists>y\<in>F. x \<sqinter> y \<le> z}
[PROOF STEP]
using inf.commute
[PROOF STATE]
proof (prove)
using this:
?a \<sqinter> ?b = ?b \<sqinter> ?a

goal (1 subgoal):
 1. {z. \<exists>x\<in>F. \<exists>y\<in>G. x \<sqinter> y \<le> z} = {z. \<exists>x\<in>G. \<exists>y\<in>F. x \<sqinter> y \<le> z}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sets_not_eq:"\<lbrakk>A \<noteq> B; B \<subseteq> A\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a \<notin> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> B; B \<subseteq> A\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a \<notin> B
[PROOF STEP]
by blast


[STATEMENT]
lemma hyperb_ineq_4_points' [mono_intros]:
  "Min {Gromov_product_at (e::'a) x y, Gromov_product_at e y z, Gromov_product_at e z t} \<le> Gromov_product_at e x t + 2 * deltaG(TYPE('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} \<le> Gromov_product_at e x t + 2 * deltaG TYPE('a)
[PROOF STEP]
using hyperb_ineq_4_points[of e x y z t]
[PROOF STATE]
proof (prove)
using this:
Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} - 2 * deltaG TYPE('a) \<le> Gromov_product_at e x t

goal (1 subgoal):
 1. Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} \<le> Gromov_product_at e x t + 2 * deltaG TYPE('a)
[PROOF STEP]
by auto


[STATEMENT]
lemma odd_p: "odd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd p
[PROOF STEP]
using p_ge_2 p_prime prime_odd_nat
[PROOF STATE]
proof (prove)
using this:
2 < p
prime p
\<lbrakk>prime ?p; 2 < ?p\<rbrakk> \<Longrightarrow> odd ?p

goal (1 subgoal):
 1. odd p
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Semilat) plus_le_conv [simp]:
  "\<lbrakk> x \<in> A; y \<in> A; z \<in> A \<rbrakk> \<Longrightarrow> (x \<squnion>\<^sub>f y \<sqsubseteq>\<^sub>r z) = (x \<sqsubseteq>\<^sub>r z \<and> y \<sqsubseteq>\<^sub>r z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> (x \<squnion>\<^bsub>f\<^esub> y \<sqsubseteq>\<^bsub>r\<^esub> z) = (x \<sqsubseteq>\<^bsub>r\<^esub> z \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> (x \<squnion>\<^bsub>f\<^esub> y \<sqsubseteq>\<^bsub>r\<^esub> z) = (x \<sqsubseteq>\<^bsub>r\<^esub> z \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z)
[PROOF STEP]
by (blast intro: ub1 ub2 lub order_trans)


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


[STATEMENT]
lemma helper: "(A::int) * B + B = (A+1) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B + B = (A + 1) * B
[PROOF STEP]
by(auto simp: distrib_right)


[STATEMENT]
lemma "prime_nat (4*m + 1) \<Longrightarrow> m \<ge> (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_nat (4 * m + 1) \<Longrightarrow> 1 \<le> m
[PROOF STEP]
by (smt prime_nat_def)


[STATEMENT]
lemma "(inv upOne) n = n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv upOne n = n - 1
[PROOF STEP]
by (rule Hilbert_Choice.inv_f_eq[of upOne "n - 1" n, OF inj_upOne], simp)


[STATEMENT]
lemma step_4_push_small_size_ok_1: "\<lbrakk>
  invar (States dir big small);
  4 \<le> remaining_steps (States dir big small);
  (step^^4) (States dir big (Small.push x small)) = States dir' big' small';
  remaining_steps (States dir big small) + 1 \<le> 4 * size small
\<rbrakk> \<Longrightarrow> remaining_steps (States dir' big' small') + 1 \<le> 4 * size small'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); 4 \<le> remaining_steps (States dir big small); (step ^^ 4) (States dir big (Small.push x small)) = States dir' big' small'; remaining_steps (States dir big small) + 1 \<le> 4 * size small\<rbrakk> \<Longrightarrow> remaining_steps (States dir' big' small') + 1 \<le> 4 * size small'
[PROOF STEP]
by (smt (z3) add.commute add_leD1 add_le_mono le_add1 le_add_diff_inverse2 mult_Suc_right nat_1_add_1 numeral_Bit0 step_n_push_size_small step_4_remaining_steps_push_small)


[STATEMENT]
lemma "check_eqv (Abs_idx (0, 0)) 0
  (FNot (FEx SO (FAll FO (FBase (In False 0 0)))))
  (FAll () (FEx () (FEx () (FBase (Eq [3, 5, -1] 8 0)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. WS1S_Presburger_Equivalence.check_eqv (Abs_idx (0, 0)) 0 (FNot (FEx SO (FAll FO (FBase (In False 0 0))))) (FAll () (FEx () (FEx () (FBase (presb.Eq [3, 5, - 1] 8 0)))))
[PROOF STEP]
by check_equiv


[STATEMENT]
lemma star_n_minus: "- star_n X = star_n (\<lambda>n. -(X n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - star_n X = star_n (\<lambda>n. - X n)
[PROOF STEP]
by (simp only: star_minus_def starfun_star_n)


[STATEMENT]
lemma circline_type_neg_card_gt3:
  assumes "circline_type H < 0"
  shows "\<exists> A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
obtain M H' where "moebius_circline M H = H'" "circline_diag H'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M H'. \<lbrakk>moebius_circline M H = H'; circline_diag H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using circline_diagonalize[of H] assms
[PROOF STATE]
proof (prove)
using this:
\<exists>M H'. moebius_circline M H = H' \<and> circline_diag H'
circline_type H < 0

goal (1 subgoal):
 1. (\<And>M H'. \<lbrakk>moebius_circline M H = H'; circline_diag H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_circline M H = H'
circline_diag H'

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
moebius_circline M H = H'
circline_diag H'

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
hence "circline_type H' < 0"
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'

goal (1 subgoal):
 1. circline_type H' < 0
[PROOF STEP]
using assms moebius_preserve_circline_type
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'
circline_type H < 0
circline_type (moebius_circline ?M ?H) = circline_type ?H

goal (1 subgoal):
 1. circline_type H' < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
circline_type H' < 0

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
moebius_circline M H = H'
circline_diag H'
circline_type H' < 0
[PROOF STEP]
obtain A B C where "A \<noteq> B" "A \<noteq> C" "B \<noteq> C" "{A, B, C} \<subseteq> circline_set H'"
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'
circline_type H' < 0

goal (1 subgoal):
 1. (\<And>A B C. \<lbrakk>A \<noteq> B; A \<noteq> C; B \<noteq> C; {A, B, C} \<subseteq> circline_set H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using circline_type_neg_card_gt3_diag[of H']
[PROOF STATE]
proof (prove)
using this:
moebius_circline M H = H'
circline_diag H'
circline_type H' < 0
\<lbrakk>circline_type H' < 0; circline_diag H'\<rbrakk> \<Longrightarrow> \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H'

goal (1 subgoal):
 1. (\<And>A B C. \<lbrakk>A \<noteq> B; A \<noteq> C; B \<noteq> C; {A, B, C} \<subseteq> circline_set H'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<noteq> B
A \<noteq> C
B \<noteq> C
{A, B, C} \<subseteq> circline_set H'

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
let ?iM = "moebius_inv M"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
have "moebius_circline ?iM H' = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_circline (moebius_inv M) H' = H
[PROOF STEP]
using \<open>moebius_circline M H = H'\<close>[symmetric]
[PROOF STATE]
proof (prove)
using this:
H' = moebius_circline M H

goal (1 subgoal):
 1. moebius_circline (moebius_inv M) H' = H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
moebius_circline (moebius_inv M) H' = H

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
let ?A = "moebius_pt ?iM A" and ?B= "moebius_pt ?iM B" and ?C = "moebius_pt ?iM C"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
have "?A \<in> circline_set H"  "?B \<in> circline_set H"  "?C \<in> circline_set H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<in> circline_set H &&& moebius_pt (moebius_inv M) B \<in> circline_set H &&& moebius_pt (moebius_inv M) C \<in> circline_set H
[PROOF STEP]
using \<open>moebius_circline ?iM H' = H\<close>[symmetric] \<open>{A, B, C} \<subseteq> circline_set H'\<close>
[PROOF STATE]
proof (prove)
using this:
H = moebius_circline (moebius_inv M) H'
{A, B, C} \<subseteq> circline_set H'

goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<in> circline_set H &&& moebius_pt (moebius_inv M) B \<in> circline_set H &&& moebius_pt (moebius_inv M) C \<in> circline_set H
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
have "?A \<noteq> ?B" "?A \<noteq> ?C" "?B \<noteq> ?C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B &&& moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C &&& moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C
[PROOF STEP]
using \<open>A \<noteq> B\<close> \<open>A \<noteq> C\<close> \<open>B \<noteq> C\<close>
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B
A \<noteq> C
B \<noteq> C

goal (1 subgoal):
 1. moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B &&& moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C &&& moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C
moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C
moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
moebius_pt (moebius_inv M) A \<in> circline_set H
moebius_pt (moebius_inv M) B \<in> circline_set H
moebius_pt (moebius_inv M) C \<in> circline_set H
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) B
moebius_pt (moebius_inv M) A \<noteq> moebius_pt (moebius_inv M) C
moebius_pt (moebius_inv M) B \<noteq> moebius_pt (moebius_inv M) C

goal (1 subgoal):
 1. \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_image_id_if[simp]: "(\<And>x. f(f x) = x) \<Longrightarrow> f ` f ` M = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. f (f x) = x) \<Longrightarrow> f ` f ` M = M
[PROOF STEP]
by (auto simp: image_iff)


[STATEMENT]
lemma space_restrict_space2 [simp]: "\<Omega> \<in> sets M \<Longrightarrow> space (restrict_space M \<Omega>) = \<Omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Omega> \<in> sets M \<Longrightarrow> space (restrict_space M \<Omega>) = \<Omega>
[PROOF STEP]
by (simp add: space_restrict_space sets.sets_into_space)


[STATEMENT]
lemma integral_inner_left[simp]: "(c \<noteq> 0 \<Longrightarrow> integrable M f) \<Longrightarrow> (\<integral> x. f x \<bullet> c \<partial>M) = integral\<^sup>L M f \<bullet> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<noteq> (0::'a) \<Longrightarrow> integrable M f) \<Longrightarrow> LINT x|M. f x \<bullet> c = integral\<^sup>L M f \<bullet> c
[PROOF STEP]
by (intro has_bochner_integral_integral_eq has_bochner_integral_integrable has_bochner_integral_inner_left)


[STATEMENT]
lemma inf_tl_Suc: "inf_tl x i = x (Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_tl x i = x (Suc i)
[PROOF STEP]
by (simp add: inf_tl_def)


[STATEMENT]
lemma f_range_on_V_axiom_on_rationalizes_on:
  assumes "f_range_on A f"
  assumes "V_axiom_on A f"
  shows "rationalizes_on A f (rwp_on A f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rationalizes_on A f (rwp_on A f)
[PROOF STEP]
using %invisible assms rwp_on_Field[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
f_range_on A f
V_axiom_on A f
Field (rwp_on A f) \<subseteq> A

goal (1 subgoal):
 1. rationalizes_on A f (rwp_on A f)
[PROOF STEP]
unfolding V_axiom_on_def rationalizes_on_def greatest_def f_range_on_def rwp_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>B\<subseteq>A. f B \<subseteq> B
\<forall>B\<subseteq>A. \<forall>y\<in>B. (\<forall>x\<in>B. (x, y) \<in> {(x, y). \<exists>B\<subseteq>A. x \<in> B \<and> y \<in> f B}) \<longrightarrow> y \<in> f B
Field {(x, y). \<exists>B\<subseteq>A. x \<in> B \<and> y \<in> f B} \<subseteq> A

goal (1 subgoal):
 1. \<forall>B\<subseteq>A. f B = {x \<in> B. \<forall>y\<in>B. (y, x) \<in> {(x, y). \<exists>B\<subseteq>A. x \<in> B \<and> y \<in> f B}}
[PROOF STEP]
by auto


[STATEMENT]
lemma invariant3pI: "(\<And>s tl s'. \<lbrakk> s \<in> I; r s tl s' \<rbrakk> \<Longrightarrow> s' \<in> I) \<Longrightarrow> invariant3p r I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s tl s'. \<lbrakk>s \<in> I; r s tl s'\<rbrakk> \<Longrightarrow> s' \<in> I) \<Longrightarrow> invariant3p r I
[PROOF STEP]
unfolding invariant3p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s tl s'. \<lbrakk>s \<in> I; r s tl s'\<rbrakk> \<Longrightarrow> s' \<in> I) \<Longrightarrow> \<forall>s tl s'. s \<in> I \<longrightarrow> r s tl s' \<longrightarrow> s' \<in> I
[PROOF STEP]
by blast


[STATEMENT]
lemma islimpt_punctured: "x islimpt S = x islimpt (S-{x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = x islimpt S - {x}
[PROOF STEP]
unfolding islimpt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>T. x \<in> T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x)) = (\<forall>T. x \<in> T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S - {x}. y \<in> T \<and> y \<noteq> x))
[PROOF STEP]
by blast


[STATEMENT]
lemma p_boundsI: "(\<Sum>i<k. as!i * bs!i powr x) \<le> 1 \<and> (\<Sum>i<k. as!i * bs!i powr y) \<ge> 1 \<Longrightarrow> p \<in> {y..x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. as ! i * bs ! i powr x) \<le> 1 \<and> 1 \<le> (\<Sum>i<k. as ! i * bs ! i powr y) \<Longrightarrow> p \<in> {y..x}
[PROOF STEP]
by (elim conjE, drule p_leI, drule p_geI, simp)


[STATEMENT]
lemma word_power_nonzero:
  "\<lbrakk> (x :: 'a::len word) < 2 ^ (LENGTH('a) - n); n < LENGTH('a); x \<noteq> 0 \<rbrakk>
  \<Longrightarrow> x * 2 ^ n \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < 2 ^ (LENGTH('a) - n); n < LENGTH('a); x \<noteq> 0\<rbrakk> \<Longrightarrow> x * 2 ^ n \<noteq> 0
[PROOF STEP]
by (metis Word.word_div_mult bits_div_0 len_gt_0 len_of_finite_2_def nat_mult_power_less_eq
    p2_gt_0 unat_mono unat_power_lower word_gt_a_gt_0)


[STATEMENT]
lemma inorder_baliR:
  "inorder(baliR l a r) = inorder l @ a # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tree2.inorder (baliR l a r) = Tree2.inorder l @ a # Tree2.inorder r
[PROOF STEP]
by(cases "(l,a,r)" rule: baliR.cases) (auto)


[STATEMENT]
lemma cong3_symmetry:
  assumes "A B C Cong3 A' B' C'"
  shows "A' B' C' Cong3 A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' B' C' Cong3 A B C
[PROOF STEP]
by (simp add: assms cong_3_sym)


[STATEMENT]
lemma parts_trans: "\<lbrakk> X\<in> parts G;  G \<subseteq> parts H \<rbrakk> \<Longrightarrow> X\<in> parts H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> parts G; G \<subseteq> parts H\<rbrakk> \<Longrightarrow> X \<in> parts H
[PROOF STEP]
by (drule parts_mono, blast)


[STATEMENT]
lemma finite_set_imp_finite_atoms:
  assumes "finite Xs"
  shows "finite (atoms_of Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (atoms_of Xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite Xs

goal (1 subgoal):
 1. finite (atoms_of Xs)
[PROOF STEP]
unfolding atoms_of_def
[PROOF STATE]
proof (prove)
using this:
finite Xs

goal (1 subgoal):
 1. finite (subset_to_atom Xs ` (Pow Xs - {{}}) - {{}})
[PROOF STEP]
by blast


[STATEMENT]
lemma absn_subst: "((Abs^^n) s)[t/k] = (Abs^^n) (s[liftn n t 0/k+n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs ^^ n) s[t/k] = (Abs ^^ n) (s[liftn n t 0/k + n])
[PROOF STEP]
by (induction n arbitrary: t k) (simp_all add: liftn_lift_swap)


[STATEMENT]
lemma wqo_on_multisets:
  assumes "wqo_on P A"
  shows "wqo_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
 2. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
from transp_on_mulex_on [of P A "multisets A"]
[PROOF STATE]
proof (chain)
picking this:
transp_on (mulex_on P A) (multisets A)
[PROOF STEP]
show "transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)"
[PROOF STATE]
proof (prove)
using this:
transp_on (mulex_on P A) (multisets A)

goal (1 subgoal):
 1. transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
unfolding transp_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>multisets A. \<forall>y\<in>multisets A. \<forall>z\<in>multisets A. mulex_on P A x y \<and> mulex_on P A y z \<longrightarrow> mulex_on P A x z

goal (1 subgoal):
 1. \<forall>x\<in>multisets A. \<forall>y\<in>multisets A. \<forall>z\<in>multisets A. (mulex_on P A)\<^sup>=\<^sup>= x y \<and> (mulex_on P A)\<^sup>=\<^sup>= y z \<longrightarrow> (mulex_on P A)\<^sup>=\<^sup>= x z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
transp_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)

goal (1 subgoal):
 1. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
from almost_full_on_multisets [OF assms [THEN wqo_on_imp_almost_full_on]]
[PROOF STATE]
proof (chain)
picking this:
almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
show "almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)"
[PROOF STATE]
proof (prove)
using this:
almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)

goal (1 subgoal):
 1. almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
almost_full_on (mulex_on P A)\<^sup>=\<^sup>= (multisets A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma QR_lemma_09:
    "f_2 x mod q \<in> Res_l q \<longleftrightarrow> x mod q \<in> Res_h q"
    "f_2 x mod q \<in> Res_h q \<longleftrightarrow> x mod q \<in> Res_l q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f_2 x mod int q \<in> {0<..(int q - 1) div 2}) = (x mod int q \<in> {(int q - 1) div 2<..int q - 1}) &&& (f_2 x mod int q \<in> {(int q - 1) div 2<..int q - 1}) = (x mod int q \<in> {0<..(int q - 1) div 2})
[PROOF STEP]
using QRqp QR.QR_lemma_08 f_2_def QR.f_2_def pq_commute
[PROOF STATE]
proof (prove)
using this:
QR q p
QR ?p ?q \<Longrightarrow> (QR.f_2 ?p ?q ?x mod int ?p \<in> {0<..(int ?p - 1) div 2}) = (?x mod int ?p \<in> {(int ?p - 1) div 2<..int ?p - 1})
QR ?p ?q \<Longrightarrow> (QR.f_2 ?p ?q ?x mod int ?p \<in> {(int ?p - 1) div 2<..int ?p - 1}) = (?x mod int ?p \<in> {0<..(int ?p - 1) div 2})
f_2 ?x = int p * int q - ?x
QR ?p ?q \<Longrightarrow> QR.f_2 ?p ?q ?x = int ?p * int ?q - ?x
int p * int q = int q * int p

goal (1 subgoal):
 1. (f_2 x mod int q \<in> {0<..(int q - 1) div 2}) = (x mod int q \<in> {(int q - 1) div 2<..int q - 1}) &&& (f_2 x mod int q \<in> {(int q - 1) div 2<..int q - 1}) = (x mod int q \<in> {0<..(int q - 1) div 2})
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_conv_radius_Lambert_W: "fps_conv_radius fps_Lambert_W = exp (-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
have "conv_radius (fps_nth fps_Lambert_W) = conv_radius (\<lambda>n. exp 1 ^ n * n powr (-3/2) :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (($) fps_Lambert_W) = conv_radius (\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
proof (rule conv_radius_cong_bigtheta)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
have "fps_nth fps_Lambert_W \<in> \<Theta>(\<lambda>n. (-real n) ^ (n - 1) / fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. (- real n) ^ (n - 1) / fact n)
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_gt_at_top[of 0]])
         (auto simp: fps_nth_Lambert_W)
[PROOF STATE]
proof (state)
this:
($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. (- real n) ^ (n - 1) / fact n)

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. (- real n) ^ (n - 1) / fact n)

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
have "(\<lambda>n. (-real n) ^ (n - 1) / fact n) \<in> \<Theta>(\<lambda>n. real n ^ (n - 1) / fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (- real n) ^ (n - 1) / fact n) \<in> \<Theta>(\<lambda>n. real n ^ (n - 1) / fact n)
[PROOF STEP]
by (subst landau_theta.norm_iff [symmetric], subst norm_divide) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (- real n) ^ (n - 1) / fact n) \<in> \<Theta>(\<lambda>n. real n ^ (n - 1) / fact n)

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (- real n) ^ (n - 1) / fact n) \<in> \<Theta>(\<lambda>n. real n ^ (n - 1) / fact n)

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
have "(\<lambda>n. (real n) ^ (n - 1) / fact n) \<in>
                 \<Theta>(\<lambda>n. (real n) ^ (n - 1) / (sqrt (2 * pi * real n) * (real n / exp 1) ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real n ^ (n - 1) / fact n) \<in> \<Theta>(\<lambda>n. real n ^ (n - 1) / (sqrt (2 * pi * real n) * (real n / exp 1) ^ n))
[PROOF STEP]
by (intro asymp_equiv_imp_bigtheta asymp_equiv_intros fact_asymp_equiv)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real n ^ (n - 1) / fact n) \<in> \<Theta>(\<lambda>n. real n ^ (n - 1) / (sqrt (2 * pi * real n) * (real n / exp 1) ^ n))

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real n ^ (n - 1) / fact n) \<in> \<Theta>(\<lambda>n. real n ^ (n - 1) / (sqrt (2 * pi * real n) * (real n / exp 1) ^ n))

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
have "(\<lambda>n. (real n) ^ (n - 1) / (sqrt (2 * pi * real n) * (real n / exp 1) ^ n)) \<in>
                 \<Theta>(\<lambda>n. exp 1 ^ n * n powr (-3/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real n ^ (n - 1) / (sqrt (2 * pi * real n) * (real n / exp 1) ^ n)) \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
by (real_asymp simp: ln_inverse)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real n ^ (n - 1) / (sqrt (2 * pi * real n) * (real n / exp 1) ^ n)) \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
show "fps_nth fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * n powr (-3/2) :: real)"
[PROOF STATE]
proof (prove)
using this:
($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))

goal (1 subgoal):
 1. ($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
($) fps_Lambert_W \<in> \<Theta>(\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
conv_radius (($) fps_Lambert_W) = conv_radius (\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))

goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conv_radius (($) fps_Lambert_W) = conv_radius (\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2))

goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
have "\<dots> = inverse (limsup (\<lambda>n. ereal (root n (exp 1 ^ n * real n powr - (3 / 2)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2)) = inverse (limsup (\<lambda>n. ereal (root n (exp 1 ^ n * real n powr - (3 / 2)))))
[PROOF STEP]
by (simp add: conv_radius_def)
[PROOF STATE]
proof (state)
this:
conv_radius (\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2)) = inverse (limsup (\<lambda>n. ereal (root n (exp 1 ^ n * real n powr - (3 / 2)))))

goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conv_radius (\<lambda>n. exp 1 ^ n * real n powr (- 3 / 2)) = inverse (limsup (\<lambda>n. ereal (root n (exp 1 ^ n * real n powr - (3 / 2)))))

goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
have "limsup (\<lambda>n. ereal (root n (exp 1 ^ n * real n powr - (3 / 2)))) = exp 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (exp 1 ^ n * real n powr - (3 / 2)))) = ereal (exp 1)
[PROOF STEP]
proof (intro lim_imp_Limsup tendsto_intros)
    \<comment> \<open>real\_asymp does not support \<^const>\<open>root\<close> for a variable basis natively, so
        we need to convert it to \<^const>\<open>powr\<close> first.\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sequentially \<noteq> bot
 2. (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
(* TODO add better "root" support to real_asymp *)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sequentially \<noteq> bot
 2. (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
have "(\<lambda>n. (exp 1 ^ n * real n powr -(3/2)) powr (1 / real n)) \<longlonglongrightarrow> exp 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (exp 1 ^ n * real n powr - (3 / 2)) powr (1 / real n)) \<longlonglongrightarrow> exp 1
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (exp 1 ^ n * real n powr - (3 / 2)) powr (1 / real n)) \<longlonglongrightarrow> exp 1

goal (2 subgoals):
 1. sequentially \<noteq> bot
 2. (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (exp 1 ^ n * real n powr - (3 / 2)) powr (1 / real n)) \<longlonglongrightarrow> exp 1

goal (2 subgoals):
 1. sequentially \<noteq> bot
 2. (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
have "?this \<longleftrightarrow> (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (exp 1 ^ n * real n powr - (3 / 2)) powr (1 / real n)) \<longlonglongrightarrow> exp 1 = (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
by (intro filterlim_cong eventually_mono[OF eventually_gt_at_top[of 0]])
         (auto simp: root_powr_inverse)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (exp 1 ^ n * real n powr - (3 / 2)) powr (1 / real n)) \<longlonglongrightarrow> exp 1 = (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1

goal (2 subgoals):
 1. sequentially \<noteq> bot
 2. (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
show \<dots>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1

goal (1 subgoal):
 1. (\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. root x (exp 1 ^ x * real x powr - (3 / 2))) \<longlonglongrightarrow> exp 1

goal (1 subgoal):
 1. sequentially \<noteq> bot
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. ereal (root n (exp 1 ^ n * real n powr - (3 / 2)))) = ereal (exp 1)

goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
conv_radius (($) fps_Lambert_W) = inverse (ereal (exp 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
conv_radius (($) fps_Lambert_W) = inverse (ereal (exp 1))

goal (1 subgoal):
 1. fps_conv_radius fps_Lambert_W = ereal (exp (- 1))
[PROOF STEP]
by (simp add: fps_conv_radius_def exp_minus)
[PROOF STATE]
proof (state)
this:
fps_conv_radius fps_Lambert_W = ereal (exp (- 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in CRR_market) bernoulli_expl_cond_expect_adapt:
  assumes "N = bernoulli_stream q"
and "0 < q"
and "q < 1"
  shows "expl_cond_expect N (proj_stoch_proc geom_proc n) f\<in> borel_measurable (G n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
have "sets N = sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets N = events
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N = bernoulli_stream q
0 < q
q < 1

goal (1 subgoal):
 1. sets N = events
[PROOF STEP]
by (simp add: bernoulli bernoulli_stream_def sets_stream_space_cong)
[PROOF STATE]
proof (state)
this:
sets N = events

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
have icf: "infinite_cts_filtration p M nat_filtration"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite_cts_filtration p M nat_filtration
[PROOF STEP]
by (unfold_locales, simp)
[PROOF STATE]
proof (state)
this:
infinite_cts_filtration p M nat_filtration

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
have "G n = stoch_proc_filt M geom_proc borel n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G n = stoch_proc_filt M geom_proc borel n
[PROOF STEP]
using stock_filtration
[PROOF STATE]
proof (prove)
using this:
G = stoch_proc_filt M geom_proc borel

goal (1 subgoal):
 1. G n = stoch_proc_filt M geom_proc borel n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
G n = stoch_proc_filt M geom_proc borel n

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
G n = stoch_proc_filt M geom_proc borel n

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
have "... = fct_gen_subalgebra M (stream_space borel) (proj_stoch_proc geom_proc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stoch_proc_filt M geom_proc borel n = fct_gen_subalgebra M (stream_space borel) (proj_stoch_proc geom_proc n)
[PROOF STEP]
proof (rule infinite_cts_filtration.stoch_proc_filt_gen)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. infinite_cts_filtration ?p M ?F
 2. borel_adapt_stoch_proc ?F geom_proc
[PROOF STEP]
show "infinite_cts_filtration p M nat_filtration"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite_cts_filtration p M nat_filtration
[PROOF STEP]
using icf
[PROOF STATE]
proof (prove)
using this:
infinite_cts_filtration p M nat_filtration

goal (1 subgoal):
 1. infinite_cts_filtration p M nat_filtration
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
infinite_cts_filtration p M nat_filtration

goal (1 subgoal):
 1. borel_adapt_stoch_proc nat_filtration geom_proc
[PROOF STEP]
show "borel_adapt_stoch_proc nat_filtration geom_proc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel_adapt_stoch_proc nat_filtration geom_proc
[PROOF STEP]
using geom_rand_walk_borel_adapted
[PROOF STATE]
proof (prove)
using this:
borel_adapt_stoch_proc nat_filtration geom_proc

goal (1 subgoal):
 1. borel_adapt_stoch_proc nat_filtration geom_proc
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
borel_adapt_stoch_proc nat_filtration geom_proc

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
stoch_proc_filt M geom_proc borel n = fct_gen_subalgebra M (stream_space borel) (proj_stoch_proc geom_proc n)

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
stoch_proc_filt M geom_proc borel n = fct_gen_subalgebra M (stream_space borel) (proj_stoch_proc geom_proc n)

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
have "... = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fct_gen_subalgebra M (stream_space borel) (proj_stoch_proc geom_proc n) = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)
[PROOF STEP]
by (rule fct_gen_subalgebra_eq_sets, (simp add: \<open>sets N = sets M\<close>))
[PROOF STATE]
proof (state)
this:
fct_gen_subalgebra M (stream_space borel) (proj_stoch_proc geom_proc n) = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)
[PROOF STEP]
have "G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)"
[PROOF STATE]
proof (prove)
using this:
G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)

goal (1 subgoal):
 1. G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
have "expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in>
    borel_measurable (fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n))
[PROOF STEP]
by (simp add: expl_cond_eq_sets assms)
[PROOF STATE]
proof (state)
this:
expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n))

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)
expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
G n = fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n)
expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (fct_gen_subalgebra N (stream_space borel) (proj_stoch_proc geom_proc n))

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
expl_cond_expect N (proj_stoch_proc geom_proc n) f \<in> borel_measurable (G n)

goal:
No subgoals!
[PROOF STEP]
qed