[STATEMENT]
lemma knights_path_drop:
  assumes "knights_path b ps" "0 < k" "k < length ps"
  shows "knights_path (set (drop k ps)) (drop k ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knights_path (set (drop k ps)) (drop k ps)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
knights_path b ps
0 < k
k < length ps

goal (1 subgoal):
 1. knights_path (set (drop k ps)) (drop k ps)
[PROOF STEP]
proof (induction arbitrary: k rule: knights_path.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s\<^sub>i k. \<lbrakk>0 < k; k < length [s\<^sub>i]\<rbrakk> \<Longrightarrow> knights_path (set (drop k [s\<^sub>i])) (drop k [s\<^sub>i])
 2. \<And>s\<^sub>i b s\<^sub>j ps k. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
case (2 s\<^sub>i b s\<^sub>j ps)
[PROOF STATE]
proof (state)
this:
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
\<lbrakk>0 < ?k; ?k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop ?k (s\<^sub>j # ps))) (drop ?k (s\<^sub>j # ps))
0 < k
k < length (s\<^sub>i # s\<^sub>j # ps)

goal (2 subgoals):
 1. \<And>s\<^sub>i k. \<lbrakk>0 < k; k < length [s\<^sub>i]\<rbrakk> \<Longrightarrow> knights_path (set (drop k [s\<^sub>i])) (drop k [s\<^sub>i])
 2. \<And>s\<^sub>i b s\<^sub>j ps k. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
\<lbrakk>0 < ?k; ?k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop ?k (s\<^sub>j # ps))) (drop ?k (s\<^sub>j # ps))
0 < k
k < length (s\<^sub>i # s\<^sub>j # ps)
[PROOF STEP]
have "(k = 1 \<and> ps = []) \<or> (k = 1 \<and> ps \<noteq> []) \<or> 1 < k"
[PROOF STATE]
proof (prove)
using this:
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
\<lbrakk>0 < ?k; ?k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop ?k (s\<^sub>j # ps))) (drop ?k (s\<^sub>j # ps))
0 < k
k < length (s\<^sub>i # s\<^sub>j # ps)

goal (1 subgoal):
 1. k = 1 \<and> ps = [] \<or> k = 1 \<and> ps \<noteq> [] \<or> 1 < k
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
k = 1 \<and> ps = [] \<or> k = 1 \<and> ps \<noteq> [] \<or> 1 < k

goal (2 subgoals):
 1. \<And>s\<^sub>i k. \<lbrakk>0 < k; k < length [s\<^sub>i]\<rbrakk> \<Longrightarrow> knights_path (set (drop k [s\<^sub>i])) (drop k [s\<^sub>i])
 2. \<And>s\<^sub>i b s\<^sub>j ps k. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = 1 \<and> ps = [] \<or> k = 1 \<and> ps \<noteq> [] \<or> 1 < k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
k = 1 \<and> ps = [] \<or> k = 1 \<and> ps \<noteq> [] \<or> 1 < k

goal (1 subgoal):
 1. knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
k = 1 \<and> ps = [] \<or> k = 1 \<and> ps \<noteq> [] \<or> 1 < k
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
\<lbrakk>0 < ?k; ?k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop ?k (s\<^sub>j # ps))) (drop ?k (s\<^sub>j # ps))
0 < k
k < length (s\<^sub>i # s\<^sub>j # ps)

goal (1 subgoal):
 1. knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
proof (elim disjE)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps = []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 2. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps \<noteq> []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 3. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); 1 < k\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
assume "k = 1 \<and> ps \<noteq> []"
[PROOF STATE]
proof (state)
this:
k = 1 \<and> ps \<noteq> []

goal (3 subgoals):
 1. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps = []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 2. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps \<noteq> []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 3. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); 1 < k\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = 1 \<and> ps \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = 1 \<and> ps \<noteq> []

goal (1 subgoal):
 1. knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
using 2 knights_path_set_eq
[PROOF STATE]
proof (prove)
using this:
k = 1 \<and> ps \<noteq> []
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
\<lbrakk>0 < ?k; ?k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop ?k (s\<^sub>j # ps))) (drop ?k (s\<^sub>j # ps))
0 < k
k < length (s\<^sub>i # s\<^sub>j # ps)
knights_path ?b ?ps \<Longrightarrow> set ?ps = ?b

goal (1 subgoal):
 1. knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))

goal (2 subgoals):
 1. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps = []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 2. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); 1 < k\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps = []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 2. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); 1 < k\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
assume "1 < k"
[PROOF STATE]
proof (state)
this:
1 < k

goal (2 subgoals):
 1. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps = []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 2. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); 1 < k\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < k
[PROOF STEP]
have "0 < k-1" "k-1 < length (s\<^sub>j#ps)" "drop k (s\<^sub>i#s\<^sub>j#ps) = drop (k-1) (s\<^sub>j#ps)"
[PROOF STATE]
proof (prove)
using this:
1 < k

goal (1 subgoal):
 1. 0 < k - 1 &&& k - 1 < length (s\<^sub>j # ps) &&& drop k (s\<^sub>i # s\<^sub>j # ps) = drop (k - 1) (s\<^sub>j # ps)
[PROOF STEP]
using assms 2 drop_Cons'[of k s\<^sub>i "s\<^sub>j#ps"]
[PROOF STATE]
proof (prove)
using this:
1 < k
knights_path b ps
0 < k
k < length ps
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
\<lbrakk>0 < ?k; ?k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop ?k (s\<^sub>j # ps))) (drop ?k (s\<^sub>j # ps))
0 < k
k < length (s\<^sub>i # s\<^sub>j # ps)
drop k (s\<^sub>i # s\<^sub>j # ps) = (if k = 0 then s\<^sub>i # s\<^sub>j # ps else drop (k - 1) (s\<^sub>j # ps))

goal (1 subgoal):
 1. 0 < k - 1 &&& k - 1 < length (s\<^sub>j # ps) &&& drop k (s\<^sub>i # s\<^sub>j # ps) = drop (k - 1) (s\<^sub>j # ps)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < k - 1
k - 1 < length (s\<^sub>j # ps)
drop k (s\<^sub>i # s\<^sub>j # ps) = drop (k - 1) (s\<^sub>j # ps)

goal (2 subgoals):
 1. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps = []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
 2. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); 1 < k\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < k - 1
k - 1 < length (s\<^sub>j # ps)
drop k (s\<^sub>i # s\<^sub>j # ps) = drop (k - 1) (s\<^sub>j # ps)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < k - 1
k - 1 < length (s\<^sub>j # ps)
drop k (s\<^sub>i # s\<^sub>j # ps) = drop (k - 1) (s\<^sub>j # ps)

goal (1 subgoal):
 1. knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
0 < k - 1
k - 1 < length (s\<^sub>j # ps)
drop k (s\<^sub>i # s\<^sub>j # ps) = drop (k - 1) (s\<^sub>j # ps)
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
\<lbrakk>0 < ?k; ?k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop ?k (s\<^sub>j # ps))) (drop ?k (s\<^sub>j # ps))
0 < k
k < length (s\<^sub>i # s\<^sub>j # ps)

goal (1 subgoal):
 1. knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))

goal (1 subgoal):
 1. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); \<And>k. \<lbrakk>0 < k; k < length (s\<^sub>j # ps)\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>j # ps))) (drop k (s\<^sub>j # ps)); 0 < k; k < length (s\<^sub>i # s\<^sub>j # ps); k = 1 \<and> ps = []\<rbrakk> \<Longrightarrow> knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
qed (auto intro: knights_path.intros)
[PROOF STATE]
proof (state)
this:
knights_path (set (drop k (s\<^sub>i # s\<^sub>j # ps))) (drop k (s\<^sub>i # s\<^sub>j # ps))

goal (1 subgoal):
 1. \<And>s\<^sub>i k. \<lbrakk>0 < k; k < length [s\<^sub>i]\<rbrakk> \<Longrightarrow> knights_path (set (drop k [s\<^sub>i])) (drop k [s\<^sub>i])
[PROOF STEP]
qed auto


[STATEMENT]
lemma cball_translation_subtract:
  "cball (c - a) r = (\<lambda>x. x - a) ` cball c r" for a :: "'n::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (c - a) r = (\<lambda>x. x - a) ` cball c r
[PROOF STEP]
using cball_translation [of "- a" c]
[PROOF STATE]
proof (prove)
using this:
cball (- a + c) ?r = (+) (- a) ` cball c ?r

goal (1 subgoal):
 1. cball (c - a) r = (\<lambda>x. x - a) ` cball c r
[PROOF STEP]
by (simp cong: image_cong_simp)


[STATEMENT]
lemma locally_compact_Int_cball:
  fixes S :: "'a :: heine_borel set"
  shows "locally compact S \<longleftrightarrow> (\<forall>x \<in> S. \<exists>e. 0 < e \<and> closed(cball x e \<inter> S))"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally compact S = (\<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. locally compact S \<Longrightarrow> \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S)
 2. \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S) \<Longrightarrow> locally compact S
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
locally compact S

goal (2 subgoals):
 1. locally compact S \<Longrightarrow> \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S)
 2. \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S) \<Longrightarrow> locally compact S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
locally compact S
[PROOF STEP]
have "\<And>x U V e. \<lbrakk>U \<subseteq> V; V \<subseteq> S; compact V; 0 < e; cball x e \<inter> S \<subseteq> U\<rbrakk>
       \<Longrightarrow> closed (cball x e \<inter> S)"
[PROOF STATE]
proof (prove)
using this:
locally compact S

goal (1 subgoal):
 1. \<And>x U V e. \<lbrakk>U \<subseteq> V; V \<subseteq> S; compact V; 0 < e; cball x e \<inter> S \<subseteq> U\<rbrakk> \<Longrightarrow> closed (cball x e \<inter> S)
[PROOF STEP]
by (metis compact_Int compact_cball compact_imp_closed inf.absorb_iff2 inf.assoc inf.orderE)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?U \<subseteq> ?V; ?V \<subseteq> S; compact ?V; 0 < ?e; cball ?x ?e \<inter> S \<subseteq> ?U\<rbrakk> \<Longrightarrow> closed (cball ?x ?e \<inter> S)

goal (2 subgoals):
 1. locally compact S \<Longrightarrow> \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S)
 2. \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S) \<Longrightarrow> locally compact S
[PROOF STEP]
with L
[PROOF STATE]
proof (chain)
picking this:
locally compact S
\<lbrakk>?U \<subseteq> ?V; ?V \<subseteq> S; compact ?V; 0 < ?e; cball ?x ?e \<inter> S \<subseteq> ?U\<rbrakk> \<Longrightarrow> closed (cball ?x ?e \<inter> S)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
locally compact S
\<lbrakk>?U \<subseteq> ?V; ?V \<subseteq> S; compact ?V; 0 < ?e; cball ?x ?e \<inter> S \<subseteq> ?U\<rbrakk> \<Longrightarrow> closed (cball ?x ?e \<inter> S)

goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S)
[PROOF STEP]
by (meson locally_compactE openin_contains_cball)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S)

goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S) \<Longrightarrow> locally compact S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S) \<Longrightarrow> locally compact S
[PROOF STEP]
assume R: ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S)

goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S) \<Longrightarrow> locally compact S
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally compact S
[PROOF STEP]
unfolding locally_compact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
assume "x \<in> S"
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
obtain e where "e>0" and e: "closed (cball x e \<inter> S)"
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; closed (cball x e \<inter> S)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
x \<in> S
\<forall>x\<in>S. \<exists>e>0. closed (cball x e \<inter> S)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; closed (cball x e \<inter> S)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < e
closed (cball x e \<inter> S)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
closed (cball x e \<inter> S)
[PROOF STEP]
have "compact (cball x e \<inter> S)"
[PROOF STATE]
proof (prove)
using this:
0 < e
closed (cball x e \<inter> S)

goal (1 subgoal):
 1. compact (cball x e \<inter> S)
[PROOF STEP]
by (simp add: bounded_Int compact_eq_bounded_closed)
[PROOF STATE]
proof (state)
this:
compact (cball x e \<inter> S)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
compact (cball x e \<inter> S)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
have "\<forall>y\<in>ball x e \<inter> S. \<exists>\<epsilon>>0. cball y \<epsilon> \<inter> S \<subseteq> ball x e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>ball x e \<inter> S. \<exists>\<epsilon>>0. cball y \<epsilon> \<inter> S \<subseteq> ball x e
[PROOF STEP]
by (meson Elementary_Metric_Spaces.open_ball IntD1 le_infI1 open_contains_cball_eq)
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>ball x e \<inter> S. \<exists>\<epsilon>>0. cball y \<epsilon> \<inter> S \<subseteq> ball x e

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>ball x e \<inter> S. \<exists>\<epsilon>>0. cball y \<epsilon> \<inter> S \<subseteq> ball x e

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
have "openin (top_of_set S) (ball x e \<inter> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set S) (ball x e \<inter> S)
[PROOF STEP]
by (simp add: inf_commute openin_open_Int)
[PROOF STATE]
proof (state)
this:
openin (top_of_set S) (ball x e \<inter> S)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
compact (cball x e \<inter> S)
\<forall>y\<in>ball x e \<inter> S. \<exists>\<epsilon>>0. cball y \<epsilon> \<inter> S \<subseteq> ball x e
openin (top_of_set S) (ball x e \<inter> S)
[PROOF STEP]
show "\<exists>U V. x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V"
[PROOF STATE]
proof (prove)
using this:
compact (cball x e \<inter> S)
\<forall>y\<in>ball x e \<inter> S. \<exists>\<epsilon>>0. cball y \<epsilon> \<inter> S \<subseteq> ball x e
openin (top_of_set S) (ball x e \<inter> S)

goal (1 subgoal):
 1. \<exists>U V. x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V
[PROOF STEP]
by (metis Int_iff \<open>0 < e\<close> \<open>x \<in> S\<close> ball_subset_cball centre_in_ball inf_commute inf_le1 inf_mono order_refl)
[PROOF STATE]
proof (state)
this:
\<exists>U V. x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma asymp_equiv_imp_eventually_le:
  assumes "f \<sim>[F] g" "c > 1"
  shows   "eventually (\<lambda>x. norm (f x) \<le> c * norm (g x)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
from order_tendstoD(2)[OF asymp_equivD[OF asymp_equiv_norm[OF assms(1)]] assms(2)]
       asymp_equiv_eventually_zeros[OF assms(1)]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. (if norm (f x) = 0 \<and> norm (g x) = 0 then 1 else norm (f x) / norm (g x)) < c
\<forall>\<^sub>F x in F. (f x = (0::'b)) = (g x = (0::'b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. (if norm (f x) = 0 \<and> norm (g x) = 0 then 1 else norm (f x) / norm (g x)) < c
\<forall>\<^sub>F x in F. (f x = (0::'b)) = (g x = (0::'b))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
by eventually_elim (auto split: if_splits simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonpos_Ints_add:
  "x \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> y \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> x + y \<in> \<int>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<int>\<^sub>\<le>\<^sub>0; y \<in> \<int>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> x + y \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
using Nats_add[of "-x" "-y"] uminus_in_Nats_iff[of "y+x", simplified minus_add]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- x \<in> \<nat>; - y \<in> \<nat>\<rbrakk> \<Longrightarrow> - x + - y \<in> \<nat>
(- x + - y \<in> \<nat>) = (y + x \<in> \<int>\<^sub>\<le>\<^sub>0)

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<int>\<^sub>\<le>\<^sub>0; y \<in> \<int>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> x + y \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (simp add: uminus_in_Nats_iff add.commute)


[STATEMENT]
lemma join_cont2:
  assumes "chain Y"
  assumes compat: "\<And> i. compatible x (Y i)"
  shows "x \<squnion> (\<Squnion>i. Y i) = (\<Squnion> i. x \<squnion> Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> (\<Squnion>i. Y i) = (\<Squnion>i. x \<squnion> Y i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<squnion> (\<Squnion>i. Y i) = (\<Squnion>i. x \<squnion> Y i)
[PROOF STEP]
have c: "chain (\<lambda>i. x \<squnion> Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain (\<lambda>i. x \<squnion> Y i)
[PROOF STEP]
apply (rule chainI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. x \<squnion> Y i \<sqsubseteq> x \<squnion> Y (Suc i)
[PROOF STEP]
apply (rule join_mono[OF compat compat below_refl chainE[OF \<open>chain Y\<close>]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
chain (\<lambda>i. x \<squnion> Y i)

goal (1 subgoal):
 1. x \<squnion> (\<Squnion>i. Y i) = (\<Squnion>i. x \<squnion> Y i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> (\<Squnion>i. Y i) = (\<Squnion>i. x \<squnion> Y i)
[PROOF STEP]
apply (rule is_joinI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x \<sqsubseteq> (\<Squnion>i. x \<squnion> Y i)
 2. (\<Squnion>i. Y i) \<sqsubseteq> (\<Squnion>i. x \<squnion> Y i)
 3. \<And>a. \<lbrakk>x \<sqsubseteq> a; (\<Squnion>i. Y i) \<sqsubseteq> a\<rbrakk> \<Longrightarrow> (\<Squnion>i. x \<squnion> Y i) \<sqsubseteq> a
[PROOF STEP]
apply (rule below_lub[OF c join_above1[OF compat]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<Squnion>i. Y i) \<sqsubseteq> (\<Squnion>i. x \<squnion> Y i)
 2. \<And>a. \<lbrakk>x \<sqsubseteq> a; (\<Squnion>i. Y i) \<sqsubseteq> a\<rbrakk> \<Longrightarrow> (\<Squnion>i. x \<squnion> Y i) \<sqsubseteq> a
[PROOF STEP]
apply (rule lub_mono[OF \<open>chain Y\<close> c join_above2[OF compat]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>x \<sqsubseteq> a; (\<Squnion>i. Y i) \<sqsubseteq> a\<rbrakk> \<Longrightarrow> (\<Squnion>i. x \<squnion> Y i) \<sqsubseteq> a
[PROOF STEP]
apply (rule lub_below[OF c])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a i. \<lbrakk>x \<sqsubseteq> a; (\<Squnion>i. Y i) \<sqsubseteq> a\<rbrakk> \<Longrightarrow> x \<squnion> Y i \<sqsubseteq> a
[PROOF STEP]
apply (rule join_below[OF compat])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a i. \<lbrakk>x \<sqsubseteq> a; (\<Squnion>i. Y i) \<sqsubseteq> a\<rbrakk> \<Longrightarrow> x \<sqsubseteq> a
 2. \<And>a i. \<lbrakk>x \<sqsubseteq> a; (\<Squnion>i. Y i) \<sqsubseteq> a\<rbrakk> \<Longrightarrow> Y i \<sqsubseteq> a
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a i. \<lbrakk>x \<sqsubseteq> a; (\<Squnion>i. Y i) \<sqsubseteq> a\<rbrakk> \<Longrightarrow> Y i \<sqsubseteq> a
[PROOF STEP]
apply (metis lub_below_iff[OF \<open>chain Y\<close>])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
x \<squnion> (\<Squnion>i. Y i) = (\<Squnion>i. x \<squnion> Y i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_Un [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<union> T)
[PROOF STEP]
unfolding closed_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open (- S); open (- T)\<rbrakk> \<Longrightarrow> open (- (S \<union> T))
[PROOF STEP]
by auto


[STATEMENT]
lemma log_le: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> x \<le> y \<Longrightarrow> log a x \<le> log a y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x; x \<le> y\<rbrakk> \<Longrightarrow> log a x \<le> log a y
[PROOF STEP]
by (subst log_le_cancel_iff) auto


[STATEMENT]
lemma card_subset_not_gt_card: "finite A \<Longrightarrow> card ps > card A \<Longrightarrow> \<not> (ps \<subseteq> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; card A < card ps\<rbrakk> \<Longrightarrow> \<not> ps \<subseteq> A
[PROOF STEP]
using card_mono leD
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B
?y \<le> ?x \<Longrightarrow> \<not> ?x < ?y

goal (1 subgoal):
 1. \<lbrakk>finite A; card A < card ps\<rbrakk> \<Longrightarrow> \<not> ps \<subseteq> A
[PROOF STEP]
by auto


[STATEMENT]
lemma fixed_a_b_add: "fixed(a) \<and> fixed(b) \<longrightarrow> fixed(a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fixed a \<and> fixed b \<longrightarrow> fixed (a + b)
[PROOF STEP]
unfolding fixed_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s. s \<noteq> \<dd> \<longrightarrow> s \<circ> a = a) \<and> (\<forall>s. s \<noteq> \<dd> \<longrightarrow> s \<circ> b = b) \<longrightarrow> (\<forall>s. s \<noteq> \<dd> \<longrightarrow> s \<circ> (a + b) = a + b)
[PROOF STEP]
by simp


[STATEMENT]
lemma set_map_lcomp [simp]: "set (map_lcomp xs a) = (\<lambda>x. x ;\<^sub>S a) ` set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map_lcomp xs a) = (\<lambda>x. x ;\<^sub>S a) ` set xs
[PROOF STEP]
by (simp add: map_lcomp_def)


[STATEMENT]
lemma finite_deg_sect:
  assumes "finite X"
  shows "finite ((deg_sect X d)::('x::countable \<Rightarrow>\<^sub>0 nat) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (deg_sect X d)
[PROOF STEP]
proof (induct d)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (deg_sect X 0)
 2. \<And>d. finite (deg_sect X d) \<Longrightarrow> finite (deg_sect X (Suc d))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. finite (deg_sect X 0)
 2. \<And>d. finite (deg_sect X d) \<Longrightarrow> finite (deg_sect X (Suc d))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (deg_sect X 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (deg_sect X 0)

goal (1 subgoal):
 1. \<And>d. finite (deg_sect X d) \<Longrightarrow> finite (deg_sect X (Suc d))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d. finite (deg_sect X d) \<Longrightarrow> finite (deg_sect X (Suc d))
[PROOF STEP]
case (Suc d)
[PROOF STATE]
proof (state)
this:
finite (deg_sect X d)

goal (1 subgoal):
 1. \<And>d. finite (deg_sect X d) \<Longrightarrow> finite (deg_sect X (Suc d))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite X
finite (deg_sect X d)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite X
finite (deg_sect X d)

goal (1 subgoal):
 1. finite (deg_sect X (Suc d))
[PROOF STEP]
by (simp add: deg_sect_Suc)
[PROOF STATE]
proof (state)
this:
finite (deg_sect X (Suc d))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filterlim_at_infinity_imp_eventually_ne:
  assumes "filterlim f at_infinity F"
  shows "eventually (\<lambda>z. f z \<noteq> c) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F z in F. f z \<noteq> c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F z in F. f z \<noteq> c
[PROOF STEP]
have "norm c + 1 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < norm c + 1
[PROOF STEP]
by (intro add_nonneg_pos) simp_all
[PROOF STATE]
proof (state)
this:
0 < norm c + 1

goal (1 subgoal):
 1. \<forall>\<^sub>F z in F. f z \<noteq> c
[PROOF STEP]
with filterlim_at_infinity[OF order.refl, of f F] assms
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_infinity F = (\<forall>r>0. \<forall>\<^sub>F x in F. r \<le> norm (f x))
filterlim f at_infinity F
0 < norm c + 1
[PROOF STEP]
have "eventually (\<lambda>z. norm (f z) \<ge> norm c + 1) F"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_infinity F = (\<forall>r>0. \<forall>\<^sub>F x in F. r \<le> norm (f x))
filterlim f at_infinity F
0 < norm c + 1

goal (1 subgoal):
 1. \<forall>\<^sub>F z in F. norm c + 1 \<le> norm (f z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in F. norm c + 1 \<le> norm (f z)

goal (1 subgoal):
 1. \<forall>\<^sub>F z in F. f z \<noteq> c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F z in F. norm c + 1 \<le> norm (f z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F z in F. norm c + 1 \<le> norm (f z)

goal (1 subgoal):
 1. \<forall>\<^sub>F z in F. f z \<noteq> c
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in F. f z \<noteq> c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in monoid) order_in_range_Suc: "order G \<in> range Suc \<longleftrightarrow> finite (carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (order G \<in> range Suc) = finite (carrier G)
[PROOF STEP]
by(cases "order G")(auto simp add: order_def carrier_not_empty intro: card_ge_0_finite)


[STATEMENT]
lemma finite_SSuffixes:
  shows "finite (SSuffixes s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (SSuffixes s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (SSuffixes s)
[PROOF STEP]
have "SSuffixes s \<subseteq> Suffixes s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SSuffixes s \<subseteq> Suffixes s
[PROOF STEP]
unfolding strict_suffix_def suffix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {s'. (\<exists>zs. s = zs @ s') \<and> s' \<noteq> s} \<subseteq> {s'. \<exists>zs. s = zs @ s'}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
SSuffixes s \<subseteq> Suffixes s

goal (1 subgoal):
 1. finite (SSuffixes s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
SSuffixes s \<subseteq> Suffixes s
[PROOF STEP]
show "finite (SSuffixes s)"
[PROOF STATE]
proof (prove)
using this:
SSuffixes s \<subseteq> Suffixes s

goal (1 subgoal):
 1. finite (SSuffixes s)
[PROOF STEP]
using finite_Suffixes finite_subset
[PROOF STATE]
proof (prove)
using this:
SSuffixes s \<subseteq> Suffixes s
finite (Suffixes ?s)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cpx_sq_mat) spectrum_to_pm_idx_bij:
assumes "hermitian A"
  and "A\<in> fc_mats"
shows "bij_betw (spectrum_to_pm_idx A) (spectrum A) {..< card (spectrum A)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
define p where "p = proj_meas_size (make_pm A)"
[PROOF STATE]
proof (state)
this:
p = proj_meas_size (make_pm A)

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
define M where "M = proj_meas_outcomes (make_pm A)"
[PROOF STATE]
proof (state)
this:
M = proj_meas_outcomes (make_pm A)

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
have es: "char_poly A = (\<Prod> (e :: complex) \<leftarrow> (eigvals A). [:- e, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])
[PROOF STEP]
using assms fc_mats_carrier eigvals_poly_length dim_eq
[PROOF STATE]
proof (prove)
using this:
hermitian A
A \<in> fc_mats
fc_mats = carrier_mat dimR dimC
?M \<in> carrier_mat ?n ?n \<Longrightarrow> char_poly ?M = (\<Prod>a\<leftarrow>eigvals ?M. [:- a, 1:]) \<and> length (eigvals ?M) = dim_row ?M
dimR = dimC

goal (1 subgoal):
 1. char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
obtain B U Q where us: "unitary_schur_decomposition A (eigvals A) = (B,U,Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B U Q. unitary_schur_decomposition A (eigvals A) = (B, U, Q) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "unitary_schur_decomposition A (eigvals A)")
[PROOF STATE]
proof (state)
this:
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
hence pr: "similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and>
      diag_mat B = (eigvals A)"
[PROOF STATE]
proof (prove)
using this:
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diag_mat B = eigvals A
[PROOF STEP]
using hermitian_eigenvalue_real assms fc_mats_carrier es dim_eq
[PROOF STATE]
proof (prove)
using this:
unitary_schur_decomposition A (eigvals A) = (B, U, Q)
\<lbrakk>?A \<in> carrier_mat ?n ?n; hermitian ?A; char_poly ?A = (\<Prod>e\<leftarrow>?es. [:- e, 1:]); unitary_schur_decomposition ?A ?es = (?B, ?P, ?Q)\<rbrakk> \<Longrightarrow> similar_mat_wit ?A ?B ?P (Complex_Matrix.adjoint ?P) \<and> diagonal_mat ?B \<and> diag_mat ?B = ?es \<and> Complex_Matrix.unitary ?P \<and> (\<forall>i<?n. ?B $$ (i, i) \<in> \<real>)
hermitian A
A \<in> fc_mats
fc_mats = carrier_mat dimR dimC
char_poly A = (\<Prod>e\<leftarrow>eigvals A. [:- e, 1:])
dimR = dimC

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diag_mat B = eigvals A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diag_mat B = eigvals A

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
have "(p,M) = make_pm A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p, M) = make_pm A
[PROOF STEP]
unfolding p_def M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj_meas_size (make_pm A), proj_meas_outcomes (make_pm A)) = make_pm A
[PROOF STEP]
using make_pm_decomp
[PROOF STATE]
proof (prove)
using this:
make_pm ?A = (proj_meas_size (make_pm ?A), proj_meas_outcomes (make_pm ?A))

goal (1 subgoal):
 1. (proj_meas_size (make_pm A), proj_meas_outcomes (make_pm A)) = make_pm A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(p, M) = make_pm A

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
hence "p = dist_el_card B"
[PROOF STATE]
proof (prove)
using this:
(p, M) = make_pm A

goal (1 subgoal):
 1. p = dist_el_card B
[PROOF STEP]
using assms us
[PROOF STATE]
proof (prove)
using this:
(p, M) = make_pm A
hermitian A
A \<in> fc_mats
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. p = dist_el_card B
[PROOF STEP]
unfolding make_pm_def
[PROOF STATE]
proof (prove)
using this:
(p, M) = (let (B, U, uu_) = unitary_schur_decomposition A (eigvals A) in (dist_el_card B, mk_meas_outcome B U))
hermitian A
A \<in> fc_mats
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. p = dist_el_card B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = dist_el_card B

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
have dimB: "B \<in> carrier_mat dimR dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat dimR dimR
[PROOF STEP]
using  dim_eq pr assms
      fc_mats_carrier
[PROOF STATE]
proof (prove)
using this:
dimR = dimC
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diag_mat B = eigvals A
hermitian A
A \<in> fc_mats
fc_mats = carrier_mat dimR dimC

goal (1 subgoal):
 1. B \<in> carrier_mat dimR dimR
[PROOF STEP]
unfolding similar_mat_wit_def
[PROOF STATE]
proof (prove)
using this:
dimR = dimC
(let n = dim_row A in {A, B, U, Complex_Matrix.adjoint U} \<subseteq> carrier_mat n n \<and> U * Complex_Matrix.adjoint U = 1\<^sub>m n \<and> Complex_Matrix.adjoint U * U = 1\<^sub>m n \<and> A = U * B * Complex_Matrix.adjoint U) \<and> diag_mat B = eigvals A
hermitian A
A \<in> fc_mats
fc_mats = carrier_mat dimR dimC

goal (1 subgoal):
 1. B \<in> carrier_mat dimR dimR
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat dimR dimR

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
have Bvals: "diag_mat B = eigvals A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat B = eigvals A
[PROOF STEP]
using pr hermitian_decomp_eigenvalues[of A B U]
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diag_mat B = eigvals A
hermitian_decomp A B U \<Longrightarrow> diag_mat B = eigvals A

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

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
have "diag_elems B = spectrum A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_elems B = spectrum A
[PROOF STEP]
unfolding spectrum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_elems B = set (eigvals A)
[PROOF STEP]
using dimB Bvals
      diag_elems_set_diag_mat[of B]
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat dimR dimR
diag_mat B = eigvals A
diag_elems B = set (diag_mat B)

goal (1 subgoal):
 1. diag_elems B = set (eigvals A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_elems B = spectrum A

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
diag_elems B = spectrum A

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
have "dist_el_card B = card (spectrum A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist_el_card B = card (spectrum A)
[PROOF STEP]
using spectrum_size[of A p M] assms
      \<open>(p,M) = make_pm A\<close> \<open>p = dist_el_card B\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>hermitian A; A \<in> fc_mats; make_pm A = (p, M)\<rbrakk> \<Longrightarrow> p = card (spectrum A)
hermitian A
A \<in> fc_mats
(p, M) = make_pm A
p = dist_el_card B

goal (1 subgoal):
 1. dist_el_card B = card (spectrum A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist_el_card B = card (spectrum A)

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
diag_elems B = spectrum A
dist_el_card B = card (spectrum A)
[PROOF STEP]
show "bij_betw (spectrum_to_pm_idx A) (spectrum A) {..< card (spectrum A)}"
[PROOF STATE]
proof (prove)
using this:
diag_elems B = spectrum A
dist_el_card B = card (spectrum A)

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
using diag_el_to_idx_bij us
[PROOF STATE]
proof (prove)
using this:
diag_elems B = spectrum A
dist_el_card B = card (spectrum A)
bij_betw (diag_el_to_idx ?B) (diag_elems ?B) {..<dist_el_card ?B}
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
unfolding spectrum_to_pm_idx_def Let_def
[PROOF STATE]
proof (prove)
using this:
diag_elems B = spectrum A
dist_el_card B = card (spectrum A)
bij_betw (diag_el_to_idx ?B) (diag_elems ?B) {..<dist_el_card ?B}
unitary_schur_decomposition A (eigvals A) = (B, U, Q)

goal (1 subgoal):
 1. bij_betw (\<lambda>x. case unitary_schur_decomposition A (eigvals A) of (B, U, uu_) \<Rightarrow> diag_el_to_idx B x) (spectrum A) {..<card (spectrum A)}
[PROOF STEP]
by (metis (mono_tags, lifting) bij_betw_cong case_prod_conv)
[PROOF STATE]
proof (state)
this:
bij_betw (spectrum_to_pm_idx A) (spectrum A) {..<card (spectrum A)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_path_weight: "path l1 l2 xs \<Longrightarrow> \<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_path_weights xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path l1 l2 xs \<Longrightarrow> \<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path l1 l2 xs \<Longrightarrow> \<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
assume "path l1 l2 xs"
[PROOF STATE]
proof (state)
this:
path l1 l2 xs

goal (1 subgoal):
 1. path l1 l2 xs \<Longrightarrow> \<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path l1 l2 xs
[PROOF STEP]
have "sum_path_weights xs \<in> {x. path_weightp l1 l2 x}"
[PROOF STATE]
proof (prove)
using this:
path l1 l2 xs

goal (1 subgoal):
 1. sum_weights (map (\<lambda>(s, l, t). l) xs) \<in> {x. path_weightp l1 l2 x}
[PROOF STEP]
by (auto simp: path_weightp_def)
[PROOF STATE]
proof (state)
this:
sum_weights (map (\<lambda>(s, l, t). l) xs) \<in> {x. path_weightp l1 l2 x}

goal (1 subgoal):
 1. path l1 l2 xs \<Longrightarrow> \<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum_weights (map (\<lambda>(s, l, t). l) xs) \<in> {x. path_weightp l1 l2 x}
[PROOF STEP]
obtain u where "u \<in> minimal_antichain {x. path_weightp l1 l2 x} \<and> u \<le> sum_path_weights xs"
[PROOF STATE]
proof (prove)
using this:
sum_weights (map (\<lambda>(s, l, t). l) xs) \<in> {x. path_weightp l1 l2 x}

goal (1 subgoal):
 1. (\<And>u. u \<in> minimal_antichain {x. path_weightp l1 l2 x} \<and> u \<le> sum_weights (map (\<lambda>(s, l, t). l) xs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply atomize_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_weights (map (\<lambda>a. case a of (s, l, t) \<Rightarrow> l) xs) \<in> {x. path_weightp l1 l2 x} \<Longrightarrow> \<exists>u. u \<in> minimal_antichain (Collect (path_weightp l1 l2)) \<and> u \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
apply (drule minimal_antichain_path_weightp_member)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. u \<in> minimal_antichain {x. path_weightp l1 l2 x} \<and> u \<le> sum_weights (map (\<lambda>a. case a of (s, l, t) \<Rightarrow> l) xs) \<Longrightarrow> \<exists>u. u \<in> minimal_antichain (Collect (path_weightp l1 l2)) \<and> u \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
u \<in> minimal_antichain {x. path_weightp l1 l2 x} \<and> u \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)

goal (1 subgoal):
 1. path l1 l2 xs \<Longrightarrow> \<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> minimal_antichain {x. path_weightp l1 l2 x} \<and> u \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u \<in> minimal_antichain {x. path_weightp l1 l2 x} \<and> u \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)

goal (1 subgoal):
 1. \<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (state)
this:
\<exists>s. s \<in>\<^sub>A path_weight l1 l2 \<and> s \<le> sum_weights (map (\<lambda>(s, l, t). l) xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_compose2_UNIV:
  "continuous_on UNIV g \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. g (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on UNIV g; continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on s (\<lambda>x. g (f x))
[PROOF STEP]
by (rule continuous_on_compose2[of UNIV g s f]) simp_all


[STATEMENT]
lemma nn_transfer_operator_intg_Tn:
  assumes "f \<in> borel_measurable M" "g \<in> borel_measurable M"
  shows "(\<integral>\<^sup>+ x. (nn_transfer_operator^^n) g x * f x \<partial>M) = (\<integral>\<^sup>+ x. g x * f ((T^^n) x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (nn_transfer_operator ^^ n) g x * f x \<partial>M = \<integral>\<^sup>+ x. g x * f ((T ^^ n) x) \<partial>M
[PROOF STEP]
using nn_transfer_operator_intTn_g[OF assms, of n]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. f x * (nn_transfer_operator ^^ n) g x \<partial>M = \<integral>\<^sup>+ x. f ((T ^^ n) x) * g x \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (nn_transfer_operator ^^ n) g x * f x \<partial>M = \<integral>\<^sup>+ x. g x * f ((T ^^ n) x) \<partial>M
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma sorted_map:
  "sorted (map f xs) = sorted_wrt (\<lambda>x y. f x \<le> f y) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (map f xs) = sorted_wrt (\<lambda>x y. f x \<le> f y) xs
[PROOF STEP]
by (simp add: sorted_wrt_map)


[STATEMENT]
lemma set_encoding:
  assumes "is_encoding e"
  shows "is_encoding (S\<^sub>e e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_encoding (S\<^sub>e e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_encoding (S\<^sub>e e)
[PROOF STEP]
have a:"inj_on (the \<circ> e) (dom e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (the \<circ> e) (dom e)
[PROOF STEP]
using inj_on_def
[PROOF STATE]
proof (prove)
using this:
inj_on ?f ?A = (\<forall>x\<in>?A. \<forall>y\<in>?A. ?f x = ?f y \<longrightarrow> x = y)

goal (1 subgoal):
 1. inj_on (the \<circ> e) (dom e)
[PROOF STEP]
by (intro comp_inj_on encoding_imp_inj assms, fastforce)
[PROOF STATE]
proof (state)
this:
inj_on (the \<circ> e) (dom e)

goal (1 subgoal):
 1. is_encoding (S\<^sub>e e)
[PROOF STEP]
interpret folding_insort_key "(\<le>)" "(<)" "(dom e)" "(the \<circ> e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. folding_insort_key (\<le>) (<) (dom e) (the \<circ> e)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
inj_on (the \<circ> e) (dom e)

goal (1 subgoal):
 1. folding_insort_key (\<le>) (<) (dom e) (the \<circ> e)
[PROOF STEP]
by (unfold_locales) auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_encoding (S\<^sub>e e)
[PROOF STEP]
have "is_encoding (\<lambda>S. S\<^sub>e e S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_encoding (S\<^sub>e e)
[PROOF STEP]
unfolding S\<^sub>e_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_encoding (\<lambda>S. if finite S \<and> S \<subseteq> dom e then L\<^sub>e e (linorder.sorted_key_list_of_set (\<le>) (the \<circ> e) S) else None)
[PROOF STEP]
using sorted_key_list_of_set_inject
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> dom e; ?B \<subseteq> dom e; linorder.sorted_key_list_of_set (\<le>) (the \<circ> e) ?A = linorder.sorted_key_list_of_set (\<le>) (the \<circ> e) ?B; finite ?A; finite ?B\<rbrakk> \<Longrightarrow> ?A = ?B

goal (1 subgoal):
 1. is_encoding (\<lambda>S. if finite S \<and> S \<subseteq> dom e then L\<^sub>e e (linorder.sorted_key_list_of_set (\<le>) (the \<circ> e) S) else None)
[PROOF STEP]
by (intro encoding_compose[where f="L\<^sub>e e"] list_encoding assms(1) inj_onI, simp)
[PROOF STATE]
proof (state)
this:
is_encoding (S\<^sub>e e)

goal (1 subgoal):
 1. is_encoding (S\<^sub>e e)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_encoding (S\<^sub>e e)

goal (1 subgoal):
 1. is_encoding (S\<^sub>e e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_encoding (S\<^sub>e e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma frechet_derivative_compose_eucl:
  "frechet_derivative (f o g) (at x) =
    (\<lambda>v. \<Sum>i\<in>Basis. ((frechet_derivative g (at x) v) \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)"
  (is "?l = ?r")
  if "g differentiable at x" "f differentiable at (g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (f \<circ> g) (at x) = (\<lambda>v. \<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
interpret g: linear "frechet_derivative g (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (frechet_derivative g (at x))
[PROOF STEP]
using that(1)
[PROOF STATE]
proof (prove)
using this:
g differentiable at x

goal (1 subgoal):
 1. linear (frechet_derivative g (at x))
[PROOF STEP]
by (rule linear_frechet_derivative)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
interpret f: linear "frechet_derivative f (at (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (frechet_derivative f (at (g x)))
[PROOF STEP]
using that(2)
[PROOF STATE]
proof (prove)
using this:
f differentiable at (g x)

goal (1 subgoal):
 1. linear (frechet_derivative f (at (g x)))
[PROOF STEP]
by (rule linear_frechet_derivative)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
have "frechet_derivative (f o g) (at x) v =
    frechet_derivative f (at (g x)) (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (f \<circ> g) (at x) v = frechet_derivative f (at (g x)) (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R i)
[PROOF STEP]
unfolding frechet_derivative_compose[OF that] o_apply
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative f (at (g x)) (frechet_derivative g (at x) v) = frechet_derivative f (at (g x)) (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R i)
[PROOF STEP]
by (simp add: euclidean_representation)
[PROOF STATE]
proof (state)
this:
frechet_derivative (f \<circ> g) (at x) v = frechet_derivative f (at (g x)) (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R i)

goal (1 subgoal):
 1. \<And>v. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
frechet_derivative (f \<circ> g) (at x) v = frechet_derivative f (at (g x)) (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R i)

goal (1 subgoal):
 1. \<And>v. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
have "\<dots> = ?r v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative f (at (g x)) (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
by (auto simp: g.sum g.scaleR f.sum f.scaleR)
[PROOF STATE]
proof (state)
this:
frechet_derivative f (at (g x)) (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)

goal (1 subgoal):
 1. \<And>v. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
show "?l v = ?r v"
[PROOF STATE]
proof (prove)
using this:
frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)

goal (1 subgoal):
 1. frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
frechet_derivative (f \<circ> g) (at x) v = (\<Sum>i\<in>Basis. (frechet_derivative g (at x) v \<bullet> i) *\<^sub>R frechet_derivative f (at (g x)) i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smult_sum_list_distrib :
  "r \<in> R \<Longrightarrow> set ms \<subseteq> M \<Longrightarrow> r \<cdot> (sum_list ms) = (\<Sum>m\<leftarrow>ms. r \<cdot> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<in> R; set ms \<subseteq> M\<rbrakk> \<Longrightarrow> r \<cdot> sum_list ms = sum_list (map ((\<cdot>) r) ms)
[PROOF STEP]
using smult_zero sum_list_closed[of id]
[PROOF STATE]
proof (prove)
using this:
?r \<in> R \<Longrightarrow> ?r \<cdot> (0::'m) = (0::'m)
set (map id ?as) \<subseteq> M \<Longrightarrow> sum_list (map id ?as) \<in> M

goal (1 subgoal):
 1. \<lbrakk>r \<in> R; set ms \<subseteq> M\<rbrakk> \<Longrightarrow> r \<cdot> sum_list ms = sum_list (map ((\<cdot>) r) ms)
[PROOF STEP]
by (induct ms) auto


[STATEMENT]
lemma ennexp_continuous:
  "continuous_on UNIV ennexp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV ennexp
[PROOF STEP]
apply (rule continuous_onI_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. open (range ennexp)
 2. \<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; x \<le> y\<rbrakk> \<Longrightarrow> ennexp x \<le> ennexp y
[PROOF STEP]
using ennexp_mono
[PROOF STATE]
proof (prove)
using this:
mono ennexp

goal (2 subgoals):
 1. open (range ennexp)
 2. \<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; x \<le> y\<rbrakk> \<Longrightarrow> ennexp x \<le> ennexp y
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x \<le> y \<longrightarrow> ennexp x \<le> ennexp y

goal (2 subgoals):
 1. open (range ennexp)
 2. \<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; x \<le> y\<rbrakk> \<Longrightarrow> ennexp x \<le> ennexp y
[PROOF STEP]
by (auto simp add: bij_ennexp bij_is_surj)


[STATEMENT]
lemma (in geodesic_space) geodesic_segment_param_in_geodesic_spaces [simp]:
  "geodesic_segment_param {x--y} x 0 = x"
  "geodesic_segment_param {x--y} x (dist x y) = y"
  "t \<in> {0..dist x y} \<Longrightarrow> geodesic_segment_param {x--y} x t \<in> {x--y}"
  "isometry_on {0..dist x y} (geodesic_segment_param {x--y} x)"
  "(geodesic_segment_param {x--y} x)`{0..dist x y} = {x--y}"
  "t \<in> {0..dist x y} \<Longrightarrow> dist x (geodesic_segment_param {x--y} x t) = t"
  "s \<in> {0..dist x y} \<Longrightarrow> t \<in> {0..dist x y} \<Longrightarrow> dist (geodesic_segment_param {x--y} x s) (geodesic_segment_param {x--y} x t) = abs(s-t)"
  "z \<in> {x--y} \<Longrightarrow> z = geodesic_segment_param {x--y} x (dist x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((geodesic_segment_param {x--y} x 0 = x &&& geodesic_segment_param {x--y} x (dist x y) = y) &&& (t \<in> {0..dist x y} \<Longrightarrow> geodesic_segment_param {x--y} x t \<in> {x--y}) &&& isometry_on {0..dist x y} (geodesic_segment_param {x--y} x)) &&& (geodesic_segment_param {x--y} x ` {0..dist x y} = {x--y} &&& (t \<in> {0..dist x y} \<Longrightarrow> dist x (geodesic_segment_param {x--y} x t) = t)) &&& (\<lbrakk>s \<in> {0..dist x y}; t \<in> {0..dist x y}\<rbrakk> \<Longrightarrow> dist (geodesic_segment_param {x--y} x s) (geodesic_segment_param {x--y} x t) = \<bar>s - t\<bar>) &&& (z \<in> {x--y} \<Longrightarrow> z = geodesic_segment_param {x--y} x (dist x z))
[PROOF STEP]
using geodesic_segment_param[OF some_geodesic_is_geodesic_segment(1)[of x y]]
[PROOF STATE]
proof (prove)
using this:
geodesic_segment_param {x--y} x 0 = x
geodesic_segment_param {x--y} x (dist x y) = y
?t \<in> {0..dist x y} \<Longrightarrow> geodesic_segment_param {x--y} x ?t \<in> {x--y}
isometry_on {0..dist x y} (geodesic_segment_param {x--y} x)
geodesic_segment_param {x--y} x ` {0..dist x y} = {x--y}
?t \<in> {0..dist x y} \<Longrightarrow> dist x (geodesic_segment_param {x--y} x ?t) = ?t
\<lbrakk>?s \<in> {0..dist x y}; ?t \<in> {0..dist x y}\<rbrakk> \<Longrightarrow> dist (geodesic_segment_param {x--y} x ?s) (geodesic_segment_param {x--y} x ?t) = \<bar>?s - ?t\<bar>
?z \<in> {x--y} \<Longrightarrow> ?z = geodesic_segment_param {x--y} x (dist x ?z)

goal (1 subgoal):
 1. ((geodesic_segment_param {x--y} x 0 = x &&& geodesic_segment_param {x--y} x (dist x y) = y) &&& (t \<in> {0..dist x y} \<Longrightarrow> geodesic_segment_param {x--y} x t \<in> {x--y}) &&& isometry_on {0..dist x y} (geodesic_segment_param {x--y} x)) &&& (geodesic_segment_param {x--y} x ` {0..dist x y} = {x--y} &&& (t \<in> {0..dist x y} \<Longrightarrow> dist x (geodesic_segment_param {x--y} x t) = t)) &&& (\<lbrakk>s \<in> {0..dist x y}; t \<in> {0..dist x y}\<rbrakk> \<Longrightarrow> dist (geodesic_segment_param {x--y} x s) (geodesic_segment_param {x--y} x t) = \<bar>s - t\<bar>) &&& (z \<in> {x--y} \<Longrightarrow> z = geodesic_segment_param {x--y} x (dist x z))
[PROOF STEP]
by auto


[STATEMENT]
theorem ifex_ite_opt_rel_bf: "
  (fi,i) \<in> bf_ifex_rel \<Longrightarrow>
  (ft,t) \<in> bf_ifex_rel \<Longrightarrow>
  (fe,e) \<in> bf_ifex_rel \<Longrightarrow>
  ((bf_ite fi ft fe), (ifex_ite_opt i t e)) \<in> bf_ifex_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(fi, i) \<in> bf_ifex_rel; (ft, t) \<in> bf_ifex_rel; (fe, e) \<in> bf_ifex_rel\<rbrakk> \<Longrightarrow> (bf_ite fi ft fe, ifex_ite_opt i t e) \<in> bf_ifex_rel
[PROOF STEP]
using ifex_ite_rel_bf ifex_ite_opt_eq ro_ifexI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?fi, ?i) \<in> bf_ifex_rel; (?ft, ?t) \<in> bf_ifex_rel; (?fe, ?e) \<in> bf_ifex_rel\<rbrakk> \<Longrightarrow> (bf_ite ?fi ?ft ?fe, ifex_ite ?i ?t ?e) \<in> bf_ifex_rel
\<lbrakk>ro_ifex ?i; ro_ifex ?t; ro_ifex ?e\<rbrakk> \<Longrightarrow> ifex_ite_opt ?i ?t ?e = ifex_ite ?i ?t ?e
(?a, ?b) \<in> bf_ifex_rel \<Longrightarrow> ro_ifex ?b

goal (1 subgoal):
 1. \<lbrakk>(fi, i) \<in> bf_ifex_rel; (ft, t) \<in> bf_ifex_rel; (fe, e) \<in> bf_ifex_rel\<rbrakk> \<Longrightarrow> (bf_ite fi ft fe, ifex_ite_opt i t e) \<in> bf_ifex_rel
[PROOF STEP]
by metis


[STATEMENT]
lemma bl_word_xor: "to_bl (v XOR w) = map2 (\<noteq>) (to_bl v) (to_bl w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (v XOR w) = map2 (\<noteq>) (to_bl v) (to_bl w)
[PROOF STEP]
by transfer (simp flip: bl_xor_bin)


[STATEMENT]
lemma fixes f F P
  defines "F \<equiv> \<lambda>ltakeWhile xs. case xs of LNil \<Rightarrow> LNil | LCons x xs \<Rightarrow> if P x then LCons x (ltakeWhile xs) else LNil"
  shows ltakeWhile_conv_fixp: "ltakeWhile P \<equiv> ccpo.fixp (fun_lub lSup) (fun_ord lprefix) F" (is "?lhs \<equiv> ?rhs")
  and ltakeWhile_mono: "\<And>xs. mono_llist (\<lambda>ltakeWhile. F ltakeWhile xs)" (is "PROP ?mono")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ltakeWhile P \<equiv> llist.fixp_fun F) &&& (\<And>xs. monotone llist.le_fun (\<sqsubseteq>) (\<lambda>ltakeWhile. F ltakeWhile xs))
[PROOF STEP]
proof(intro eq_reflection ext)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. ltakeWhile P x = llist.fixp_fun F x
 2. \<And>xs. monotone llist.le_fun (\<sqsubseteq>) (\<lambda>ltakeWhile. F ltakeWhile xs)
[PROOF STEP]
show mono: "PROP ?mono"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. monotone llist.le_fun (\<sqsubseteq>) (\<lambda>ltakeWhile. F ltakeWhile xs)
[PROOF STEP]
unfolding F_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. monotone llist.le_fun (\<sqsubseteq>) (\<lambda>ltakeWhile. case xs of LNil \<Rightarrow> LNil | LCons x xs \<Rightarrow> if P x then LCons x (ltakeWhile xs) else LNil)
[PROOF STEP]
by(tactic \<open>Partial_Function.mono_tac @{context} 1\<close>)
[PROOF STATE]
proof (state)
this:
monotone llist.le_fun (\<sqsubseteq>) (\<lambda>ltakeWhile. F ltakeWhile ?xs)

goal (1 subgoal):
 1. \<And>x. ltakeWhile P x = llist.fixp_fun F x
[PROOF STEP]
fix xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ltakeWhile P x = llist.fixp_fun F x
[PROOF STEP]
show "?lhs xs = ?rhs xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ltakeWhile P xs = llist.fixp_fun F xs
[PROOF STEP]
proof(coinduction arbitrary: xs)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. lnull (ltakeWhile P xs) = lnull (llist.fixp_fun F xs) \<and> (\<not> lnull (ltakeWhile P xs) \<longrightarrow> \<not> lnull (llist.fixp_fun F xs) \<longrightarrow> lhd (ltakeWhile P xs) = lhd (llist.fixp_fun F xs) \<and> (\<exists>xsa. ltl (ltakeWhile P xs) = ltakeWhile P xsa \<and> ltl (llist.fixp_fun F xs) = llist.fixp_fun F xsa))
[PROOF STEP]
case Eq_llist
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>xs. lnull (ltakeWhile P xs) = lnull (llist.fixp_fun F xs) \<and> (\<not> lnull (ltakeWhile P xs) \<longrightarrow> \<not> lnull (llist.fixp_fun F xs) \<longrightarrow> lhd (ltakeWhile P xs) = lhd (llist.fixp_fun F xs) \<and> (\<exists>xsa. ltl (ltakeWhile P xs) = ltakeWhile P xsa \<and> ltl (llist.fixp_fun F xs) = llist.fixp_fun F xsa))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnull (ltakeWhile P xs) = lnull (llist.fixp_fun F xs) \<and> (\<not> lnull (ltakeWhile P xs) \<longrightarrow> \<not> lnull (llist.fixp_fun F xs) \<longrightarrow> lhd (ltakeWhile P xs) = lhd (llist.fixp_fun F xs) \<and> (\<exists>xs. ltl (ltakeWhile P xs) = ltakeWhile P xs \<and> ltl (llist.fixp_fun F xs) = llist.fixp_fun F xs))
[PROOF STEP]
by(subst (1 3 4) llist.mono_body_fixp[OF mono])(auto simp add: F_def split: llist.split prod.split co.enat.split)
[PROOF STATE]
proof (state)
this:
lnull (ltakeWhile P xs) = lnull (llist.fixp_fun F xs) \<and> (\<not> lnull (ltakeWhile P xs) \<longrightarrow> \<not> lnull (llist.fixp_fun F xs) \<longrightarrow> lhd (ltakeWhile P xs) = lhd (llist.fixp_fun F xs) \<and> (\<exists>xs. ltl (ltakeWhile P xs) = ltakeWhile P xs \<and> ltl (llist.fixp_fun F xs) = llist.fixp_fun F xs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ltakeWhile P xs = llist.fixp_fun F xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sprefix_append: "sprefix (xs @ ys) zs \<longleftrightarrow> sprefix xs zs \<and> sprefix ys (sdrop (length xs) zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sprefix (xs @ ys) zs = (sprefix xs zs \<and> sprefix ys (sdrop (length xs) zs))
[PROOF STEP]
by(induct xs arbitrary: zs) simp_all


[STATEMENT]
lemma AbGroup_inner_dirsum_pairwise_int0 :
  "\<lbrakk> \<forall>G \<in> set Gs. AbGroup G; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs;
        G \<noteq> G' \<rbrakk> \<Longrightarrow> G \<inter> G' = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>G\<in>set Gs. AbGroup G; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
proof (induct Gs arbitrary: G G')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
case (Cons H Hs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>a\<in>set Hs. AbGroup a; add_independentS Hs; ?G \<in> set Hs; ?G' \<in> set Hs; ?G \<noteq> ?G'\<rbrakk> \<Longrightarrow> ?G \<inter> ?G' = 0
\<forall>a\<in>set (H # Hs). AbGroup a
add_independentS (H # Hs)
G \<in> set (H # Hs)
G' \<in> set (H # Hs)
G \<noteq> G'

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
from Cons(1-3)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>a\<in>set Hs. AbGroup a; add_independentS Hs; ?G \<in> set Hs; ?G' \<in> set Hs; ?G \<noteq> ?G'\<rbrakk> \<Longrightarrow> ?G \<inter> ?G' = 0
\<forall>a\<in>set (H # Hs). AbGroup a
add_independentS (H # Hs)
[PROOF STEP]
have "\<And>A B. \<lbrakk> A \<in> set Hs; B \<in> set Hs; A \<noteq> B \<rbrakk>
                            \<Longrightarrow> A \<inter> B \<subseteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>a\<in>set Hs. AbGroup a; add_independentS Hs; ?G \<in> set Hs; ?G' \<in> set Hs; ?G \<noteq> ?G'\<rbrakk> \<Longrightarrow> ?G \<inter> ?G' = 0
\<forall>a\<in>set (H # Hs). AbGroup a
add_independentS (H # Hs)

goal (1 subgoal):
 1. \<And>A B. \<lbrakk>A \<in> set Hs; B \<in> set Hs; A \<noteq> B\<rbrakk> \<Longrightarrow> A \<inter> B \<subseteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<in> set Hs; ?B \<in> set Hs; ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> 0

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<in> set Hs; ?B \<in> set Hs; ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> 0

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
have "\<And>A. A \<in> set Hs \<Longrightarrow> A \<noteq> H \<Longrightarrow>  A \<inter> H \<subseteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> set Hs; A \<noteq> H\<rbrakk> \<Longrightarrow> A \<inter> H \<subseteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A x. \<lbrakk>A \<in> set Hs; A \<noteq> H; x \<in> A \<inter> H\<rbrakk> \<Longrightarrow> x \<in> 0
[PROOF STEP]
fix A g
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A x. \<lbrakk>A \<in> set Hs; A \<noteq> H; x \<in> A \<inter> H\<rbrakk> \<Longrightarrow> x \<in> 0
[PROOF STEP]
assume A: "A \<in> set Hs" "A \<noteq> H" and g: "g \<in> A \<inter> H"
[PROOF STATE]
proof (state)
this:
A \<in> set Hs
A \<noteq> H
g \<in> A \<inter> H

goal (1 subgoal):
 1. \<And>A x. \<lbrakk>A \<in> set Hs; A \<noteq> H; x \<in> A \<inter> H\<rbrakk> \<Longrightarrow> x \<in> 0
[PROOF STEP]
from A(1) g Cons(2)
[PROOF STATE]
proof (chain)
picking this:
A \<in> set Hs
g \<in> A \<inter> H
\<forall>a\<in>set (H # Hs). AbGroup a
[PROOF STEP]
have "-g \<in> (\<Sum>X\<leftarrow>Hs. X)"
[PROOF STATE]
proof (prove)
using this:
A \<in> set Hs
g \<in> A \<inter> H
\<forall>a\<in>set (H # Hs). AbGroup a

goal (1 subgoal):
 1. - g \<in> (\<Sum>X\<leftarrow>Hs. X)
[PROOF STEP]
using AbGroup.neg_closed AbGroup_subset_sum_list
[PROOF STATE]
proof (prove)
using this:
A \<in> set Hs
g \<in> A \<inter> H
\<forall>a\<in>set (H # Hs). AbGroup a
\<lbrakk>AbGroup ?G; ?g \<in> ?G\<rbrakk> \<Longrightarrow> - ?g \<in> ?G
\<lbrakk>\<forall>G\<in>set ?Gs. AbGroup G; ?H \<in> set ?Gs\<rbrakk> \<Longrightarrow> ?H \<subseteq> (\<Sum>G\<leftarrow>?Gs. G)

goal (1 subgoal):
 1. - g \<in> (\<Sum>X\<leftarrow>Hs. X)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
- g \<in> (\<Sum>X\<leftarrow>Hs. X)

goal (1 subgoal):
 1. \<And>A x. \<lbrakk>A \<in> set Hs; A \<noteq> H; x \<in> A \<inter> H\<rbrakk> \<Longrightarrow> x \<in> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- g \<in> (\<Sum>X\<leftarrow>Hs. X)

goal (1 subgoal):
 1. \<And>A x. \<lbrakk>A \<in> set Hs; A \<noteq> H; x \<in> A \<inter> H\<rbrakk> \<Longrightarrow> x \<in> 0
[PROOF STEP]
have "g + (-g) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g + - g = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g + - g = (0::'a)

goal (1 subgoal):
 1. \<And>A x. \<lbrakk>A \<in> set Hs; A \<noteq> H; x \<in> A \<inter> H\<rbrakk> \<Longrightarrow> x \<in> 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- g \<in> (\<Sum>X\<leftarrow>Hs. X)
g + - g = (0::'a)
[PROOF STEP]
show "g \<in> 0"
[PROOF STATE]
proof (prove)
using this:
- g \<in> (\<Sum>X\<leftarrow>Hs. X)
g + - g = (0::'a)

goal (1 subgoal):
 1. g \<in> 0
[PROOF STEP]
using g Cons(3)
[PROOF STATE]
proof (prove)
using this:
- g \<in> (\<Sum>X\<leftarrow>Hs. X)
g + - g = (0::'a)
g \<in> A \<inter> H
add_independentS (H # Hs)

goal (1 subgoal):
 1. g \<in> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g \<in> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<in> set Hs; ?A \<noteq> H\<rbrakk> \<Longrightarrow> ?A \<inter> H \<subseteq> 0

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?A \<in> set Hs; ?B \<in> set Hs; ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> 0
\<lbrakk>?A \<in> set Hs; ?A \<noteq> H\<rbrakk> \<Longrightarrow> ?A \<inter> H \<subseteq> 0
[PROOF STEP]
have "\<And>A B. \<lbrakk> A \<in> set (H#Hs); B \<in> set (H#Hs); A \<noteq> B \<rbrakk>
                        \<Longrightarrow> A \<inter> B \<subseteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> set Hs; ?B \<in> set Hs; ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> 0
\<lbrakk>?A \<in> set Hs; ?A \<noteq> H\<rbrakk> \<Longrightarrow> ?A \<inter> H \<subseteq> 0

goal (1 subgoal):
 1. \<And>A B. \<lbrakk>A \<in> set (H # Hs); B \<in> set (H # Hs); A \<noteq> B\<rbrakk> \<Longrightarrow> A \<inter> B \<subseteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<in> set (H # Hs); ?B \<in> set (H # Hs); ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> 0

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
with Cons(4-6)
[PROOF STATE]
proof (chain)
picking this:
G \<in> set (H # Hs)
G' \<in> set (H # Hs)
G \<noteq> G'
\<lbrakk>?A \<in> set (H # Hs); ?B \<in> set (H # Hs); ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> 0
[PROOF STEP]
have "G \<inter> G' \<subseteq> 0"
[PROOF STATE]
proof (prove)
using this:
G \<in> set (H # Hs)
G' \<in> set (H # Hs)
G \<noteq> G'
\<lbrakk>?A \<in> set (H # Hs); ?B \<in> set (H # Hs); ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<subseteq> 0

goal (1 subgoal):
 1. G \<inter> G' \<subseteq> 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
G \<inter> G' \<subseteq> 0

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
G \<inter> G' \<subseteq> 0

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
from Cons(2,4,5)
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>set (H # Hs). AbGroup a
G \<in> set (H # Hs)
G' \<in> set (H # Hs)
[PROOF STEP]
have "0 \<subseteq> G \<inter> G'"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (H # Hs). AbGroup a
G \<in> set (H # Hs)
G' \<in> set (H # Hs)

goal (1 subgoal):
 1. 0 \<subseteq> G \<inter> G'
[PROOF STEP]
using AbGroup.zero_closed
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (H # Hs). AbGroup a
G \<in> set (H # Hs)
G' \<in> set (H # Hs)
AbGroup ?G \<Longrightarrow> (0::?'g) \<in> ?G

goal (1 subgoal):
 1. 0 \<subseteq> G \<inter> G'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<subseteq> G \<inter> G'

goal (2 subgoals):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
 2. \<And>a Gs G G'. \<lbrakk>\<And>G G'. \<lbrakk>Ball (set Gs) AbGroup; add_independentS Gs; G \<in> set Gs; G' \<in> set Gs; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0; Ball (set (a # Gs)) AbGroup; add_independentS (a # Gs); G \<in> set (a # Gs); G' \<in> set (a # Gs); G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
G \<inter> G' \<subseteq> 0
0 \<subseteq> G \<inter> G'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
G \<inter> G' \<subseteq> 0
0 \<subseteq> G \<inter> G'

goal (1 subgoal):
 1. G \<inter> G' = 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
G \<inter> G' = 0

goal (1 subgoal):
 1. \<And>G G'. \<lbrakk>Ball (set []) AbGroup; add_independentS []; G \<in> set []; G' \<in> set []; G \<noteq> G'\<rbrakk> \<Longrightarrow> G \<inter> G' = 0
[PROOF STEP]
qed simp


[STATEMENT]
lemma real_of_ereal_mult[simp]:
  fixes a b :: ereal
  shows "real_of_ereal (a * b) = real_of_ereal a * real_of_ereal b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal (a * b) = real_of_ereal a * real_of_ereal b
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) auto


[STATEMENT]
lemma comparator_of_rep [simp]: "comparator_of (rep_nat x) (rep_nat y) = comparator_of x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comparator_of (rep_nat x) (rep_nat y) = comparator_of x y
[PROOF STEP]
by (simp add: comparator_of_def linorder_class.comparator_of_def ord_iff rep_inj)


[STATEMENT]
lemma square_integrable_sum [simp]:
  assumes I: "finite I" "\<And>i. i \<in> I \<Longrightarrow> f i square_integrable S" and S: "S \<in> sets lebesgue"
  shows "(\<lambda>x. \<Sum>i\<in>I. f i x) square_integrable S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>I. f i x) square_integrable S
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> f ?i square_integrable S

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>I. f i x) square_integrable S
[PROOF STEP]
by induction (simp_all add: S)


[STATEMENT]
lemma AbstFormP_subst [simp]:
     "(AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
obtain s::name and k::name  where "atom s \<sharp> (v,i,x,x',t,j,k)" "atom k \<sharp> (v,i,x,x',t,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s k. \<lbrakk>atom s \<sharp> (v, i, x, x', t, j, k); atom k \<sharp> (v, i, x, x', t, j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom s \<sharp> (v, i, x, x', t, j, k)
atom k \<sharp> (v, i, x, x', t, j)

goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom s \<sharp> (v, i, x, x', t, j, k)
atom k \<sharp> (v, i, x, x', t, j)

goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
by (auto simp: AbstFormP.simps [of s _ _ _ _ k])
[PROOF STATE]
proof (state)
this:
(AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powser_zero [simp]: "(\<Sum>n. f n * 0 ^ n) = f 0"
  for f :: "nat \<Rightarrow> 'a::real_normed_algebra_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. f n * (0::'a) ^ n) = f 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>n. f n * (0::'a) ^ n) = f 0
[PROOF STEP]
have "(\<Sum>n<1. f n * 0 ^ n) = (\<Sum>n. f n * 0 ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<1. f n * (0::'a) ^ n) = (\<Sum>n. f n * (0::'a) ^ n)
[PROOF STEP]
by (subst suminf_finite[where N="{0}"]) (auto simp: power_0_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>n<1. f n * (0::'a) ^ n) = (\<Sum>n. f n * (0::'a) ^ n)

goal (1 subgoal):
 1. (\<Sum>n. f n * (0::'a) ^ n) = f 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n<1. f n * (0::'a) ^ n) = (\<Sum>n. f n * (0::'a) ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n<1. f n * (0::'a) ^ n) = (\<Sum>n. f n * (0::'a) ^ n)

goal (1 subgoal):
 1. (\<Sum>n. f n * (0::'a) ^ n) = f 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. f n * (0::'a) ^ n) = f 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subgroup_inverse_iff [simp]:
  "\<lbrakk> invertible x; x \<in> M \<rbrakk> \<Longrightarrow> inverse x \<in> G \<longleftrightarrow> x \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invertible x; x \<in> M\<rbrakk> \<Longrightarrow> (inverse x \<in> G) = (x \<in> G)
[PROOF STEP]
using invertible_inverse_inverse sub.invertible_inverse_closed
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>invertible ?u; ?u \<in> M\<rbrakk> \<Longrightarrow> inverse (inverse ?u) = ?u
\<lbrakk>sub.invertible ?u; ?u \<in> G\<rbrakk> \<Longrightarrow> sub.inverse ?u \<in> G

goal (1 subgoal):
 1. \<lbrakk>invertible x; x \<in> M\<rbrakk> \<Longrightarrow> (inverse x \<in> G) = (x \<in> G)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma limpt_closed_imp_exploding_subsequence:\<comment>\<open>TODO: improve name?!\<close>
  fixes f::"'a::{heine_borel,real_normed_vector} \<Rightarrow> 'b::{first_countable_topology, t2_space}"
  assumes cont[THEN continuous_on_compose2, continuous_intros]: "continuous_on T f"
  assumes closed: "closed T"
  assumes bound: "\<And>t. t \<in> T \<Longrightarrow> f t \<noteq> l"
  assumes limpt: "l islimpt (f ` T)"
  obtains s where
    "(f \<circ> s) \<longlonglongrightarrow> l"
    "\<And>i. s i \<in> T"
    "\<And>C. compact C \<Longrightarrow> C \<subseteq> T \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from countable_basis_at_decseq[of l]
[PROOF STATE]
proof (chain)
picking this:
(\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. l \<in> A i; \<And>S. \<lbrakk>open S; l \<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. l \<in> A i"
    and evA: "\<And>S. open S \<Longrightarrow> l \<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. l \<in> A i; \<And>S. \<lbrakk>open S; l \<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. l \<in> A i; \<And>S. \<lbrakk>open S; l \<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)
l \<in> A ?i
\<lbrakk>open ?S; l \<in> ?S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. A i \<subseteq> ?S

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from closed_Union_compact_subsets[OF closed]
[PROOF STATE]
proof (chain)
picking this:
(\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> T; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = T; \<And>K. \<lbrakk>compact K; K \<subseteq> T\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain C
    where C: "(\<And>n. compact (C n))" "(\<And>n. C n \<subseteq> T)" "(\<And>n. C n \<subseteq> C (Suc n))" "\<Union> (range C) = T"
      and evC: "(\<And>K. compact K \<Longrightarrow> K \<subseteq> T \<Longrightarrow> \<forall>\<^sub>F i in sequentially. K \<subseteq> C i)"
[PROOF STATE]
proof (prove)
using this:
(\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> T; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = T; \<And>K. \<lbrakk>compact K; K \<subseteq> T\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>\<And>n. compact (C n); \<And>n. C n \<subseteq> T; \<And>n. C n \<subseteq> C (Suc n); \<Union> (range C) = T; \<And>K. \<lbrakk>compact K; K \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. K \<subseteq> C i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis eventually_sequentially)
[PROOF STATE]
proof (state)
this:
compact (C ?n)
C ?n \<subseteq> T
C ?n \<subseteq> C (Suc ?n)
\<Union> (range C) = T
\<lbrakk>compact ?K; ?K \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. ?K \<subseteq> C i

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have AC: "l \<in> A i - f ` C i" "open (A i - f ` C i)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<in> A i - f ` C i &&& open (A i - f ` C i)
[PROOF STEP]
using C bound
[PROOF STATE]
proof (prove)
using this:
compact (C ?n)
C ?n \<subseteq> T
C ?n \<subseteq> C (Suc ?n)
\<Union> (range C) = T
?t \<in> T \<Longrightarrow> f ?t \<noteq> l

goal (1 subgoal):
 1. l \<in> A i - f ` C i &&& open (A i - f ` C i)
[PROOF STEP]
by (fastforce intro!: open_Diff A compact_imp_closed compact_continuous_image continuous_intros)+
[PROOF STATE]
proof (state)
this:
l \<in> A ?i - f ` C ?i
open (A ?i - f ` C ?i)

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from islimptE[OF limpt AC]
[PROOF STATE]
proof (chain)
picking this:
(\<And>y. \<lbrakk>y \<in> f ` T; y \<in> A ?i1 - f ` C ?i1; y \<noteq> l\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
have "\<exists>t\<in>T. f t \<in> A i - f ` C i \<and> f t \<noteq> l" for i
[PROOF STATE]
proof (prove)
using this:
(\<And>y. \<lbrakk>y \<in> f ` T; y \<in> A ?i1 - f ` C ?i1; y \<noteq> l\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>t\<in>T. f t \<in> A i - f ` C i \<and> f t \<noteq> l
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>t\<in>T. f t \<in> A ?i - f ` C ?i \<and> f t \<noteq> l

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>t\<in>T. f t \<in> A ?i - f ` C ?i \<and> f t \<noteq> l
[PROOF STEP]
obtain t where t: "\<And>i. t i \<in> T" "\<And>i. f (t i) \<in> A i - f ` C i" "\<And>i. f (t i) \<noteq> l"
[PROOF STATE]
proof (prove)
using this:
\<exists>t\<in>T. f t \<in> A ?i - f ` C ?i \<and> f t \<noteq> l

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>\<And>i. t i \<in> T; \<And>i. f (t i) \<in> A i - f ` C i; \<And>i. f (t i) \<noteq> l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
t ?i \<in> T
f (t ?i) \<in> A ?i - f ` C ?i
f (t ?i) \<noteq> l

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "(f o t) \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> t) \<longlonglongrightarrow> l
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
t ?i \<in> T
f (t ?i) \<in> A ?i - f ` C ?i
f (t ?i) \<noteq> l

goal (1 subgoal):
 1. (f \<circ> t) \<longlonglongrightarrow> l
[PROOF STEP]
by (auto intro!: topological_tendstoI dest!: evA elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
(f \<circ> t) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(f \<circ> t) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<And>i. t i \<in> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. t i \<in> T
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
t ?i \<in> T

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
t ?i \<in> T

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<forall>\<^sub>F i in sequentially. t i \<notin> K" if "compact K" "K \<subseteq> T" for K
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. t i \<notin> K
[PROOF STEP]
using evC[OF that]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F i in sequentially. K \<subseteq> C i

goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. t i \<notin> K
[PROOF STEP]
by eventually_elim (use t in auto)
[PROOF STATE]
proof (state)
this:
\<lbrakk>compact ?K; ?K \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. t i \<notin> ?K

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>(f \<circ> s) \<longlonglongrightarrow> l; \<And>i. s i \<in> T; \<And>C. \<lbrakk>compact C; C \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. s i \<notin> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(f \<circ> t) \<longlonglongrightarrow> l
t ?i \<in> T
\<lbrakk>compact ?K; ?K \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. t i \<notin> ?K
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<circ> t) \<longlonglongrightarrow> l
t ?i \<in> T
\<lbrakk>compact ?K; ?K \<subseteq> T\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F i in sequentially. t i \<notin> ?K

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed