[STATEMENT]
lemma lin_dep_cols_imp_det_0':
  fixes ws
  defines "A \<equiv> mat_of_cols n ws"
  assumes dimv_ws: "\<forall>w\<in>set ws. dim_vec w = n"
  assumes A: "A \<in> carrier_mat n n" and ld_cols: "lin_dep (set (cols A))"
  shows  "det A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A = (0::'a)
[PROOF STEP]
proof (cases "distinct ws")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
 2. \<not> distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> distinct ws

goal (2 subgoals):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
 2. \<not> distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
obtain i j where ij: "i\<noteq>j" and c: "col A i = col A j" and i: "i<n" and j: "j<n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i \<noteq> j; col A i = col A j; i < n; j < n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using False A
[PROOF STATE]
proof (prove)
using this:
\<not> distinct ws
A \<in> carrier_mat n n

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i \<noteq> j; col A i = col A j; i < n; j < n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
using this:
\<not> distinct ws
mat_of_cols n ws \<in> carrier_mat n n

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i \<noteq> j; col (mat_of_cols n ws) i = col (mat_of_cols n ws) j; i < n; j < n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis dimv_ws distinct_conv_nth carrier_matD(2)
        col_mat_of_cols mat_of_cols_carrier(3) nth_mem carrier_vecI)
[PROOF STATE]
proof (state)
this:
i \<noteq> j
col A i = col A j
i < n
j < n

goal (2 subgoals):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
 2. \<not> distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A = (0::'a)
[PROOF STEP]
by (rule det_identical_columns[OF A ij i j c])
[PROOF STATE]
proof (state)
this:
det A = (0::'a)

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
distinct ws

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have d1[simp]: "\<And>x. x \<in> set ws \<Longrightarrow> x \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set ws \<Longrightarrow> x \<in> carrier_vec n
[PROOF STEP]
using dimv_ws
[PROOF STATE]
proof (prove)
using this:
\<forall>w\<in>set ws. dim_vec w = n

goal (1 subgoal):
 1. \<And>x. x \<in> set ws \<Longrightarrow> x \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x1 \<in> set ws \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
obtain A' f' v where f'_in: "f' \<in> A' \<rightarrow> UNIV"
    and lc_f': "lincomb f' A' = 0\<^sub>v n" and f'_v: "f' v \<noteq> 0"
    and v_A': "v \<in> A'" and A'_in_rows: "A' \<subseteq> set (cols A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f' A' v. \<lbrakk>f' \<in> A' \<rightarrow> UNIV; lincomb f' A' = 0\<^sub>v n; f' v \<noteq> (0::'a); v \<in> A'; A' \<subseteq> set (cols A)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ld_cols
[PROOF STATE]
proof (prove)
using this:
lin_dep (set (cols A))

goal (1 subgoal):
 1. (\<And>f' A' v. \<lbrakk>f' \<in> A' \<rightarrow> UNIV; lincomb f' A' = 0\<^sub>v n; f' v \<noteq> (0::'a); v \<in> A'; A' \<subseteq> set (cols A)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding lin_dep_def
[PROOF STATE]
proof (prove)
using this:
\<exists>Aa a v. finite Aa \<and> Aa \<subseteq> set (cols A) \<and> True \<and> lincomb a Aa = 0\<^sub>v n \<and> v \<in> Aa \<and> a v \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<And>f' A' v. \<lbrakk>f' \<in> A' \<rightarrow> UNIV; lincomb f' A' = 0\<^sub>v n; f' v \<noteq> (0::'a); v \<in> A'; A' \<subseteq> set (cols A)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f' \<in> A' \<rightarrow> UNIV
lincomb f' A' = 0\<^sub>v n
f' v \<noteq> (0::'a)
v \<in> A'
A' \<subseteq> set (cols A)

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
define f where "f \<equiv> \<lambda>x. if x \<notin> A' then 0 else f' x"
[PROOF STATE]
proof (state)
this:
f \<equiv> \<lambda>x. if x \<notin> A' then 0::'a else f' x

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have f_in: "f \<in> (set (cols A)) \<rightarrow> UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> set (cols A) \<rightarrow> UNIV
[PROOF STEP]
using f'_in
[PROOF STATE]
proof (prove)
using this:
f' \<in> A' \<rightarrow> UNIV

goal (1 subgoal):
 1. f \<in> set (cols A) \<rightarrow> UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> set (cols A) \<rightarrow> UNIV

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have A'_in_carrier: "A' \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' \<subseteq> carrier_vec n
[PROOF STEP]
by (metis (no_types) A'_in_rows A_def cols_dim carrier_matD(1) mat_of_cols_carrier(1) subset_trans)
[PROOF STATE]
proof (state)
this:
A' \<subseteq> carrier_vec n

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have lc_f: "lincomb f (set (cols A)) = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
have l1: "lincomb f (set (cols A) - A') = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f (set (cols A) - A') = 0\<^sub>v n
[PROOF STEP]
by (rule lincomb_zero, auto simp add: f_def, insert A cols_dim, blast)
[PROOF STATE]
proof (state)
this:
lincomb f (set (cols A) - A') = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
have l2: "lincomb f A' = 0\<^sub>v n "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f A' = 0\<^sub>v n
[PROOF STEP]
using lc_f'
[PROOF STATE]
proof (prove)
using this:
lincomb f' A' = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f A' = 0\<^sub>v n
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
lincomb f' A' = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb (\<lambda>x. if x \<notin> A' then 0::'a else f' x) A' = 0\<^sub>v n
[PROOF STEP]
using A'_in_carrier
[PROOF STATE]
proof (prove)
using this:
lincomb f' A' = 0\<^sub>v n
A' \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb (\<lambda>x. if x \<notin> A' then 0::'a else f' x) A' = 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb f A' = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
have "lincomb f (set (cols A)) = lincomb f (set (cols A) - A') + lincomb f A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f (set (cols A)) = lincomb f (set (cols A) - A') + lincomb f A'
[PROOF STEP]
proof (rule lincomb_vec_diff_add)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. set (cols A) \<subseteq> carrier_vec n
 2. A' \<subseteq> set (cols A)
 3. finite (set (cols A))
 4. f \<in> set (cols A) \<rightarrow> UNIV
[PROOF STEP]
show "set (cols A) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (cols A) \<subseteq> carrier_vec n
[PROOF STEP]
using A cols_dim
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
set (cols ?A) \<subseteq> carrier_vec (dim_row ?A)

goal (1 subgoal):
 1. set (cols A) \<subseteq> carrier_vec n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (cols A) \<subseteq> carrier_vec n

goal (3 subgoals):
 1. A' \<subseteq> set (cols A)
 2. finite (set (cols A))
 3. f \<in> set (cols A) \<rightarrow> UNIV
[PROOF STEP]
show "A' \<subseteq> set (cols A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' \<subseteq> set (cols A)
[PROOF STEP]
using A'_in_rows
[PROOF STATE]
proof (prove)
using this:
A' \<subseteq> set (cols A)

goal (1 subgoal):
 1. A' \<subseteq> set (cols A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A' \<subseteq> set (cols A)

goal (2 subgoals):
 1. finite (set (cols A))
 2. f \<in> set (cols A) \<rightarrow> UNIV
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
lincomb f (set (cols A)) = lincomb f (set (cols A) - A') + lincomb f A'

goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb f (set (cols A)) = lincomb f (set (cols A) - A') + lincomb f A'

goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
have "... =  0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f (set (cols A) - A') + lincomb f A' = 0\<^sub>v n
[PROOF STEP]
using l1 l2
[PROOF STATE]
proof (prove)
using this:
lincomb f (set (cols A) - A') = 0\<^sub>v n
lincomb f A' = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f (set (cols A) - A') + lincomb f A' = 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb f (set (cols A) - A') + lincomb f A' = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lincomb f (set (cols A)) = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f (set (cols A)) = 0\<^sub>v n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lincomb f (set (cols A)) = 0\<^sub>v n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lincomb f (set (cols A)) = 0\<^sub>v n

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have v_in: "v \<in> (set (cols A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> set (cols A)
[PROOF STEP]
using v_A' A'_in_rows
[PROOF STATE]
proof (prove)
using this:
v \<in> A'
A' \<subseteq> set (cols A)

goal (1 subgoal):
 1. v \<in> set (cols A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> set (cols A)

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have fv: "f v \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f v \<noteq> (0::'a)
[PROOF STEP]
using f'_v v_A'
[PROOF STATE]
proof (prove)
using this:
f' v \<noteq> (0::'a)
v \<in> A'

goal (1 subgoal):
 1. f v \<noteq> (0::'a)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
f' v \<noteq> (0::'a)
v \<in> A'

goal (1 subgoal):
 1. (if v \<notin> A' then 0::'a else f' v) \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f v \<noteq> (0::'a)

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
let ?c = "(\<lambda>i. f (ws ! i))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have "lincomb f (set ws) = lincomb_list ?c ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f (set ws) = lincomb_list (\<lambda>i. f (ws ! i)) ws
[PROOF STEP]
by (rule lincomb_as_lincomb_list_distinct[OF _ True], auto)
[PROOF STATE]
proof (state)
this:
lincomb f (set ws) = lincomb_list (\<lambda>i. f (ws ! i)) ws

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
have "\<exists>v.  v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> A *\<^sub>v v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> A *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
proof (rule exI[of _ " vec (length ws) ?c"], rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<in> carrier_vec n
 2. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
show "vec (length ws) ?c \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<in> carrier_vec n
[PROOF STEP]
using A A_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
A \<equiv> mat_of_cols n ws

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec (length ws) (\<lambda>i. f (ws ! i)) \<in> carrier_vec n

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
have vec_not0: "vec (length ws) ?c \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
obtain i where ws_i: "(ws ! i) = v" and i: "i<length ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. \<lbrakk>ws ! i = v; i < length ws\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using v_in
[PROOF STATE]
proof (prove)
using this:
v \<in> set (cols A)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>ws ! i = v; i < length ws\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
using this:
v \<in> set (cols (mat_of_cols n ws))

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>ws ! i = v; i < length ws\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis d1 cols_mat_of_cols in_set_conv_nth subset_eq)
[PROOF STATE]
proof (state)
this:
ws ! i = v
i < length ws

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
have "vec (length ws) ?c $ i = ?c i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) $ i = f (ws ! i)
[PROOF STEP]
by (rule index_vec[OF i])
[PROOF STATE]
proof (state)
this:
vec (length ws) (\<lambda>i. f (ws ! i)) $ i = f (ws ! i)

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec (length ws) (\<lambda>i. f (ws ! i)) $ i = f (ws ! i)

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
have "... = f v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (ws ! i) = f v
[PROOF STEP]
using ws_i
[PROOF STATE]
proof (prove)
using this:
ws ! i = v

goal (1 subgoal):
 1. f (ws ! i) = f v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (ws ! i) = f v

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (ws ! i) = f v

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
have "... \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f v \<noteq> (0::'a)
[PROOF STEP]
using fv
[PROOF STATE]
proof (prove)
using this:
f v \<noteq> (0::'a)

goal (1 subgoal):
 1. f v \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f v \<noteq> (0::'a)

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
vec (length ws) (\<lambda>i. f (ws ! i)) $ i \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vec (length ws) (\<lambda>i. f (ws ! i)) $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
using A A_def i
[PROOF STATE]
proof (prove)
using this:
vec (length ws) (\<lambda>i. f (ws ! i)) $ i \<noteq> (0::'a)
A \<in> carrier_mat n n
A \<equiv> mat_of_cols n ws
i < length ws

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
have "A *\<^sub>v vec (length ws) ?c = mat_of_cols n ws *\<^sub>v vec (length ws) ?c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i))
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i))

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i))

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
have "... = lincomb_list ?c ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = lincomb_list (\<lambda>i. f (ws ! i)) ws
[PROOF STEP]
by (rule lincomb_list_as_mat_mult[symmetric, OF dimv_ws])
[PROOF STATE]
proof (state)
this:
mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = lincomb_list (\<lambda>i. f (ws ! i)) ws

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_cols n ws *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = lincomb_list (\<lambda>i. f (ws ! i)) ws

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
have "... = lincomb f (set ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (\<lambda>i. f (ws ! i)) ws = lincomb f (set ws)
[PROOF STEP]
by (rule lincomb_as_lincomb_list_distinct[symmetric, OF _ True], auto)
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. f (ws ! i)) ws = lincomb f (set ws)

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. f (ws ! i)) ws = lincomb f (set ws)

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
have "... =  0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f (set ws) = 0\<^sub>v n
[PROOF STEP]
using lc_f
[PROOF STATE]
proof (prove)
using this:
lincomb f (set (cols A)) = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f (set ws) = 0\<^sub>v n
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
using this:
lincomb f (set (cols (mat_of_cols n ws))) = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb f (set ws) = 0\<^sub>v n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
lincomb f (set (cols (mat_of_cols n ws))) = 0\<^sub>v n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. lincomb f (set ws) = 0\<^sub>v n
[PROOF STEP]
by (simp add: subset_code(1))
[PROOF STATE]
proof (state)
this:
lincomb f (set ws) = 0\<^sub>v n

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
show "vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
using vec_not0
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
vec (length ws) (\<lambda>i. f (ws ! i)) \<noteq> 0\<^sub>v n \<and> A *\<^sub>v vec (length ws) (\<lambda>i. f (ws ! i)) = 0\<^sub>v n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> A *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. distinct ws \<Longrightarrow> det A = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> A *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. det A = (0::'a)
[PROOF STEP]
unfolding det_0_iff_vec_prod_zero[OF A]
[PROOF STATE]
proof (prove)
using this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> A *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. \<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> A *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det A = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_as_sums:
  assumes "A = {x \<in> B. P x}" "finite B"
  shows "card A = (\<Sum>x\<in>B. (if P x then 1 else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
have "A \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
A = {x \<in> B. P x}

goal (1 subgoal):
 1. A \<subseteq> B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<subseteq> B

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
have "card A = (\<Sum>x\<in>A. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = (\<Sum>x\<in>A. 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card A = (\<Sum>x\<in>A. 1)

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card A = (\<Sum>x\<in>A. 1)

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
have " ... = (\<Sum>x\<in>A. (if P x then 1 else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. 1) = (\<Sum>x\<in>A. if P x then 1 else 0)
[PROOF STEP]
by (simp add: assms(1))
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. 1) = (\<Sum>x\<in>A. if P x then 1 else 0)

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. 1) = (\<Sum>x\<in>A. if P x then 1 else 0)

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
have " ... = (\<Sum>x\<in>A. (if P x then 1 else 0)) + (\<Sum>x\<in>(B - A). (if P x then 1 else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. if P x then 1 else 0) = (\<Sum>x\<in>A. if P x then 1 else 0) + (\<Sum>x\<in>B - A. if P x then 1 else 0)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
A = {x \<in> B. P x}

goal (1 subgoal):
 1. (\<Sum>x\<in>A. if P x then 1 else 0) = (\<Sum>x\<in>A. if P x then 1 else 0) + (\<Sum>x\<in>B - A. if P x then 1 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. if P x then 1 else 0) = (\<Sum>x\<in>A. if P x then 1 else 0) + (\<Sum>x\<in>B - A. if P x then 1 else 0)

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card A = (\<Sum>x\<in>A. if P x then 1 else 0) + (\<Sum>x\<in>B - A. if P x then 1 else 0)
[PROOF STEP]
show "card A = (\<Sum>x\<in>B. (if P x then 1 else 0))"
[PROOF STATE]
proof (prove)
using this:
card A = (\<Sum>x\<in>A. if P x then 1 else 0) + (\<Sum>x\<in>B - A. if P x then 1 else 0)

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
using \<open>A \<subseteq> B\<close> add.commute assms(2) sum.subset_diff
[PROOF STATE]
proof (prove)
using this:
card A = (\<Sum>x\<in>A. if P x then 1 else 0) + (\<Sum>x\<in>B - A. if P x then 1 else 0)
A \<subseteq> B
?a + ?b = ?b + ?a
finite B
\<lbrakk>?B \<subseteq> ?A; finite ?A\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?g (?A - ?B) + sum ?g ?B

goal (1 subgoal):
 1. card A = (\<Sum>x\<in>B. if P x then 1 else 0)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card A = (\<Sum>x\<in>B. if P x then 1 else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_eq_oneE:
  fixes p :: "'a::zero poly"
  assumes "degree p = 1"
  obtains a b where "p = [:a,b:]" "b\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>p = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>p = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain a b q where p:"p=pCons a (pCons b q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b q. p = pCons a (pCons b q) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis pCons_cases)
[PROOF STATE]
proof (state)
this:
p = pCons a (pCons b q)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>p = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
degree p = 1
p = pCons a (pCons b q)
[PROOF STEP]
have "q=0"
[PROOF STATE]
proof (prove)
using this:
degree p = 1
p = pCons a (pCons b q)

goal (1 subgoal):
 1. q = 0
[PROOF STEP]
by (cases "q = 0") simp_all
[PROOF STATE]
proof (state)
this:
q = 0

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>p = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
p = pCons a (pCons b q)
q = 0
[PROOF STEP]
have "p=[:a,b:]"
[PROOF STATE]
proof (prove)
using this:
p = pCons a (pCons b q)
q = 0

goal (1 subgoal):
 1. p = [:a, b:]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = [:a, b:]

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>p = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p = [:a, b:]

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>p = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = [:a, b:]
[PROOF STEP]
have "b\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
p = [:a, b:]

goal (1 subgoal):
 1. b \<noteq> (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p = [:a, b:]
degree p = 1

goal (1 subgoal):
 1. b \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>p = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p = [:a, b:]
b \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = [:a, b:]
b \<noteq> (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fresh_finite_union:
  fixes S T::"('a::fs) set"
  assumes fin1: "finite S"
  and     fin2: "finite T"
  shows "a \<sharp> (S \<union> T) \<longleftrightarrow> a \<sharp> S \<and> a \<sharp> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sharp> S \<union> T = (a \<sharp> S \<and> a \<sharp> T)
[PROOF STEP]
unfolding fresh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<notin> supp (S \<union> T)) = (a \<notin> supp S \<and> a \<notin> supp T)
[PROOF STEP]
by (simp add: supp_of_finite_union[OF fin1 fin2])


[STATEMENT]
lemma order_trans: "\<lbrakk> order r; x \<sqsubseteq>\<^sub>r y; y \<sqsubseteq>\<^sub>r z \<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^sub>r z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r; x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> z\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r; x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> z\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z
[PROOF STEP]
by (unfold order_def) blast


[STATEMENT]
lemma arg_eqD: assumes "Arg (cis x) = Arg (cis y)" "-pi < x" "x \<le> pi" "-pi < y" "y \<le> pi"
  shows "x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
Arg (cis x) = Arg (cis y)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
unfolding cis_Arg_unique[OF sgn_cis assms(2-3)] cis_Arg_unique[OF sgn_cis assms(4-5)]
[PROOF STATE]
proof (prove)
using this:
x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
.


[STATEMENT]
lemma exp1_bounds: "exp 1 \<in> {8 / 3..11 / 4 :: real}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 1 \<in> {8 / 3..11 / 4}
[PROOF STEP]
using exp1_approx[of 4]
[PROOF STATE]
proof (prove)
using this:
0 < 4 \<Longrightarrow> exp 1 - (\<Sum>k<4. 1 / fact k) \<in> {0..2 / fact 4}

goal (1 subgoal):
 1. exp 1 \<in> {8 / 3..11 / 4}
[PROOF STEP]
by (simp add: eval_nat_numeral)


[STATEMENT]
lemma three:  "3 \<times> x = x \<squnion> x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
have       "3 = Suc(Suc(Suc(0)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 = Suc (Suc (Suc 0))
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
3 = Suc (Suc (Suc 0))

goal (1 subgoal):
 1. 3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
hence      "3 \<times> x = Suc(Suc(Suc(0))) \<times> x"
[PROOF STATE]
proof (prove)
using this:
3 = Suc (Suc (Suc 0))

goal (1 subgoal):
 1. 3 \<times> x = Suc (Suc (Suc 0)) \<times> x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
3 \<times> x = Suc (Suc (Suc 0)) \<times> x

goal (1 subgoal):
 1. 3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3 \<times> x = Suc (Suc (Suc 0)) \<times> x

goal (1 subgoal):
 1. 3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
have  "\<dots> = x \<squnion> x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (Suc (Suc 0)) \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (Suc (Suc 0)) \<times> x = x \<squnion> x \<squnion> x

goal (1 subgoal):
 1. 3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
3 \<times> x = x \<squnion> x \<squnion> x

goal (1 subgoal):
 1. 3 \<times> x = x \<squnion> x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 \<times> x = x \<squnion> x \<squnion> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_compose_deriv:
  fixes a :: "'a::idom fps"
  assumes b0: "b$0 = 0"
  shows "fps_deriv (a oo b) = ((fps_deriv a) oo b) * fps_deriv b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (a oo b) = (fps_deriv a oo b) * fps_deriv b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_deriv (a oo b) = (fps_deriv a oo b) * fps_deriv b
[PROOF STEP]
have "(fps_deriv (a oo b))$n = (((fps_deriv a) oo b) * (fps_deriv b)) $n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "(fps_deriv (a oo b))$n = sum (\<lambda>i. a $ i * (fps_deriv (b^i))$n) {0.. Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = (\<Sum>i = 0..Suc n. a $ i * fps_deriv (b ^ i) $ n)
[PROOF STEP]
by (simp add: fps_compose_def field_simps sum_distrib_left del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
fps_deriv (a oo b) $ n = (\<Sum>i = 0..Suc n. a $ i * fps_deriv (b ^ i) $ n)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_deriv (a oo b) $ n = (\<Sum>i = 0..Suc n. a $ i * fps_deriv (b ^ i) $ n)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "\<dots> = sum (\<lambda>i. a$i * ((fps_const (of_nat i)) * (fps_deriv b * (b^(i - 1))))$n) {0.. Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. a $ i * fps_deriv (b ^ i) $ n) = (\<Sum>i = 0..Suc n. a $ i * (fps_const (of_nat i) * (fps_deriv b * b ^ (i - 1))) $ n)
[PROOF STEP]
by (simp add: field_simps fps_deriv_power del: fps_mult_left_const_nth of_nat_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. a $ i * fps_deriv (b ^ i) $ n) = (\<Sum>i = 0..Suc n. a $ i * (fps_const (of_nat i) * (fps_deriv b * b ^ (i - 1))) $ n)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. a $ i * fps_deriv (b ^ i) $ n) = (\<Sum>i = 0..Suc n. a $ i * (fps_const (of_nat i) * (fps_deriv b * b ^ (i - 1))) $ n)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "\<dots> = sum (\<lambda>i. of_nat i * a$i * (((b^(i - 1)) * fps_deriv b))$n) {0.. Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. a $ i * (fps_const (of_nat i) * (fps_deriv b * b ^ (i - 1))) $ n) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (b ^ (i - 1) * fps_deriv b) $ n)
[PROOF STEP]
unfolding fps_mult_left_const_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. a $ i * (of_nat i * (fps_deriv b * b ^ (i - 1)) $ n)) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (b ^ (i - 1) * fps_deriv b) $ n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. a $ i * (fps_const (of_nat i) * (fps_deriv b * b ^ (i - 1))) $ n) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (b ^ (i - 1) * fps_deriv b) $ n)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. a $ i * (fps_const (of_nat i) * (fps_deriv b * b ^ (i - 1))) $ n) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (b ^ (i - 1) * fps_deriv b) $ n)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "\<dots> = sum (\<lambda>i. of_nat i * a$i * (sum (\<lambda>j. (b^ (i - 1))$j * (fps_deriv b)$(n - j)) {0..n})) {0.. Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. of_nat i * a $ i * (b ^ (i - 1) * fps_deriv b) $ n) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j)))
[PROOF STEP]
unfolding fps_mult_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>ia = 0..n. b ^ (i - 1) $ ia * fps_deriv b $ (n - ia))) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j)))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat i * a $ i * (b ^ (i - 1) * fps_deriv b) $ n) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat i * a $ i * (b ^ (i - 1) * fps_deriv b) $ n) = (\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "\<dots> = sum (\<lambda>i. of_nat i * a$i * (sum (\<lambda>j. (b^ (i - 1))$j * (fps_deriv b)$(n - j)) {0..n})) {1.. Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j))) = (\<Sum>i = 1..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j)))
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto simp add: mult_delta_left not_le)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j))) = (\<Sum>i = 1..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j))) = (\<Sum>i = 1..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "\<dots> = sum (\<lambda>i. of_nat (i + 1) * a$(i+1) * (sum (\<lambda>j. (b^ i)$j * of_nat (n - j + 1) * b$(n - j + 1)) {0..n})) {0.. n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 1..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j))) = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))
[PROOF STEP]
unfolding fps_deriv_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 1..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * (of_nat (n - j + 1) * b $ (n - j + 1)))) = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))
[PROOF STEP]
by (rule sum.reindex_cong [of Suc]) (simp_all add: mult.assoc)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..Suc n. of_nat i * a $ i * (\<Sum>j = 0..n. b ^ (i - 1) $ j * fps_deriv b $ (n - j))) = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fps_deriv (a oo b) $ n = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))
[PROOF STEP]
have th0: "(fps_deriv (a oo b))$n =
      sum (\<lambda>i. of_nat (i + 1) * a$(i+1) * (sum (\<lambda>j. (b^ i)$j * of_nat (n - j + 1) * b$(n - j + 1)) {0..n})) {0.. n}"
[PROOF STATE]
proof (prove)
using this:
fps_deriv (a oo b) $ n = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fps_deriv (a oo b) $ n = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "(((fps_deriv a) oo b) * (fps_deriv b))$n = sum (\<lambda>i. (fps_deriv b)$ (n - i) * ((fps_deriv a) oo b)$i) {0..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((fps_deriv a oo b) * fps_deriv b) $ n = (\<Sum>i = 0..n. fps_deriv b $ (n - i) * (fps_deriv a oo b) $ i)
[PROOF STEP]
unfolding fps_mult_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. (fps_deriv a oo b) $ i * fps_deriv b $ (n - i)) = (\<Sum>i = 0..n. fps_deriv b $ (n - i) * (fps_deriv a oo b) $ i)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
((fps_deriv a oo b) * fps_deriv b) $ n = (\<Sum>i = 0..n. fps_deriv b $ (n - i) * (fps_deriv a oo b) $ i)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((fps_deriv a oo b) * fps_deriv b) $ n = (\<Sum>i = 0..n. fps_deriv b $ (n - i) * (fps_deriv a oo b) $ i)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "\<dots> = sum (\<lambda>i. sum (\<lambda>j. of_nat (n - i +1) * b$(n - i + 1) * of_nat (j + 1) * a$(j+1) * (b^j)$i) {0..n}) {0..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. fps_deriv b $ (n - i) * (fps_deriv a oo b) $ i) = (\<Sum>i = 0..n. \<Sum>j = 0..n. of_nat (n - i + 1) * b $ (n - i + 1) * of_nat (j + 1) * a $ (j + 1) * b ^ j $ i)
[PROOF STEP]
unfolding fps_deriv_nth fps_compose_nth sum_distrib_left mult.assoc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. \<Sum>na = 0..i. of_nat (n - i + 1) * (b $ (n - i + 1) * (of_nat (na + 1) * (a $ (na + 1) * b ^ na $ i)))) = (\<Sum>i = 0..n. \<Sum>j = 0..n. of_nat (n - i + 1) * (b $ (n - i + 1) * (of_nat (j + 1) * (a $ (j + 1) * b ^ j $ i))))
[PROOF STEP]
by (auto simp: subset_eq b0 startsby_zero_power_prefix sum.mono_neutral_left intro: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. fps_deriv b $ (n - i) * (fps_deriv a oo b) $ i) = (\<Sum>i = 0..n. \<Sum>j = 0..n. of_nat (n - i + 1) * b $ (n - i + 1) * of_nat (j + 1) * a $ (j + 1) * b ^ j $ i)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. fps_deriv b $ (n - i) * (fps_deriv a oo b) $ i) = (\<Sum>i = 0..n. \<Sum>j = 0..n. of_nat (n - i + 1) * b $ (n - i + 1) * of_nat (j + 1) * a $ (j + 1) * b ^ j $ i)

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
have "\<dots> = sum (\<lambda>i. of_nat (i + 1) * a$(i+1) * (sum (\<lambda>j. (b^ i)$j * of_nat (n - j + 1) * b$(n - j + 1)) {0..n})) {0.. n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. \<Sum>j = 0..n. of_nat (n - i + 1) * b $ (n - i + 1) * of_nat (j + 1) * a $ (j + 1) * b ^ j $ i) = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))
[PROOF STEP]
unfolding sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. \<Sum>j = 0..n. of_nat (n - i + 1) * b $ (n - i + 1) * of_nat (j + 1) * a $ (j + 1) * b ^ j $ i) = (\<Sum>i = 0..n. \<Sum>na = 0..n. of_nat (i + 1) * a $ (i + 1) * (b ^ i $ na * of_nat (n - na + 1) * b $ (n - na + 1)))
[PROOF STEP]
by (subst sum.swap) (force intro: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. \<Sum>j = 0..n. of_nat (n - i + 1) * b $ (n - i + 1) * of_nat (j + 1) * a $ (j + 1) * b ^ j $ i) = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((fps_deriv a oo b) * fps_deriv b) $ n = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((fps_deriv a oo b) * fps_deriv b) $ n = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))

goal (1 subgoal):
 1. fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
unfolding th0
[PROOF STATE]
proof (prove)
using this:
((fps_deriv a oo b) * fps_deriv b) $ n = (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1)))

goal (1 subgoal):
 1. (\<Sum>i = 0..n. of_nat (i + 1) * a $ (i + 1) * (\<Sum>j = 0..n. b ^ i $ j * of_nat (n - j + 1) * b $ (n - j + 1))) = ((fps_deriv a oo b) * fps_deriv b) $ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fps_deriv (a oo b) $ n = ((fps_deriv a oo b) * fps_deriv b) $ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fps_deriv (a oo b) $ ?n = ((fps_deriv a oo b) * fps_deriv b) $ ?n

goal (1 subgoal):
 1. fps_deriv (a oo b) = (fps_deriv a oo b) * fps_deriv b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fps_deriv (a oo b) $ ?n = ((fps_deriv a oo b) * fps_deriv b) $ ?n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fps_deriv (a oo b) $ ?n = ((fps_deriv a oo b) * fps_deriv b) $ ?n

goal (1 subgoal):
 1. fps_deriv (a oo b) = (fps_deriv a oo b) * fps_deriv b
[PROOF STEP]
by (simp add: fps_eq_iff)
[PROOF STATE]
proof (state)
this:
fps_deriv (a oo b) = (fps_deriv a oo b) * fps_deriv b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_acc_point_imp_seq_compact:
  fixes s :: "'a::first_countable_topology set"
  assumes "\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s \<longrightarrow>
    (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))"
  shows "seq_compact s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
fix f :: "nat \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
assume f: "\<forall>n. f n \<in> s"
[PROOF STATE]
proof (state)
this:
\<forall>n. f n \<in> s

goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
have "\<exists>l\<in>s. \<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
proof (cases "finite (range f)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
 2. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite (range f)

goal (2 subgoals):
 1. finite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
 2. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
obtain l where "infinite {n. f n = f l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l. infinite {n. f n = f l} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using pigeonhole_infinite[OF _ True]
[PROOF STATE]
proof (prove)
using this:
infinite UNIV \<Longrightarrow> \<exists>a0\<in>UNIV. infinite {a \<in> UNIV. f a = f a0}

goal (1 subgoal):
 1. (\<And>l. infinite {n. f n = f l} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infinite {n. f n = f l}

goal (2 subgoals):
 1. finite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
 2. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite {n. f n = f l}
[PROOF STEP]
obtain r :: "nat \<Rightarrow> nat" where "strict_mono  r" and fr: "\<forall>n. f (r n) = f l"
[PROOF STATE]
proof (prove)
using this:
infinite {n. f n = f l}

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; \<forall>n. f (r n) = f l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using infinite_enumerate
[PROOF STATE]
proof (prove)
using this:
infinite {n. f n = f l}
infinite ?S \<Longrightarrow> \<exists>r. strict_mono r \<and> (\<forall>n. r n \<in> ?S)

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; \<forall>n. f (r n) = f l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
strict_mono r
\<forall>n. f (r n) = f l

goal (2 subgoals):
 1. finite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
 2. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
strict_mono r
\<forall>n. f (r n) = f l
[PROOF STEP]
have "strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> f l"
[PROOF STATE]
proof (prove)
using this:
strict_mono r
\<forall>n. f (r n) = f l

goal (1 subgoal):
 1. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> f l
[PROOF STEP]
by (simp add: fr o_def)
[PROOF STATE]
proof (state)
this:
strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> f l

goal (2 subgoals):
 1. finite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
 2. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
with f
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. f n \<in> s
strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> f l
[PROOF STEP]
show "\<exists>l\<in>s. \<exists>r. strict_mono  r \<and> (f \<circ> r) \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n \<in> s
strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> f l

goal (1 subgoal):
 1. \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite (range f)

goal (1 subgoal):
 1. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
with f assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. f n \<in> s
\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s \<longrightarrow> (\<exists>x\<in>s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> t))
infinite (range f)
[PROOF STEP]
have "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n \<in> s
\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s \<longrightarrow> (\<exists>x\<in>s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> t))
infinite (range f)

goal (1 subgoal):
 1. \<exists>x\<in>s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)

goal (1 subgoal):
 1. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)
[PROOF STEP]
obtain l where "l \<in> s" "\<forall>U. l\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l \<in> s; \<forall>U. l \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
l \<in> s
\<forall>U. l \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)

goal (1 subgoal):
 1. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
from this(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>U. l \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)
[PROOF STEP]
have "\<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>U. l \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
using acc_point_range_imp_convergent_subsequence[of l f]
[PROOF STATE]
proof (prove)
using this:
\<forall>U. l \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> range f)
\<forall>U. l \<in> U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> range f) \<Longrightarrow> \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. infinite (range f) \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
with \<open>l \<in> s\<close>
[PROOF STATE]
proof (chain)
picking this:
l \<in> s
\<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
show "\<exists>l\<in>s. \<exists>r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
[PROOF STATE]
proof (prove)
using this:
l \<in> s
\<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<forall>n. ?f2 n \<in> s \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (?f2 \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. ?f2 n \<in> s \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (?f2 \<circ> r) \<longlonglongrightarrow> l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ?f2 n \<in> s \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (?f2 \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. seq_compact s
[PROOF STEP]
unfolding seq_compact_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ?f2 n \<in> s \<Longrightarrow> \<exists>l\<in>s. \<exists>r. strict_mono r \<and> (?f2 \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<forall>f. (\<forall>n. f n \<in> s) \<longrightarrow> (\<exists>l\<in>s. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
seq_compact s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fmdom'_drop_set[simp]: "fmdom' (fmdrop_set A m) = fmdom' m - A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' (fmdrop_set A m) = fmdom' m - A
[PROOF STEP]
unfolding fmfilter_alt_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' (fmfilter (\<lambda>a. a \<notin> A) m) = fmdom' m - A
[PROOF STEP]
by auto


[STATEMENT]
lemma walk_alternates_sym:
  assumes "is_walk w"
  assumes "Suc i < length w" "i \<ge> 0"
  shows "w ! i \<in> Y \<longleftrightarrow> w ! (i + 1) \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w ! i \<in> Y) = (w ! (i + 1) \<in> X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (w ! i \<in> Y) = (w ! (i + 1) \<in> X)
[PROOF STEP]
interpret sym: bipartite_graph V E Y X
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bipartite_graph V E Y X
[PROOF STEP]
using bipartite_sym
[PROOF STATE]
proof (prove)
using this:
bipartite_graph V E Y X

goal (1 subgoal):
 1. bipartite_graph V E Y X
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (w ! i \<in> Y) = (w ! (i + 1) \<in> X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w ! i \<in> Y) = (w ! (i + 1) \<in> X)
[PROOF STEP]
using sym.walk_alternates assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_walk ?w; Suc ?i < length ?w; 0 \<le> ?i\<rbrakk> \<Longrightarrow> (?w ! ?i \<in> Y) = (?w ! (?i + 1) \<in> X)
is_walk w
Suc i < length w
0 \<le> i

goal (1 subgoal):
 1. (w ! i \<in> Y) = (w ! (i + 1) \<in> X)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(w ! i \<in> Y) = (w ! (i + 1) \<in> X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dist_real_noabs_less:
  fixes a b c :: real assumes "dist a b < c" shows "a - b < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b < c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dist a b < c

goal (1 subgoal):
 1. a - b < c
[PROOF STEP]
by (simp add: dist_real_def)


[STATEMENT]
lemma simple_zeroI:
  assumes "open s" "z \<in> s" "g holomorphic_on s" "g z \<noteq> 0"
  assumes "\<And>w. w \<in> s \<Longrightarrow> f w = g w * (w - z)"
  shows   "zorder f z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zorder f z = 1
[PROOF STEP]
using assms(1-4)
[PROOF STATE]
proof (prove)
using this:
open s
z \<in> s
g holomorphic_on s
g z \<noteq> 0

goal (1 subgoal):
 1. zorder f z = 1
[PROOF STEP]
by (rule zorder_eqI) (use assms(5) in auto)


[STATEMENT]
lemma parent_left_id[simp]: "parent (left i) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parent (left i) = i
[PROOF STEP]
unfolding parent_def left_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * i div 2 = i
[PROOF STEP]
by auto


[STATEMENT]
lemma fold_conv_fold_keys: "RBT_Set2.fold f rbt b = List.fold f (RBT_Set2.keys rbt) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RBT_Set2.fold f rbt b = List.fold f (keys rbt) b
[PROOF STEP]
by(simp add: RBT_Set2.fold_def RBT_Set2.keys_def RBT_Impl.fold_def RBT_Impl.keys_def fold_map o_def split_def)


[STATEMENT]
theorem lfinite_less_induct[consumes 1, case_names less]:
  assumes fin: "lfinite xs"
    and step: "\<And>xs. lfinite xs \<Longrightarrow> (\<And>zs. llength zs < llength xs \<Longrightarrow> P zs) \<Longrightarrow> P xs"
  shows "P xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P xs
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
lfinite xs

goal (1 subgoal):
 1. P xs
[PROOF STEP]
proof (induct "the_enat (llength xs)" arbitrary: xs rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<And>xsa. \<lbrakk>the_enat (llength xsa) < the_enat (llength xs); lfinite xsa\<rbrakk> \<Longrightarrow> P xsa; lfinite xs\<rbrakk> \<Longrightarrow> P xs
[PROOF STEP]
case (less xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>the_enat (llength ?xs) < the_enat (llength xs); lfinite ?xs\<rbrakk> \<Longrightarrow> P ?xs
lfinite xs

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<And>xsa. \<lbrakk>the_enat (llength xsa) < the_enat (llength xs); lfinite xsa\<rbrakk> \<Longrightarrow> P xsa; lfinite xs\<rbrakk> \<Longrightarrow> P xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P xs
[PROOF STEP]
using less(2)
[PROOF STATE]
proof (prove)
using this:
lfinite xs

goal (1 subgoal):
 1. P xs
[PROOF STEP]
by (intro step[OF less(2)] less(1))
      (auto dest!: lfinite_llength_enat simp: eSuc_enat elim!: less_enatE llength_eq_enat_lfiniteD)
[PROOF STATE]
proof (state)
this:
P xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bfs_correct:
      assumes "src\<in>V" "finite V"
      shows "bfs src dst
        \<le> SPEC (\<lambda>
          None \<Rightarrow> \<not>connected src dst
        | Some p \<Rightarrow> isShortestPath src p dst)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bfs src dst \<le> (spec x. case x of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst)
[PROOF STEP]
unfolding bfs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if src = dst then return (Some []) else pre_bfs src dst \<bind> (\<lambda>br. case br of None \<Rightarrow> return None | Some (d, PRED) \<Rightarrow> extract_rpath src dst PRED \<bind> (\<lambda>p. return (Some p)))) \<le> (spec x. case x of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst)
[PROOF STEP]
apply (refine_vcg
        pre_bfs_correct[THEN order_trans]
        valid_PRED.extract_rpath_correct[THEN order_trans]
        )
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. src = dst \<Longrightarrow> case Some [] of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst
 2. src \<noteq> dst \<Longrightarrow> src \<in> V
 3. src \<noteq> dst \<Longrightarrow> finite V
 4. \<And>x. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = None\<rbrakk> \<Longrightarrow> case None of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst
 5. \<And>x xa a b. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = Some xa; xa = (a, b)\<rbrakk> \<Longrightarrow> valid_PRED c src b
 6. \<And>x xa a b. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = Some xa; xa = (a, b)\<rbrakk> \<Longrightarrow> dst \<in> dom b
 7. \<And>x xa a b xb. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = Some xa; xa = (a, b); isSimplePath src xb dst \<and> length xb = min_dist src dst\<rbrakk> \<Longrightarrow> case Some xb of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
src \<in> V
finite V

goal (7 subgoals):
 1. src = dst \<Longrightarrow> case Some [] of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst
 2. src \<noteq> dst \<Longrightarrow> src \<in> V
 3. src \<noteq> dst \<Longrightarrow> finite V
 4. \<And>x. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = None\<rbrakk> \<Longrightarrow> case None of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst
 5. \<And>x xa a b. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = Some xa; xa = (a, b)\<rbrakk> \<Longrightarrow> valid_PRED c src b
 6. \<And>x xa a b. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = Some xa; xa = (a, b)\<rbrakk> \<Longrightarrow> dst \<in> dom b
 7. \<And>x xa a b xb. \<lbrakk>src \<noteq> dst; bfs_spec src dst x; x = Some xa; xa = (a, b); isSimplePath src xb dst \<and> length xb = min_dist src dst\<rbrakk> \<Longrightarrow> case Some xb of None \<Rightarrow> \<not> local.connected src dst | Some p \<Rightarrow> isShortestPath src p dst
[PROOF STEP]
apply (vc_solve
        simp: bfs_spec_def isShortestPath_min_dist_def isSimplePath_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma coeff_0_reflect_poly_0_iff [simp]: "coeff (reflect_poly p) 0 = 0 \<longleftrightarrow> p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (coeff (reflect_poly p) 0 = (0::'a)) = (p = 0)
[PROOF STEP]
by (simp add: coeff_reflect_poly)


[STATEMENT]
lemma is_inf_prefix[rule_format]: "
  \<lbrakk> length zs = length (xs \<sqinter> ys);
    \<And>i. i < length (xs \<sqinter> ys) \<Longrightarrow> zs ! i = xs ! i \<and> zs ! i = ys ! i \<rbrakk> \<Longrightarrow>
  zs = xs \<sqinter> ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length zs = length (xs \<sqinter> ys); \<And>i. i < length (xs \<sqinter> ys) \<Longrightarrow> zs ! i = xs ! i \<and> zs ! i = ys ! i\<rbrakk> \<Longrightarrow> zs = xs \<sqinter> ys
[PROOF STEP]
by (simp add: list_eq_iff inf_prefix_def)


[STATEMENT]
lemma floor_numeral [simp]: "\<lfloor>numeral v\<rfloor> = numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>numeral v\<rfloor> = numeral v
[PROOF STEP]
using floor_of_int [of "numeral v"]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>of_int (numeral v)\<rfloor> = numeral v

goal (1 subgoal):
 1. \<lfloor>numeral v\<rfloor> = numeral v
[PROOF STEP]
by simp


[STATEMENT]
lemma spanning_surjective_image:
  assumes us: "UNIV \<subseteq> m1.span S"
    and sf: "surj f"
  shows "UNIV \<subseteq> m2.span (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<subseteq> m2.span (f ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. UNIV \<subseteq> m2.span (f ` S)
[PROOF STEP]
have "UNIV \<subseteq> f ` UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<subseteq> range f
[PROOF STEP]
using sf
[PROOF STATE]
proof (prove)
using this:
surj f

goal (1 subgoal):
 1. UNIV \<subseteq> range f
[PROOF STEP]
by (auto simp add: surj_def)
[PROOF STATE]
proof (state)
this:
UNIV \<subseteq> range f

goal (1 subgoal):
 1. UNIV \<subseteq> m2.span (f ` S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
UNIV \<subseteq> range f

goal (1 subgoal):
 1. UNIV \<subseteq> m2.span (f ` S)
[PROOF STEP]
have " \<dots> \<subseteq> m2.span (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f \<subseteq> m2.span (f ` S)
[PROOF STEP]
using spans_image[OF us]
[PROOF STATE]
proof (prove)
using this:
range f \<subseteq> m2.span (f ` S)

goal (1 subgoal):
 1. range f \<subseteq> m2.span (f ` S)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
range f \<subseteq> m2.span (f ` S)

goal (1 subgoal):
 1. UNIV \<subseteq> m2.span (f ` S)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
UNIV \<subseteq> m2.span (f ` S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
UNIV \<subseteq> m2.span (f ` S)

goal (1 subgoal):
 1. UNIV \<subseteq> m2.span (f ` S)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
UNIV \<subseteq> m2.span (f ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigo_lesso5: "f <o g =o O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f <o g \<in> O(h) \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>
[PROOF STEP]
apply (simp only: lesso_def bigo_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. max (f x - g x) (0::'b)) \<in> {ha. \<exists>c>0::'b. \<forall>x. \<bar>ha x\<bar> \<le> c * \<bar>h x\<bar>} \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>(0::'b) < c; \<forall>x. f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> \<exists>C. \<forall>x. f x \<le> g x + C * \<bar>h x\<bar>
[PROOF STEP]
apply (rule_tac x = c in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. \<lbrakk>(0::'b) < c; \<forall>x. f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> \<forall>x. f x \<le> g x + c * \<bar>h x\<bar>
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c x. \<lbrakk>(0::'b) < c; \<forall>x. f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> f x \<le> g x + c * \<bar>h x\<bar>
[PROOF STEP]
apply (drule_tac x = x in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c x. \<lbrakk>(0::'b) < c; f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> f x \<le> g x + c * \<bar>h x\<bar>
[PROOF STEP]
apply (subgoal_tac "\<bar>max (f x - g x) 0\<bar> = max (f x - g x) 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>c x. \<lbrakk>(0::'b) < c; f x - g x \<le> c * \<bar>h x\<bar>; \<bar>max (f x - g x) (0::'b)\<bar> = max (f x - g x) (0::'b)\<rbrakk> \<Longrightarrow> f x \<le> g x + c * \<bar>h x\<bar>
 2. \<And>c x. \<lbrakk>(0::'b) < c; f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> \<bar>max (f x - g x) (0::'b)\<bar> = max (f x - g x) (0::'b)
[PROOF STEP]
apply (clarsimp simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c x. \<lbrakk>(0::'b) < c; f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> \<bar>max (f x - g x) (0::'b)\<bar> = max (f x - g x) (0::'b)
[PROOF STEP]
apply (rule abs_of_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c x. \<lbrakk>(0::'b) < c; f x - g x \<le> c * \<bar>h x\<bar>\<rbrakk> \<Longrightarrow> (0::'b) \<le> max (f x - g x) (0::'b)
[PROOF STEP]
apply (rule max.cobounded2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subst2_fresh_switch:
  assumes "\<phi> \<in> fmla" "t \<in> trm" "s \<in> trm" "x \<in> var" "y \<in> var"
    and "x \<noteq> y" "x \<notin> FvarsT s" "y \<notin> FvarsT t"
  shows "subst (subst \<phi> s y) t x = subst (subst \<phi> t x) s y"   (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst (subst \<phi> s y) t x = subst (subst \<phi> t x) s y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> fmla
t \<in> trm
s \<in> trm
x \<in> var
y \<in> var
x \<noteq> y
x \<notin> FvarsT s
y \<notin> FvarsT t

goal (1 subgoal):
 1. subst (subst \<phi> s y) t x = subst (subst \<phi> t x) s y
[PROOF STEP]
by (simp add: subst_compose_diff[of \<phi> s t y x])


[STATEMENT]
lemma dlist_all_conv_member: "dlist_all P dxs \<longleftrightarrow> (\<forall>x :: 'a. member dxs x \<longrightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dlist_all P dxs = (\<forall>x. member dxs x \<longrightarrow> P x)
[PROOF STEP]
by transfer(auto simp add: ID_ceq_neq_None equal.equal_eq[OF equal_ceq] list_all_iff List.member_def)


[STATEMENT]
lemma scaleQ_cong:
  assumes "y \<cong>\<^sub>Q z"
  shows "x *\<^sub>Q y \<cong>\<^sub>Q x *\<^sub>Q z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>Q y \<cong>\<^sub>Q x *\<^sub>Q z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<cong>\<^sub>Q z

goal (1 subgoal):
 1. x *\<^sub>Q y \<cong>\<^sub>Q x *\<^sub>Q z
[PROOF STEP]
by si_calc


[STATEMENT]
lemma multiplicity_normalize_left [simp]:
  "multiplicity (normalize p) x = multiplicity p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
 2. p \<noteq> (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
case [simp]: False
[PROOF STATE]
proof (state)
this:
p \<noteq> (0::'a)

goal (2 subgoals):
 1. p = (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
 2. p \<noteq> (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
have "normalize p = (1 div unit_factor p) * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize p = (1::'a) div unit_factor p * p
[PROOF STEP]
by (simp add: unit_div_commute is_unit_unit_factor)
[PROOF STATE]
proof (state)
this:
normalize p = (1::'a) div unit_factor p * p

goal (2 subgoals):
 1. p = (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
 2. p \<noteq> (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
normalize p = (1::'a) div unit_factor p * p

goal (2 subgoals):
 1. p = (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
 2. p \<noteq> (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
have "multiplicity \<dots> x = multiplicity p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity ((1::'a) div unit_factor p * p) x = multiplicity p x
[PROOF STEP]
by (rule multiplicity_times_unit_left) (simp add: is_unit_unit_factor)
[PROOF STATE]
proof (state)
this:
multiplicity ((1::'a) div unit_factor p * p) x = multiplicity p x

goal (2 subgoals):
 1. p = (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
 2. p \<noteq> (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
multiplicity (normalize p) x = multiplicity p x

goal (1 subgoal):
 1. multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
multiplicity (normalize p) x = multiplicity p x

goal (1 subgoal):
 1. p = (0::'a) \<Longrightarrow> multiplicity (normalize p) x = multiplicity p x
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma negligible_mono: "\<lbrakk> negligible g; f \<in> O(g) \<rbrakk> \<Longrightarrow> negligible f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>negligible g; f \<in> O(g)\<rbrakk> \<Longrightarrow> negligible f
[PROOF STEP]
by(rule negligibleI)(drule (1) negligibleD; erule (1) landau_o.big_small_trans)


[STATEMENT]
lemma norm_isometry_compose:
  assumes \<open>isometry U\<close>
  shows \<open>norm (U o\<^sub>C\<^sub>L A) = norm A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
have *: \<open>norm (U *\<^sub>V A *\<^sub>V \<psi>) = norm (A *\<^sub>V \<psi>)\<close> for \<psi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (U *\<^sub>V A *\<^sub>V \<psi>) = norm (A *\<^sub>V \<psi>)
[PROOF STEP]
by (smt (verit, ccfv_threshold) assms cblinfun_apply_cblinfun_compose cinner_adj_right cnorm_eq id_cblinfun_apply isometryD)
[PROOF STATE]
proof (state)
this:
norm (U *\<^sub>V A *\<^sub>V ?\<psi>) = norm (A *\<^sub>V ?\<psi>)

goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
have \<open>norm (U o\<^sub>C\<^sub>L A) = (SUP \<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = (\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>)
[PROOF STEP]
unfolding norm_cblinfun_Sup
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>\<psi>. norm ((U o\<^sub>C\<^sub>L A) *\<^sub>V \<psi>) / norm \<psi>) = (\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (U o\<^sub>C\<^sub>L A) = (\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>)

goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (U o\<^sub>C\<^sub>L A) = (\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>)

goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
have \<open>\<dots> = (SUP \<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>) = (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
norm (U *\<^sub>V A *\<^sub>V ?\<psi>) = norm (A *\<^sub>V ?\<psi>)

goal (1 subgoal):
 1. (\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>) = (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>) = (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)

goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>\<psi>. norm (U *\<^sub>V A *\<^sub>V \<psi>) / norm \<psi>) = (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)

goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
have \<open>\<dots> = norm A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>) = norm A
[PROOF STEP]
unfolding norm_cblinfun_Sup
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>) = (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>) = norm A

goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (U o\<^sub>C\<^sub>L A) = norm A

goal (1 subgoal):
 1. norm (U o\<^sub>C\<^sub>L A) = norm A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (U o\<^sub>C\<^sub>L A) = norm A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Inv_swap: assumes "dist_perm xs ys"
shows "Inv xs (swap n ys) =
  (if Suc n < size xs
   then if ys!n < ys!Suc n in xs
        then Inv xs ys \<union> {(ys!n, ys!Suc n)}
        else Inv xs ys - {(ys!Suc n, ys!n)}
   else Inv xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inv xs (swap n ys) = (if Suc n < length xs then if ys ! n < ys ! Suc n in xs then Inv xs ys \<union> {(ys ! n, ys ! Suc n)} else Inv xs ys - {(ys ! Suc n, ys ! n)} else Inv xs ys)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inv xs (swap n ys) = (if Suc n < length xs then if ys ! n < ys ! Suc n in xs then Inv xs ys \<union> {(ys ! n, ys ! Suc n)} else Inv xs ys - {(ys ! Suc n, ys ! n)} else Inv xs ys)
[PROOF STEP]
have "length xs = length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dist_perm xs ys

goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
by (metis distinct_card)
[PROOF STATE]
proof (state)
this:
length xs = length ys

goal (1 subgoal):
 1. Inv xs (swap n ys) = (if Suc n < length xs then if ys ! n < ys ! Suc n in xs then Inv xs ys \<union> {(ys ! n, ys ! Suc n)} else Inv xs ys - {(ys ! Suc n, ys ! n)} else Inv xs ys)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
dist_perm xs ys
length xs = length ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist_perm xs ys
length xs = length ys

goal (1 subgoal):
 1. Inv xs (swap n ys) = (if Suc n < length xs then if ys ! n < ys ! Suc n in xs then Inv xs ys \<union> {(ys ! n, ys ! Suc n)} else Inv xs ys - {(ys ! Suc n, ys ! n)} else Inv xs ys)
[PROOF STEP]
by(simp add: Inv_def set_eq_iff)
      (metis before_in_def not_before_in before_in_swap)
[PROOF STATE]
proof (state)
this:
Inv xs (swap n ys) = (if Suc n < length xs then if ys ! n < ys ! Suc n in xs then Inv xs ys \<union> {(ys ! n, ys ! Suc n)} else Inv xs ys - {(ys ! Suc n, ys ! n)} else Inv xs ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans_refl_imp_O_id:
  assumes "trans r" "refl r"
  shows "r O r = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r O r = r
[PROOF STEP]
proof(intro equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r O r \<subseteq> r
 2. r \<subseteq> r O r
[PROOF STEP]
show "r O r \<subseteq> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r O r \<subseteq> r
[PROOF STEP]
by(fact trans_O_subset[OF assms(1)])
[PROOF STATE]
proof (state)
this:
r O r \<subseteq> r

goal (1 subgoal):
 1. r \<subseteq> r O r
[PROOF STEP]
have "r \<subseteq> r O Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<subseteq> r O Id
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r \<subseteq> r O Id

goal (1 subgoal):
 1. r \<subseteq> r O r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
r \<subseteq> r O Id

goal (1 subgoal):
 1. r \<subseteq> r O r
[PROOF STEP]
have "Id \<subseteq> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Id \<subseteq> r
[PROOF STEP]
by(fact assms(2)[unfolded refl_O_iff])
[PROOF STATE]
proof (state)
this:
Id \<subseteq> r

goal (1 subgoal):
 1. r \<subseteq> r O r
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
r \<subseteq> r O Id
Id \<subseteq> r
[PROOF STEP]
show "r \<subseteq> r O r"
[PROOF STATE]
proof (prove)
using this:
r \<subseteq> r O Id
Id \<subseteq> r

goal (1 subgoal):
 1. r \<subseteq> r O r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r \<subseteq> r O r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm057:
  "fst pair = snd (flip pair) & snd pair = fst (flip pair)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst pair = snd (flip pair) \<and> snd pair = fst (flip pair)
[PROOF STEP]
unfolding flip_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst pair = snd (snd pair, fst pair) \<and> snd pair = fst (snd pair, fst pair)
[PROOF STEP]
by simp


[STATEMENT]
lemma DERIV_fun_exp: "DERIV g x :> m \<Longrightarrow> DERIV (\<lambda>x. exp (g x)) x :> exp (g x) * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_field_derivative m) (at x) \<Longrightarrow> ((\<lambda>x. exp (g x)) has_field_derivative exp (g x) * m) (at x)
[PROOF STEP]
by (auto intro!: derivative_intros)


[STATEMENT]
lemma phi_empty2: "length init = 0 \<Longrightarrow> phi n (c,(b,i)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length init = 0 \<Longrightarrow> \<phi> n (c, b, i) = 0
[PROOF STEP]
apply(simp only: phi.simps Inv_empty3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length init = 0 \<Longrightarrow> (\<Sum>(x, y)\<in>{}. if b ! index init y then 2 else 1) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma brouwer_surjective:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'n"
  assumes "compact T"
    and "convex T"
    and "T \<noteq> {}"
    and "continuous_on T f"
    and "\<And>x y. \<lbrakk>x\<in>S; y\<in>T\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> T"
    and "x \<in> S"
  shows "\<exists>y\<in>T. f y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>T. f y = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y\<in>T. f y = x
[PROOF STEP]
have *: "\<And>x y. f y = x \<longleftrightarrow> x + (y - f y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (f y = x) = (x + (y - f y) = y)
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(f ?y = ?x) = (?x + (?y - f ?y) = ?y)

goal (1 subgoal):
 1. \<exists>y\<in>T. f y = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>T. f y = x
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>T. x + (y - f y) = y
[PROOF STEP]
apply (rule brouwer[OF assms(1-3), of "\<lambda>y. x + (y - f y)"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on T (\<lambda>y. x + (y - f y))
 2. (\<lambda>y. x + (y - f y)) ` T \<subseteq> T
 3. \<And>xa. \<lbrakk>xa \<in> T; x + (xa - f xa) = xa\<rbrakk> \<Longrightarrow> \<exists>y\<in>T. x + (y - f y) = y
[PROOF STEP]
apply (intro continuous_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on T f
 2. (\<lambda>y. x + (y - f y)) ` T \<subseteq> T
 3. \<And>xa. \<lbrakk>xa \<in> T; x + (xa - f xa) = xa\<rbrakk> \<Longrightarrow> \<exists>y\<in>T. x + (y - f y) = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compact T
convex T
T \<noteq> {}
continuous_on T f
\<lbrakk>?x \<in> S; ?y \<in> T\<rbrakk> \<Longrightarrow> ?x + (?y - f ?y) \<in> T
x \<in> S

goal (3 subgoals):
 1. continuous_on T f
 2. (\<lambda>y. x + (y - f y)) ` T \<subseteq> T
 3. \<And>xa. \<lbrakk>xa \<in> T; x + (xa - f xa) = xa\<rbrakk> \<Longrightarrow> \<exists>y\<in>T. x + (y - f y) = y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>T. f y = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma register_projector:
  assumes "register F"
  assumes "is_Proj a"
  shows "is_Proj (F a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_Proj (F a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
register F
is_Proj a

goal (1 subgoal):
 1. is_Proj (F a)
[PROOF STEP]
unfolding register_def is_Proj_algebraic
[PROOF STATE]
proof (prove)
using this:
clinear F \<and> F id_cblinfun = id_cblinfun \<and> (\<forall>a b. F (a o\<^sub>C\<^sub>L b) = F a o\<^sub>C\<^sub>L F b) \<and> (\<forall>a. F (a*) = F a*)
a o\<^sub>C\<^sub>L a = a \<and> a = a*

goal (1 subgoal):
 1. F a o\<^sub>C\<^sub>L F a = F a \<and> F a = F a*
[PROOF STEP]
by metis


[STATEMENT]
lemma downset_faithful: "\<down>x \<subseteq> \<down>y \<Longrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<down> x \<subseteq> \<down> y \<Longrightarrow> x \<le> y
[PROOF STEP]
by (simp add: downset_prop subset_eq)


[STATEMENT]
lemma subset_natUnion: "(\<forall> n. X \<subseteq> f n) \<Longrightarrow> X \<subseteq> natUnion f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. X \<subseteq> f n \<Longrightarrow> X \<subseteq> natUnion f
[PROOF STEP]
by (auto simp add: natUnion_def)


[STATEMENT]
lemma real_of_nat_div3: "real n / real x - real (n div x) \<le> 1" for n x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n / real x - real (n div x) \<le> 1
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> real n / real x - real (n div x) \<le> 1
 2. x \<noteq> 0 \<Longrightarrow> real n / real x - real (n div x) \<le> 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> real n / real x - real (n div x) \<le> 1
 2. x \<noteq> 0 \<Longrightarrow> real n / real x - real (n div x) \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. real n / real x - real (n div x) \<le> 1
[PROOF STEP]
by (metis of_int_of_nat_eq real_of_int_div3 zdiv_int)
[PROOF STATE]
proof (state)
this:
real n / real x - real (n div x) \<le> 1

goal (1 subgoal):
 1. x = 0 \<Longrightarrow> real n / real x - real (n div x) \<le> 1
[PROOF STEP]
qed auto


[STATEMENT]
lemma shortest_path_obtains:
  assumes "shortest_path u v = n"
  assumes "n \<noteq> top"
  obtains p where "p \<in> connecting_paths u v" and "walk_length p = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> connecting_paths u v; walk_length p = n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using enat_in_INF shortest_path_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Inf (?f ` ?S) \<noteq> top; \<And>x. \<lbrakk>x \<in> ?S; Inf (?f ` ?S) = ?f x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
shortest_path ?u ?v \<equiv> INF p\<in>connecting_paths ?u ?v. enat (walk_length p)

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> connecting_paths u v; walk_length p = n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms(1) assms(2) the_enat.simps)


[STATEMENT]
lemma vec_mset_MV_Rel[transfer_rule]:
  "(MV_Rel  ===> (=)) (\<lambda> v. vec_mset (vec_mod v)) (\<lambda> v. image_mset (to_int_mod_ring) (vec_mset v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MV_Rel ===> (=)) (\<lambda>v. vec_mset (vec_mod v)) (\<lambda>v. image_mset to_int_mod_ring (vec_mset v))
[PROOF STEP]
unfolding MV_Rel_def rel_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. vec_mod x = to_int_vec y \<longrightarrow> vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
proof (intro allI impI subset_antisym subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. vec_mod x = to_int_vec y \<Longrightarrow> vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
fix x :: "int vec"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. vec_mod x = to_int_vec y \<Longrightarrow> vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
fix  y :: "'a mod_ring vec"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. vec_mod x = to_int_vec y \<Longrightarrow> vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
assume assm: "vec_mod x = to_int_vec y"
[PROOF STATE]
proof (state)
this:
vec_mod x = to_int_vec y

goal (1 subgoal):
 1. \<And>x y. vec_mod x = to_int_vec y \<Longrightarrow> vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
have "image_mset to_int_mod_ring (vec_mset y) = vec_mset (to_int_vec y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset to_int_mod_ring (vec_mset y) = vec_mset (to_int_vec y)
[PROOF STEP]
using inj_zero_hom.vec_hom_mset to_int_mod_ring_hom.inj_zero_hom_axioms
[PROOF STATE]
proof (prove)
using this:
inj_zero_hom ?hom \<Longrightarrow> image_mset ?hom (vec_mset ?v) = vec_mset (map_vec ?hom ?v)
inj_zero_hom to_int_mod_ring

goal (1 subgoal):
 1. image_mset to_int_mod_ring (vec_mset y) = vec_mset (to_int_vec y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
image_mset to_int_mod_ring (vec_mset y) = vec_mset (to_int_vec y)

goal (1 subgoal):
 1. \<And>x y. vec_mod x = to_int_vec y \<Longrightarrow> vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
image_mset to_int_mod_ring (vec_mset y) = vec_mset (to_int_vec y)
[PROOF STEP]
show " vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)"
[PROOF STATE]
proof (prove)
using this:
image_mset to_int_mod_ring (vec_mset y) = vec_mset (to_int_vec y)

goal (1 subgoal):
 1. vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
using assm
[PROOF STATE]
proof (prove)
using this:
image_mset to_int_mod_ring (vec_mset y) = vec_mset (to_int_vec y)
vec_mod x = to_int_vec y

goal (1 subgoal):
 1. vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec_mset (vec_mod x) = image_mset to_int_mod_ring (vec_mset y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma flatten_prod: "flatten (prod f I) = (\<Prod>i\<in>I. flatten (f i :: _ \<Rightarrow>\<^sub>0 _::comm_semiring_1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flatten (prod f I) = (\<Prod>i\<in>I. flatten (f i))
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (simp_all add: flatten_times)


[STATEMENT]
lemma signed_real_of_word_sum_less_eq_neg_numeral_iff:
  \<open>signed_real_of_word v + signed_real_of_word w \<le> - numeral n
    \<longleftrightarrow> sint v + sint w \<le> - numeral n\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> - numeral n) = (sint v + sint w \<le> - numeral n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> - numeral n) = (sint v + sint w \<le> - numeral n)
[PROOF STEP]
have \<open>?Q \<longleftrightarrow> real_of_int (sint v + sint w) \<le> real_of_int (- numeral n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sint v + sint w \<le> - numeral n) = (real_of_int (sint v + sint w) \<le> real_of_int (- numeral n))
[PROOF STEP]
by (simp only: of_int_le_iff)
[PROOF STATE]
proof (state)
this:
(sint v + sint w \<le> - numeral n) = (real_of_int (sint v + sint w) \<le> real_of_int (- numeral n))

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> - numeral n) = (sint v + sint w \<le> - numeral n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(sint v + sint w \<le> - numeral n) = (real_of_int (sint v + sint w) \<le> real_of_int (- numeral n))

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> - numeral n) = (sint v + sint w \<le> - numeral n)
[PROOF STEP]
have \<open>\<dots> \<longleftrightarrow> ?P\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (sint v + sint w) \<le> real_of_int (- numeral n)) = (signed_real_of_word v + signed_real_of_word w \<le> - numeral n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(real_of_int (sint v + sint w) \<le> real_of_int (- numeral n)) = (signed_real_of_word v + signed_real_of_word w \<le> - numeral n)

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> - numeral n) = (sint v + sint w \<le> - numeral n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(sint v + sint w \<le> - numeral n) = (signed_real_of_word v + signed_real_of_word w \<le> - numeral n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sint v + sint w \<le> - numeral n) = (signed_real_of_word v + signed_real_of_word w \<le> - numeral n)

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> - numeral n) = (sint v + sint w \<le> - numeral n)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(signed_real_of_word v + signed_real_of_word w \<le> - numeral n) = (sint v + sint w \<le> - numeral n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma well_formed_h_obs_impl_from_h :
  assumes "h_obs_wpi M = h_obs_impl_from_h (h_wpi M)"
  shows "h_obs_impl  (h_wpi M) q x y = (h_obs_lookup  (h_obs_wpi M) q x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h_obs_impl (h_wpi M) q x y = (case Mapping.lookup (h_obs_wpi M) (q, x) of None \<Rightarrow> None | Some m \<Rightarrow> Mapping.lookup m y)
[PROOF STEP]
unfolding assms h_obs_impl_from_h_invar
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case Mapping.lookup (h_obs_impl_from_h (h_wpi M)) (q, x) of None \<Rightarrow> None | Some m \<Rightarrow> Mapping.lookup m y) = (case Mapping.lookup (h_obs_impl_from_h (h_wpi M)) (q, x) of None \<Rightarrow> None | Some m \<Rightarrow> Mapping.lookup m y)
[PROOF STEP]
by presburger


[STATEMENT]
lemma Fake_analz_insert:
     "X\<in> synth (analz G) ==>
      analz (insert X H) \<subseteq> synth (analz G) \<union> analz (G \<union> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> synth (analz G) \<Longrightarrow> analz (insert X H) \<subseteq> synth (analz G) \<union> analz (G \<union> H)
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>X \<in> synth (analz G); x \<in> analz (insert X H)\<rbrakk> \<Longrightarrow> x \<in> synth (analz G) \<union> analz (G \<union> H)
[PROOF STEP]
apply (subgoal_tac "x \<in> analz (synth (analz G) \<union> H)", force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>X \<in> synth (analz G); x \<in> analz (insert X H)\<rbrakk> \<Longrightarrow> x \<in> analz (synth (analz G) \<union> H)
[PROOF STEP]
apply (blast intro: analz_mono [THEN [2] rev_subsetD] analz_mono [THEN synth_mono, THEN [2] rev_subsetD])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rec_accum_Suc_simp_rewrite:
  "primerec f (Suc (length xs))
    \<Longrightarrow> rec_exec (rec_accum f) (xs @ [Suc x]) =
    rec_exec (rec_accum f) (xs @ [x]) * rec_exec f (xs @ [Suc x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primerec f (Suc (length xs)) \<Longrightarrow> rec_exec (rec_accum f) (xs @ [Suc x]) = rec_exec (rec_accum f) (xs @ [x]) * rec_exec f (xs @ [Suc x])
[PROOF STEP]
apply(induct x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. primerec f (Suc (length xs)) \<Longrightarrow> rec_exec (rec_accum f) (xs @ [Suc 0]) = rec_exec (rec_accum f) (xs @ [0]) * rec_exec f (xs @ [Suc 0])
 2. \<And>x. \<lbrakk>primerec f (Suc (length xs)) \<Longrightarrow> rec_exec (rec_accum f) (xs @ [Suc x]) = rec_exec (rec_accum f) (xs @ [x]) * rec_exec f (xs @ [Suc x]); primerec f (Suc (length xs))\<rbrakk> \<Longrightarrow> rec_exec (rec_accum f) (xs @ [Suc (Suc x)]) = rec_exec (rec_accum f) (xs @ [Suc x]) * rec_exec f (xs @ [Suc (Suc x)])
[PROOF STEP]
apply(auto simp: rec_sigma.simps Let_def rec_pr_Suc_simp_rewrite
      rec_exec.simps get_fstn_args_take)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ik_union_subset: "\<Union>(P ` ik\<^sub>s\<^sub>t S) \<subseteq> (\<Union>x \<in> (set S). \<Union>(P ` trms\<^sub>s\<^sub>t\<^sub>p x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (P ` ik\<^sub>s\<^sub>t S) \<subseteq> (\<Union>x\<in>set S. \<Union> (P ` trms\<^sub>s\<^sub>t\<^sub>p x))
[PROOF STEP]
by (induct S rule: ik\<^sub>s\<^sub>t.induct) auto